Click any tag below to further narrow down your results
Links
This article explains the concept of frozen string literals in Ruby, highlighting their difference from mutable strings. It discusses the history, benefits, and implications of using frozen strings, particularly in terms of performance and memory management.
This article discusses how Ruby applications often consume a lot of CPU time, primarily due to library choices. It highlights key libraries impacting performance, the benefits of upgrading to Ruby 3, and the expected improvements with Ruby 4.0.
This article explains how to use the Benchmark module in Ruby to measure and report execution time for code snippets. It includes examples of different benchmarking methods and how to interpret the results. Instructions for installation and contribution to the module are also provided.
The article discusses the challenges of using regular expressions for data extraction in Ruby, particularly highlighting the performance issues with the default Onigmo engine. It compares alternative regex engines like re2, rust/regex, and pcre2, presenting benchmark results that demonstrate the superior speed of rust/regex, especially in handling various text cases and complexities.
The author shares improvements made to the P2 HTML templating library for Ruby, enhancing its template generation performance significantly. By utilizing a new compilation technique and implementing several optimizations, P2 now outperforms traditional Ruby templating methods like ERB. The article details the technical processes behind these enhancements and the resulting performance benchmarks.
OSV is a high-performance CSV parser for Ruby, built using Rust, and offers both hash-based and array-based row formats. It provides significant speed advantages over the standard Ruby CSV library and other CSV gems, especially when using the array-based mode. Users can easily integrate OSV into their applications by adding it to their Gemfile or installing it directly via gem install.
Open source, particularly in the Ruby ecosystem, faces fragility due to underfunding and reliance on a few major contributors like Shopify, which has significant influence over Ruby and Rails. Despite these challenges, open source remains resilient as it adapts to new demands, and companies should invest in maintaining and improving the frameworks they depend on to enhance performance and stability.
Ruby's JIT compiler, specifically ZJIT, enhances performance by compiling frequently used methods into native code while retaining their bytecode for safety and de-optimization. The article explains the mechanics of how Ruby executes JIT-compiled code, the criteria for compilation, and the reasons for falling back to the interpreter when assumptions are violated. Additionally, it addresses common questions regarding JIT functionality and performance implications.