[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Load vs Require

Hugo

1/28/2006 11:03:00 AM

Hello all!
Is there any difference between using Load and Require?
These two methods have the same performance?

Thank you for your answers.

Best regards,
Hugo

--
Posted via http://www.ruby-....


1 Answer

ES

1/28/2006 11:24:00 AM

0

On 2006.01.28 20:02, Hugo wrote:
> Hello all!
> Is there any difference between using Load and Require?
> These two methods have the same performance?

#load always loads and interprets the file in question,
whereas #require will only do it the first time around
(filenames required earlier in $" or $LOADED_FEATURES).
This is very useful if you have a file that might change
while the program is running.

Here the two methods have distinctly different effects,
so efficiency should not really be a factor--just use
#load only when above behaviour is desired.

(And, in general, worry about performance only after
you have profiled your program and identified the
bottlenecks :)

> Thank you for your answers.
>
> Best regards,
> Hugo


E