You have disabled auto-rotation for stories. Re-enable?
If you're looking for a top Ruby job or for top Ruby talent, then you should check out Top Ruby Jobs. Top Ruby Jobs is a website dedicated to the best jobs available in the Ruby community.
Rubinius, the Ruby made in Ruby reached version 2.3.0 last Friday. In this release Rubinius catches up to MRI 2.1 with keyword arguments and other syntax changes that came with Ruby 2.1. There’s a long changelog with additions and improvements that match the 2.1 MRI releases but a good chunk of the release notes focus on what’s described as “always-on metrics” which can apparently be emitted to StatsD. So if you like profiling things in Ruby, this version might be interesting to you. In a similar vein, the release notes focus on Rubinius::Logger which apparently enables more fine-uned application logging.
Alexey Vasiliev dropped us a line over the weekend to let us know about Zopfliffi, a Ruby wrapper for the zopfli library. Zopfli is the Zlib compatible compression algorithm released by Google last year. It can compress things about 10% smaller than normal gzip, but it’s 150 times slower to actually compress things. 150 times is a big number, for just a 10% size improvement, but if you have files getting downloaded millions of times across the internet, 10% could quickly add up to thousands of dollars in bandwidth cost. And only the compression time is 150 times slower, the decompression time is the same as a normal gzip’d file. Alexey wrote a small little Ruby gem that uses the Foreign Function Interface, or FFI, to easily call out to the Zopfli C library.
Benchmarking. Isn’t it fun? Richard Schneeman wrote a great blog post about Benchmarking Rack Middleware and more specifically the rack middleware that determines whether to serve static assets in production for a Rails application. How do you test one Rack middleware out of all the rack middlewares that Rails uses? Well, you isolate it. Richard used Rack::MockRequest to test this middleware. Then, using the handy benchmark-ips gem which can compare two pieces of code and see which one can execute more iterations per second than the other one, he compared a request that does nothing but respond with a 200 status code and a simple text body with a request that goes through ActionDispatch::Static middleware. The simple dummy request was 80% faster than ActionDispatch::Static. That gave Richard a baseline upon which to test speed improvements to ActionDispatch::Static. In the end, he ended up with a 54% speed improvement on that single middleware in isolation. That’s only roughly 2.6% faster when you put that into the context of a full Rails app, but it’s still better. And now you can learn how to do that too!
In Rails 4.1 we got the ability to define enums in our ActiveRecord models. It’s nice to have a default way to set simple boolean flags in our models. They’re also way more efficient than strings in databases thanks to Binary Tree indexing! Justin Gordon goes in depth on Enums in Rails, and how you need to be careful using them in certain circumstances. Mainly if you need to write queries on the enum values, some code syntax that you think might work, does not. Maybe check out Justin’s blog post if you find yourself using enums in your app, so you know the syntax to avoid.
Collecting garbage is nasty stuff. It’s not really exciting, and most importantly it’s one of the most arcane things in the Ruby language. The good Tim Robertson over at Omniref took it upon himself to annotate the actual Ruby C code that implements the Garbage Collector in order to explain what garbage collection is and how it works. As Tim points out, there’s a ton of fragmented or out-of-date information about this subject, so it’s great to finally find a coherent explanation.
Peter Waguhnet at Skylight went hunting for nasty memory leaks. Often it’s because something keeps allocating memory for a ton of objects — like variables, arrays, etc. — that don’t really need to stick around. Yet, for some reason Ruby is failing to clean those objects out of memory to give that memory space back to other things. You can use some of the tools the Ruby Garbage Collector offers you. Things like the ObjectSpace object. Since Ruby 2.1 this object allows you to make a Heap Dump. What Peter recommends is taking a few dumps and then comparing them.
Ruby5 is released Tuesday and Friday mornings. To stay informed about and active with this podcast, we encourage you to do one of the following:
This episode was co-produced and edited by audio guru Jamison Rabbe.
Speech recognition with pocketsphinx-ruby, a recent update on the chatbot framework Lita, building and distributing OS X applications with ognivo, using Neo4j in rails, and rails rumble is over!
Enforcing your environment with ENVied, easier payment integration with Payola, faster logic with pippi, multithreading in MRI, and Practicing Rails.
Aimee and Nate talk about UltraHook, Using Capybara in Integration Tests, Background Processing with Einhorn, Barcelona Ruby Conf Top 5, and Raptor.
Unary Operators, Writing fast Ruby, each_with_object, ES6 Transpiler and HStore
Looking to learn about Ruby? Take a look at the Ruby Path on Code School
This podcast is produced and distributed by Code School. Copyright © 2018 Code School LLC