Nil? takes much time

Hello all.

In one my class I’ve had very simple method:

def stored?

And I’ve suddenly noticed (due to profile) that nil? Takes a significant
amount of time here.

Redefining the above method like

def stored?

(in if’s it works good) speedups the entire program.

I’m a bit surprized :slight_smile:


This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs