You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After adjusting the GReactor gem to comply with JRuby (mainly avoiding the freeze string issue), I discovered that the JRuby implementation for the same code is SUPER slow.
The difference was between 36,895 Req/sec and 6554 Req/sec...
MRI was 600% faster?! This must be an issue either with the GReactor gem or with the JRuby implementation....
I wrote the most simple server emulation I could think of (attached), leveraging on JRuby's specialty - many threads. The results matched the expected results.
JRuby: 72,045 req/sec
MRI: 28,267 req/sec
I wrote a quick and dirty reactor loop to test if the issue was related to anything in the core ruby implementation that I was using.
MRI gave me 30K Req/sec...
JRuby gave me a plenty of errors I couldn't decipher forced my hand into using blocking calls (socket.gets instead of socket.recv_nonblock) and finally gave me ~23K Req/sec...
What am I missing?
I thought JRuby was supposed to comply with MRI 2.2 behavior?
After adjusting the GReactor gem to comply with JRuby (mainly avoiding the freeze string issue), I discovered that the JRuby implementation for the same code is SUPER slow.
The difference was between 36,895 Req/sec and 6554 Req/sec...
MRI was 600% faster?! This must be an issue either with the GReactor gem or with the JRuby implementation....
I wrote the most simple server emulation I could think of (attached), leveraging on JRuby's specialty - many threads. The results matched the expected results.
JRuby: 72,045 req/sec
MRI: 28,267 req/sec
I wrote a quick and dirty reactor loop to test if the issue was related to anything in the core ruby implementation that I was using.
MRI gave me 30K Req/sec...
JRuby gave me a plenty of errors I couldn't decipher forced my hand into using blocking calls (
socket.gets
instead ofsocket.recv_nonblock
) and finally gave me ~23K Req/sec...What am I missing?
I thought JRuby was supposed to comply with MRI 2.2 behavior?
Code for GReactor testing
Code for a thread-per-request HTTP emulation
Code for the worst reactor ever
Please notice that this code uses blocking calls, although that was done after JRuby failed to run while using
recv_nonblock
:The text was updated successfully, but these errors were encountered: