ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:114950] [Ruby master Bug#19911] require slower with ruby/3.2.2
@ 2023-10-05 17:36 ashwinsurya14 (Ashwin Surya Kumar Sivasubramanian) via ruby-core
  2023-10-05 17:37 ` [ruby-core:114951] " ashwinsurya14 (Ashwin Surya Kumar Sivasubramanian) via ruby-core
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: ashwinsurya14 (Ashwin Surya Kumar Sivasubramanian) via ruby-core @ 2023-10-05 17:36 UTC (permalink / raw
  To: ruby-core; +Cc: ashwinsurya14 (Ashwin Surya Kumar Sivasubramanian)

Issue #19911 has been reported by ashwinsurya14 (Ashwin Surya Kumar Sivasubramanian).

----------------------------------------
Bug #19911: require slower with ruby/3.2.2
https://bugs.ruby-lang.org/issues/19911

* Author: ashwinsurya14 (Ashwin Surya Kumar Sivasubramanian)
* Status: Open
* Priority: Normal
* ruby -v: ruby 3.2.2 (2023-03-30 revision e51014f9c0) [x86_64-linux]
* Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN
----------------------------------------
we tested require with ruby 3.2.2 and ruby 2.7.2
and its seems to slowdown considerabily

the test case:
Ruby 3.2.2
command: time ruby -e 'require "json"'
time: user=0.19s system=0.02s cpu=99% total=0.204

Ruby 2.7.2
command: time ruby -e 'require "json"'
time: user=0.05s system=0.02s cpu=98% total=0.064

We also saw the same slowdown with File.read

Not sure that is casuing the slowdown in require also

On side note we saw three times more lstat on strace with the above command on ruby/3.2.2.Not sure if that is the root cause

I also tested with multiple versions of ruby 2* starting with ruby/2.3.1 and it doesnt seem to have this slowdown







-- 
https://bugs.ruby-lang.org/
 ______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [ruby-core:114951] [Ruby master Bug#19911] require slower with ruby/3.2.2
  2023-10-05 17:36 [ruby-core:114950] [Ruby master Bug#19911] require slower with ruby/3.2.2 ashwinsurya14 (Ashwin Surya Kumar Sivasubramanian) via ruby-core
@ 2023-10-05 17:37 ` ashwinsurya14 (Ashwin Surya Kumar Sivasubramanian) via ruby-core
  2023-10-05 21:14 ` [ruby-core:114952] " ashwinsurya14 (Ashwin Surya Kumar Sivasubramanian) via ruby-core
  2023-10-05 22:28 ` [ruby-core:114954] " k0kubun (Takashi Kokubun) via ruby-core
  2 siblings, 0 replies; 4+ messages in thread
From: ashwinsurya14 (Ashwin Surya Kumar Sivasubramanian) via ruby-core @ 2023-10-05 17:37 UTC (permalink / raw
  To: ruby-core; +Cc: ashwinsurya14 (Ashwin Surya Kumar Sivasubramanian)

Issue #19911 has been updated by ashwinsurya14 (Ashwin Surya Kumar Sivasubramanian).


Also i have seen this happeneing in other versions/systems one other thing i tested was with ubuntu.

----------------------------------------
Bug #19911: require slower with ruby/3.2.2
https://bugs.ruby-lang.org/issues/19911#change-104821

* Author: ashwinsurya14 (Ashwin Surya Kumar Sivasubramanian)
* Status: Open
* Priority: Normal
* ruby -v: ruby 3.2.2 (2023-03-30 revision e51014f9c0) [x86_64-linux]
* Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN
----------------------------------------
we tested require with ruby 3.2.2 and ruby 2.7.2
and its seems to slowdown considerabily

the test case:
Ruby 3.2.2
command: time ruby -e 'require "json"'
time: user=0.19s system=0.02s cpu=99% total=0.204

Ruby 2.7.2
command: time ruby -e 'require "json"'
time: user=0.05s system=0.02s cpu=98% total=0.064

We also saw the same slowdown with File.read

Not sure that is casuing the slowdown in require also

On side note we saw three times more lstat on strace with the above command on ruby/3.2.2.Not sure if that is the root cause

I also tested with multiple versions of ruby 2* starting with ruby/2.3.1 and it doesnt seem to have this slowdown







-- 
https://bugs.ruby-lang.org/
 ______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [ruby-core:114952] [Ruby master Bug#19911] require slower with ruby/3.2.2
  2023-10-05 17:36 [ruby-core:114950] [Ruby master Bug#19911] require slower with ruby/3.2.2 ashwinsurya14 (Ashwin Surya Kumar Sivasubramanian) via ruby-core
  2023-10-05 17:37 ` [ruby-core:114951] " ashwinsurya14 (Ashwin Surya Kumar Sivasubramanian) via ruby-core
@ 2023-10-05 21:14 ` ashwinsurya14 (Ashwin Surya Kumar Sivasubramanian) via ruby-core
  2023-10-05 22:28 ` [ruby-core:114954] " k0kubun (Takashi Kokubun) via ruby-core
  2 siblings, 0 replies; 4+ messages in thread
From: ashwinsurya14 (Ashwin Surya Kumar Sivasubramanian) via ruby-core @ 2023-10-05 21:14 UTC (permalink / raw
  To: ruby-core; +Cc: ashwinsurya14 (Ashwin Surya Kumar Sivasubramanian)

Issue #19911 has been updated by ashwinsurya14 (Ashwin Surya Kumar Sivasubramanian).


On further debugging we found that the following is speeding up the require and file read operation

time ruby --disable-gems -e 'require "json"'                                                                                                                                                                                       05:13:22 PM
user=0.04s system=0.01s cpu=99% total=0.051


----------------------------------------
Bug #19911: require slower with ruby/3.2.2
https://bugs.ruby-lang.org/issues/19911#change-104823

* Author: ashwinsurya14 (Ashwin Surya Kumar Sivasubramanian)
* Status: Open
* Priority: Normal
* ruby -v: ruby 3.2.2 (2023-03-30 revision e51014f9c0) [x86_64-linux]
* Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN
----------------------------------------
we tested require with ruby 3.2.2 and ruby 2.7.2
and its seems to slowdown considerabily

the test case:
Ruby 3.2.2
command: time ruby -e 'require "json"'
time: user=0.19s system=0.02s cpu=99% total=0.204

Ruby 2.7.2
command: time ruby -e 'require "json"'
time: user=0.05s system=0.02s cpu=98% total=0.064

We also saw the same slowdown with File.read

Not sure that is casuing the slowdown in require also

On side note we saw three times more lstat on strace with the above command on ruby/3.2.2.Not sure if that is the root cause

I also tested with multiple versions of ruby 2* starting with ruby/2.3.1 and it doesnt seem to have this slowdown







-- 
https://bugs.ruby-lang.org/
 ______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [ruby-core:114954] [Ruby master Bug#19911] require slower with ruby/3.2.2
  2023-10-05 17:36 [ruby-core:114950] [Ruby master Bug#19911] require slower with ruby/3.2.2 ashwinsurya14 (Ashwin Surya Kumar Sivasubramanian) via ruby-core
  2023-10-05 17:37 ` [ruby-core:114951] " ashwinsurya14 (Ashwin Surya Kumar Sivasubramanian) via ruby-core
  2023-10-05 21:14 ` [ruby-core:114952] " ashwinsurya14 (Ashwin Surya Kumar Sivasubramanian) via ruby-core
@ 2023-10-05 22:28 ` k0kubun (Takashi Kokubun) via ruby-core
  2 siblings, 0 replies; 4+ messages in thread
From: k0kubun (Takashi Kokubun) via ruby-core @ 2023-10-05 22:28 UTC (permalink / raw
  To: ruby-core; +Cc: k0kubun (Takashi Kokubun)

Issue #19911 has been updated by k0kubun (Takashi Kokubun).

Status changed from Open to Feedback

You're measuring a lot other things by using the `time` command to benchmark the script. It's more accurate to measure the time inside a script.

```
$ ruby -v -e 't = Time.new; require "json"; puts "%.3fs" % (Time.new - t)'
ruby 2.7.7p221 (2022-11-24 revision 168ec2b1e5) [x86_64-linux]
0.003s

$ ruby -v -e 't = Time.new; require "json"; puts "%.3fs" % (Time.new - t)'
ruby 3.2.2 (2023-03-30 revision e51014f9c0) [x86_64-linux]
0.003s
```

----------------------------------------
Bug #19911: require slower with ruby/3.2.2
https://bugs.ruby-lang.org/issues/19911#change-104826

* Author: ashwinsurya14 (Ashwin Surya Kumar Sivasubramanian)
* Status: Feedback
* Priority: Normal
* ruby -v: ruby 3.2.2 (2023-03-30 revision e51014f9c0) [x86_64-linux]
* Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN
----------------------------------------
we tested require with ruby 3.2.2 and ruby 2.7.2
and its seems to slowdown considerabily

the test case:
Ruby 3.2.2
command: time ruby -e 'require "json"'
time: user=0.19s system=0.02s cpu=99% total=0.204

Ruby 2.7.2
command: time ruby -e 'require "json"'
time: user=0.05s system=0.02s cpu=98% total=0.064

We also saw the same slowdown with File.read

Not sure that is casuing the slowdown in require also

On side note we saw three times more lstat on strace with the above command on ruby/3.2.2.Not sure if that is the root cause

I also tested with multiple versions of ruby 2* starting with ruby/2.3.1 and it doesnt seem to have this slowdown







-- 
https://bugs.ruby-lang.org/
 ______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-10-05 22:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-05 17:36 [ruby-core:114950] [Ruby master Bug#19911] require slower with ruby/3.2.2 ashwinsurya14 (Ashwin Surya Kumar Sivasubramanian) via ruby-core
2023-10-05 17:37 ` [ruby-core:114951] " ashwinsurya14 (Ashwin Surya Kumar Sivasubramanian) via ruby-core
2023-10-05 21:14 ` [ruby-core:114952] " ashwinsurya14 (Ashwin Surya Kumar Sivasubramanian) via ruby-core
2023-10-05 22:28 ` [ruby-core:114954] " k0kubun (Takashi Kokubun) via ruby-core

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).