开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜