Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Ruby
[QUIZ] Happy Numbers (#93)
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Sander Land, post: 4525546"] Is that really so much faster? Worth breaking on empty arrays? Just had to test if there was any performance difference, results: user system total real inject(0) 20.320000 5.430000 25.750000 ( 34.486938) inject 20.450000 5.350000 25.800000 ( 30.152165) inject &:+ 37.860000 5.690000 43.550000 ( 45.670349) each 11.130000 3.460000 14.590000 ( 15.042142) C 0.020000 0.000000 0.020000 ( 0.019815) so inject(0) vs inject doesn't really matter. code: [URL]http://pastie.caboo.se/11534[/URL] (and yes i know the C code doesn't handle bignums) [USER=4628]@robert[/USER]: you mean the thread "for performance, write in C" ? ;) [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Ruby
[QUIZ] Happy Numbers (#93)
Top