This post originated from an RSS feed registered with Ruby Buzz
by Alexander Dymo.
Original Post: Is Ruby 2.3 Faster? No Significant Improvement In Rails Applications
Feed Title: Ruby and Rails Performance Optimization
Feed URL: http://ruby-performance-book.com/blog/feed/
Feed Description: This is the blog about Ruby and Rails performance optimization techniques, tips, and tricks. Learn how the newest Ruby releases perform in the field, see how to reduce memory and CPU usage, discover the world of profiling, measuring, and performance testing.
Ruby 2.3 was released in December 2015 with yet another bunch of performance improvements. But is it really faster than 2.2? Let's take a look.
This is the sixth and, most likely, last post in my series about Ruby 2.3 performance. We'll see whether upgrading the real world Rails apps from Ruby 2.2 to 2.3 improves performance. Spoiler alert: it does not.
I was concerned that Ruby is actually getting faster. Looks like there is no reason to worry.
Rails/Ruby expert who switched to Phoenix/Elixir
I still remember how big of an improvement Ruby 2.1 was. Startup time was reduced tenfold. Performance tests reported a minimum of 15% speedup. New Relic request time and memory usage metrics went sharply down.
So I was eager to upgrade my production Rails apps to Ruby 2.3 and measure the performance.
Here's what I got. In the table below you'll see some of the performance benchmarks for Acunote, the online project management system:
Benchmark
Ruby 2.2.3
Ruby 2.3.0
Benchmark Burndown 120
0.82 ± 0.00
0.86 ± 0.00
Benchmark Sprint 20 x (1+5) (C)
0.24 ± 0.00
0.24 ± 0.00
Benchmark Analyze 20 x (1+5)
1.78 ± 0.02
1.80 ± 0.03
Benchmark Task Details Page
0.39 ± 0.01
0.38 ± 0.00
Benchmark Signup
0.30 ± 0.00
0.29 ± 0.00
Benchmark Copy 120
1.48 ± 0.02
1.42 ± 0.02
Benchmark Import 71
2.08 ± 0.00
1.99 ± 0.03
Benchmark Set Field (EP)
0.18 ± 0.00
0.17 ± 0.01
The table is incomplete. I have about 60 benchmarks for Acunote, but only the two highlighted ones demonstrated an improvement in the statistically significant way.
The Copy 120 benchmark is heavy on rendering, and Import 71 is heavy on garbage collector. Both got 4% faster.
For another application I didn't have the performance tests, but I had New Relic:
Time spent in Ruby before and after upgrade
Do you see improvement? I don't. Neither for this one, nor for my other applications.
Verdict: Not Significantly Faster
It turns out Ruby 2.3 is not significantly faster than 2.2. Best improvement I got was a meager 4% speedup in rendering-heavy and memory-heavy benchmarks.
Note, I upgraded only 5 Rails applications. That is all I have at the moment. If you upgraded to Ruby 2.3 and got a significant increase in performance, please let me know. I'm eager to hear about it!
Read More On Ruby 2.3 Performance
I investigated the effect of various specific improvements in Ruby 2.3 on performance before writing this post. Take a look, you might find something relevant to you.
Want to learn more about the Ruby performance optimization? Curious about performance profiling, benchmarking, and testing? Click the link below to get my Ruby Performance Optimization book.
Did you like this post? Follow me on
Twitter
or
Google+
to stay updated on Ruby performance optimization news.