3 ms·
Is this 400-500% true for more expensive operations inside of the block? It seems like he's just comparing the cost of procs to the cost of 1+1. I don't think t
by voronoff 12y ago
Is this 400-500% true for more expensive operations inside of the block? It seems like he's just comparing the cost of procs to the cost of 1+1. I don't think the generalization has been established here.
- vidarh 12y agoYou're right, he's comparing the cost for that very simple case. Do anything remotely complex and it quickly becomes just noise.
- timr 12y agoAs with all things, it depends on context. If you're trying to write a graphics or audio system in Ruby, this kind of thing can really matter. If you're writing a Rails app, it's rounding error on the time waiting for I/O. Profiling is essential when figuring out how to improve your code. What we're doing here is explaining one weird benchmark result.
- voronoff 12y agoExcept that's not what's being said: "Why blocks make Ruby methods 439% slower" implies something that isn't happening here, at least to me.