Why the given expression takes so long in IRB
Any idea why the following simple expression lasts so long in IRB:
irb(main):003:0> res='a'*(10**6)
It runs several minutes before finishes.
Whereas suppling the same expression to puts method f.E. is instanteous:
irb(main):003:0> p开发者_如何学编程uts('a'*(10**6))
I just figured out it's caused by Wirb module loaded from .irbrc startup file. By commenting it out both examples now run comparable fast.
精彩评论