A Rubyist's Walk Along the C-side (Part 7): TypedData Objects - Peter Zhu

In the previous article, you saw how to define and use Ruby classes and modules through the C API. However, you might have noticed that for pretty much every operation, we needed to call into Ruby (e.g. reading and writing instance variables, calling methods, etc.). This, in many ways, defeats the purpose of writing a C extension since one of the goals of writing C extensions is to improve performance by relying on Ruby less. Spoiler alert: in a future article, we’ll use benchmarks to show that writing C extensions this way might actually be SLOWER than writing it in Ruby.
A Rubyist's Walk Along the C-side (Part 7): TypedData Objects - Peter Zhu #ruby #rubydeveloper #rubyonrails #typeddata https://rubyonrails.ba/single/a-rubyist-s-walk-along-the-c-side-part-7-typeddata-objects-peter-zhu

Nezir Zahirovic

Contractor Ruby On Rails (8+ years) / MCPD .Net / C# / Asp.Net / CSS / SQL / (11 years)

related articles