Forum: Ruby nil? takes much time

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Victor S. (Guest)
on 2006-04-28 02:52
(Received via mailing list)
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 :)

This topic is locked and can not be replied to.