Forum: Ruby-core [ruby-trunk - Bug #7778][Open] Irb loading generates 17x more open/stat system calls when a locale i

Posted by lzap (Lukas Zapletal) (Guest)
on 2013-02-03 20:36
(Received via mailing list)
Issue #7778 has been reported by lzap (Lukas Zapletal).

----------------------------------------
Bug #7778: Irb loading generates 17x more open/stat system calls when a 
locale is set
https://bugs.ruby-lang.org/issues/7778

Author: lzap (Lukas Zapletal)
Status: Open
Priority: Normal
Assignee:
Category:
Target version:
ruby -v: ruby 2.0.0dev (2013-01-07 trunk 38733) [x86_64-linux]


Hello,

I did just found out that when I have a locale set (e.g. cs_CZ in my 
case), irb does some extra finding for rb/so files which are being 
required. That slows down loading time and if you have many rubygems, 
loading can be really slow.

$ LC_ALL=cs_CZ strace irb < /dev/null 2>&1 | grep ENOENT | wc -l
5195

$ LC_ALL=C strace irb < /dev/null 2>&1 | grep ENOENT | wc -l
293

$ time LC_ALL=cs_CZ irb < /dev/null
real  0m0.262s
user  0m0.165s
sys  0m0.023s

$ time LC_ALL=C irb < /dev/null
real  0m0.084s
user  0m0.066s
sys  0m0.014s

Tested on stable 1.9.3 and also on 2.0 RC1. All the same.
Posted by ko1 (Koichi Sasada) (Guest)
on 2013-02-17 06:23
(Received via mailing list)
Issue #7778 has been updated by ko1 (Koichi Sasada).

Category set to lib
Assignee set to keiju (Keiju Ishitsuka)
Target version set to next minor

Is it only for irb?
Same as Ruby command?

----------------------------------------
Bug #7778: Irb loading generates 17x more open/stat system calls when a 
locale is set
https://bugs.ruby-lang.org/issues/7778#change-36378

Author: lzap (Lukas Zapletal)
Status: Open
Priority: Normal
Assignee: keiju (Keiju Ishitsuka)
Category: lib
Target version: next minor
ruby -v: ruby 2.0.0dev (2013-01-07 trunk 38733) [x86_64-linux]


Hello,

I did just found out that when I have a locale set (e.g. cs_CZ in my 
case), irb does some extra finding for rb/so files which are being 
required. That slows down loading time and if you have many rubygems, 
loading can be really slow.

$ LC_ALL=cs_CZ strace irb < /dev/null 2>&1 | grep ENOENT | wc -l
5195

$ LC_ALL=C strace irb < /dev/null 2>&1 | grep ENOENT | wc -l
293

$ time LC_ALL=cs_CZ irb < /dev/null
real  0m0.262s
user  0m0.165s
sys  0m0.023s

$ time LC_ALL=C irb < /dev/null
real  0m0.084s
user  0m0.066s
sys  0m0.014s

Tested on stable 1.9.3 and also on 2.0 RC1. All the same.
Posted by keiju (Keiju Ishitsuka) (Guest)
on 2013-02-17 14:51
(Received via mailing list)
Issue #7778 has been updated by keiju (Keiju Ishitsuka).


Irb search directories of RUBY_PATH for irb message locale files, if 
LC_ALL etc. is set.

Therefore, this is not a bug.

----------------------------------------
Bug #7778: Irb loading generates 17x more open/stat system calls when a 
locale is set
https://bugs.ruby-lang.org/issues/7778#change-36438

Author: lzap (Lukas Zapletal)
Status: Open
Priority: Normal
Assignee: keiju (Keiju Ishitsuka)
Category: lib
Target version: next minor
ruby -v: ruby 2.0.0dev (2013-01-07 trunk 38733) [x86_64-linux]


Hello,

I did just found out that when I have a locale set (e.g. cs_CZ in my 
case), irb does some extra finding for rb/so files which are being 
required. That slows down loading time and if you have many rubygems, 
loading can be really slow.

$ LC_ALL=cs_CZ strace irb < /dev/null 2>&1 | grep ENOENT | wc -l
5195

$ LC_ALL=C strace irb < /dev/null 2>&1 | grep ENOENT | wc -l
293

$ time LC_ALL=cs_CZ irb < /dev/null
real  0m0.262s
user  0m0.165s
sys  0m0.023s

$ time LC_ALL=C irb < /dev/null
real  0m0.084s
user  0m0.066s
sys  0m0.014s

Tested on stable 1.9.3 and also on 2.0 RC1. All the same.
Posted by keiju (Keiju Ishitsuka) (Guest)
on 2013-02-21 12:14
(Received via mailing list)
Issue #7778 has been updated by keiju (Keiju Ishitsuka).

Status changed from Open to Rejected


----------------------------------------
Bug #7778: Irb loading generates 17x more open/stat system calls when a 
locale is set
https://bugs.ruby-lang.org/issues/7778#change-36707

Author: lzap (Lukas Zapletal)
Status: Rejected
Priority: Normal
Assignee: keiju (Keiju Ishitsuka)
Category: lib
Target version: next minor
ruby -v: ruby 2.0.0dev (2013-01-07 trunk 38733) [x86_64-linux]


Hello,

I did just found out that when I have a locale set (e.g. cs_CZ in my 
case), irb does some extra finding for rb/so files which are being 
required. That slows down loading time and if you have many rubygems, 
loading can be really slow.

$ LC_ALL=cs_CZ strace irb < /dev/null 2>&1 | grep ENOENT | wc -l
5195

$ LC_ALL=C strace irb < /dev/null 2>&1 | grep ENOENT | wc -l
293

$ time LC_ALL=cs_CZ irb < /dev/null
real  0m0.262s
user  0m0.165s
sys  0m0.023s

$ time LC_ALL=C irb < /dev/null
real  0m0.084s
user  0m0.066s
sys  0m0.014s

Tested on stable 1.9.3 and also on 2.0 RC1. All the same.
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.