Ruby 3.1 introduces Variable Width Allocation for Strings | Saeloun Blog

This post is in continuation of part 1 and in this blog, we will take a deeper look at how Variable Width Allocation works and how it can improve Ruby’s memory performance. Before getting into the VWA let us understand how large objects get allocated on Heap.Large objects on the HeapAs we know the size of the slot is 40 bytes, in which only 24 bytes are used for storing content. The rest of the 16 bytes are used for storing the flag and the pointer to other RVALUE. Now let us look at the example in which we need to allocate a string of 12 bytes and 37 bytes-.
Ruby 3.1 introduces Variable Width Allocation for Strings | Saeloun Blog #ruby #rubydeveloper #rubyonrails #blog https://rubyonrails.ba/single/ruby-3-1-introduces-variable-width-allocation-for-strings-saeloun-blog

Nezir Zahirovic

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

related articles