Forum: Ruby-core [ruby-trunk - Bug #7968][Open] Poor UDPSocket#send performance in ruby 2.0.0 on windows

Posted by cs96and (Alan Davies) (Guest)
on 2013-02-26 12:56
(Received via mailing list)
Issue #7968 has been reported by cs96and (Alan Davies).

----------------------------------------
Bug #7968: Poor UDPSocket#send performance in ruby 2.0.0 on windows
https://bugs.ruby-lang.org/issues/7968

Author: cs96and (Alan Davies)
Status: Open
Priority: Normal
Assignee: cruby-windows
Category: platform/windows
Target version:
ruby -v: ruby 2.0.0p0 (2013-02-24) [x64-mingw32]


I have noticed that the performance of UDPSocket#send on ruby 2.0.0 on 
windows is much poorer than that of 1.9.3 or 1.8.7.  Running the 
attahced script on 2.0.0 gives the following...

d:\scripts>bash -c "ruby --version"
ruby 2.0.0p0 (2013-02-24) [x64-mingw32]

d:\scripts>bash -c "time ruby socketsendtest.rb"

real    0m2.572s
user    0m0.000s
sys     0m0.016s

However, running the same test with 1.9.3 is much faster...

d:\scripts>pik 193

d:\scripts>bash -c "ruby --version"
ruby 1.9.3p374 (2013-01-15) [i386-mingw32]

d:\scripts>bash -c "time ruby socketsendtest.rb"

real    0m0.993s
user    0m0.015s
sys     0m0.016s

Additionally, if I change the send call to a print (commented out in the 
script), then the performance is fine on 2.0.0....

d:\scripts>pik 200

d:\scripts>bash -c "ruby --version"
ruby 2.0.0p0 (2013-02-24) [x64-mingw32]

d:\scripts>bash -c "time ruby socketsendtest.rb"

real    0m0.907s
user    0m0.000s
sys     0m0.015s

What is send() doing that print() doesn't do that is causing the massive 
performance drop?

Thanks
Alan.
Posted by nagachika (Tomoyuki Chikanaga) (Guest)
on 2013-03-01 16:44
(Received via mailing list)
Issue #7968 has been updated by nagachika (Tomoyuki Chikanaga).

Status changed from Closed to Open
% Done changed from 100 to 0


----------------------------------------
Bug #7968: Poor UDPSocket#send performance in ruby 2.0.0 on windows
https://bugs.ruby-lang.org/issues/7968#change-37227

Author: cs96and (Alan Davies)
Status: Open
Priority: Normal
Assignee: cruby-windows
Category: platform/windows
Target version:
ruby -v: ruby 2.0.0p0 (2013-02-24) [x64-mingw32]


I have noticed that the performance of UDPSocket#send on ruby 2.0.0 on 
windows is much poorer than that of 1.9.3 or 1.8.7.  Running the 
attahced script on 2.0.0 gives the following...

d:\scripts>bash -c "ruby --version"
ruby 2.0.0p0 (2013-02-24) [x64-mingw32]

d:\scripts>bash -c "time ruby socketsendtest.rb"

real    0m2.572s
user    0m0.000s
sys     0m0.016s

However, running the same test with 1.9.3 is much faster...

d:\scripts>pik 193

d:\scripts>bash -c "ruby --version"
ruby 1.9.3p374 (2013-01-15) [i386-mingw32]

d:\scripts>bash -c "time ruby socketsendtest.rb"

real    0m0.993s
user    0m0.015s
sys     0m0.016s

Additionally, if I change the send call to a print (commented out in the 
script), then the performance is fine on 2.0.0....

d:\scripts>pik 200

d:\scripts>bash -c "ruby --version"
ruby 2.0.0p0 (2013-02-24) [x64-mingw32]

d:\scripts>bash -c "time ruby socketsendtest.rb"

real    0m0.907s
user    0m0.000s
sys     0m0.015s

What is send() doing that print() doesn't do that is causing the massive 
performance drop?

Thanks
Alan.
Posted by cs96and (Alan Davies) (Guest)
on 2013-03-05 18:03
(Received via mailing list)
Issue #7968 has been updated by cs96and (Alan Davies).


I see the %Done went up to 100 and back down to zero.  Is this fixed or 
not now?

Thanks
Alan.
----------------------------------------
Bug #7968: Poor UDPSocket#send performance in ruby 2.0.0 on windows
https://bugs.ruby-lang.org/issues/7968#change-37309

Author: cs96and (Alan Davies)
Status: Open
Priority: Normal
Assignee: cruby-windows
Category: platform/windows
Target version:
ruby -v: ruby 2.0.0p0 (2013-02-24) [x64-mingw32]


I have noticed that the performance of UDPSocket#send on ruby 2.0.0 on 
windows is much poorer than that of 1.9.3 or 1.8.7.  Running the 
attahced script on 2.0.0 gives the following...

d:\scripts>bash -c "ruby --version"
ruby 2.0.0p0 (2013-02-24) [x64-mingw32]

d:\scripts>bash -c "time ruby socketsendtest.rb"

real    0m2.572s
user    0m0.000s
sys     0m0.016s

However, running the same test with 1.9.3 is much faster...

d:\scripts>pik 193

d:\scripts>bash -c "ruby --version"
ruby 1.9.3p374 (2013-01-15) [i386-mingw32]

d:\scripts>bash -c "time ruby socketsendtest.rb"

real    0m0.993s
user    0m0.015s
sys     0m0.016s

Additionally, if I change the send call to a print (commented out in the 
script), then the performance is fine on 2.0.0....

d:\scripts>pik 200

d:\scripts>bash -c "ruby --version"
ruby 2.0.0p0 (2013-02-24) [x64-mingw32]

d:\scripts>bash -c "time ruby socketsendtest.rb"

real    0m0.907s
user    0m0.000s
sys     0m0.015s

What is send() doing that print() doesn't do that is causing the massive 
performance drop?

Thanks
Alan.
Posted by nagachika (Tomoyuki Chikanaga) (Guest)
on 2013-03-05 18:22
(Received via mailing list)
Issue #7968 has been updated by nagachika (Tomoyuki Chikanaga).


Hello, Alan.

I re-open this ticket because it was accidentally closed by wrong commit 
message.
This issue is not fixed yet.

BTW, in socketsendtest.rb UDPSocket#bind and #connect receive different 
port number. Is it right?
On my environment, I've got an exception.

  socketsendtest.rb:9:in `send': Connection refused - send(2) 
(Errno::ECONNREFUSED)

Thanks
----------------------------------------
Bug #7968: Poor UDPSocket#send performance in ruby 2.0.0 on windows
https://bugs.ruby-lang.org/issues/7968#change-37310

Author: cs96and (Alan Davies)
Status: Open
Priority: Normal
Assignee: cruby-windows
Category: platform/windows
Target version:
ruby -v: ruby 2.0.0p0 (2013-02-24) [x64-mingw32]


I have noticed that the performance of UDPSocket#send on ruby 2.0.0 on 
windows is much poorer than that of 1.9.3 or 1.8.7.  Running the 
attahced script on 2.0.0 gives the following...

d:\scripts>bash -c "ruby --version"
ruby 2.0.0p0 (2013-02-24) [x64-mingw32]

d:\scripts>bash -c "time ruby socketsendtest.rb"

real    0m2.572s
user    0m0.000s
sys     0m0.016s

However, running the same test with 1.9.3 is much faster...

d:\scripts>pik 193

d:\scripts>bash -c "ruby --version"
ruby 1.9.3p374 (2013-01-15) [i386-mingw32]

d:\scripts>bash -c "time ruby socketsendtest.rb"

real    0m0.993s
user    0m0.015s
sys     0m0.016s

Additionally, if I change the send call to a print (commented out in the 
script), then the performance is fine on 2.0.0....

d:\scripts>pik 200

d:\scripts>bash -c "ruby --version"
ruby 2.0.0p0 (2013-02-24) [x64-mingw32]

d:\scripts>bash -c "time ruby socketsendtest.rb"

real    0m0.907s
user    0m0.000s
sys     0m0.015s

What is send() doing that print() doesn't do that is causing the massive 
performance drop?

Thanks
Alan.
Posted by cs96and (Alan Davies) (Guest)
on 2013-03-09 19:42
(Received via mailing list)
Issue #7968 has been updated by cs96and (Alan Davies).


The bind and connect can be different.  The bind specifies what port you 
are sending from, and connect specifies the port you are sending to (the 
ip address can be a different box too).  It runs fine for me with 
different ports, but you can make them the same if you want.
----------------------------------------
Bug #7968: Poor UDPSocket#send performance in ruby 2.0.0 on windows
https://bugs.ruby-lang.org/issues/7968#change-37444

Author: cs96and (Alan Davies)
Status: Open
Priority: Normal
Assignee: cruby-windows
Category: platform/windows
Target version:
ruby -v: ruby 2.0.0p0 (2013-02-24) [x64-mingw32]


I have noticed that the performance of UDPSocket#send on ruby 2.0.0 on 
windows is much poorer than that of 1.9.3 or 1.8.7.  Running the 
attahced script on 2.0.0 gives the following...

d:\scripts>bash -c "ruby --version"
ruby 2.0.0p0 (2013-02-24) [x64-mingw32]

d:\scripts>bash -c "time ruby socketsendtest.rb"

real    0m2.572s
user    0m0.000s
sys     0m0.016s

However, running the same test with 1.9.3 is much faster...

d:\scripts>pik 193

d:\scripts>bash -c "ruby --version"
ruby 1.9.3p374 (2013-01-15) [i386-mingw32]

d:\scripts>bash -c "time ruby socketsendtest.rb"

real    0m0.993s
user    0m0.015s
sys     0m0.016s

Additionally, if I change the send call to a print (commented out in the 
script), then the performance is fine on 2.0.0....

d:\scripts>pik 200

d:\scripts>bash -c "ruby --version"
ruby 2.0.0p0 (2013-02-24) [x64-mingw32]

d:\scripts>bash -c "time ruby socketsendtest.rb"

real    0m0.907s
user    0m0.000s
sys     0m0.015s

What is send() doing that print() doesn't do that is causing the massive 
performance drop?

Thanks
Alan.
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.