When `fname` and `realpath` are indentical it doesn't matter, but when they differ we pack them in a single reference by building an array. Until now, we built that array for every individual ISeq instead of only once at the start of co...byroot (Jean Boussier)
I've made a number of improvements in the ISeq struct format that should very significantly reduce their size in 4.1. Some were inspired by these PR, some conflicting. I still have a few more ideas to explore, but most of it has made ...byroot (Jean Boussier)
I opened a documentation PR at https://github.com/ruby/ruby/pull/20443, feedback welcome, I don't pretend to be good at writing documentation. A subsidiary question is: instead of introducing another method, would it make sense to cha...byroot (Jean Boussier)
`rb_snprinf` end up creating strings from a larger size pool than necessary, which isn't ideal for iseq labels as they stay around for the entirety of the process lifefime. Using handrolled concatenation and interning, we can save a lit...byroot (Jean Boussier)
A corpus analysis of ~1M iseqs show that out of all iseq with an `outer_variables` table, 63% of them have a single entry, and 97% have 4 or less entries. Since an `id_table` of capacity 8 is ~256B, that's ~160B wasted every time. On t...byroot (Jean Boussier)
It's a list of "object offsets" in the object tables, for most iseqs that's a relatively small integer that generally only take one of two bytes. Instead they were dumped as full size words. This reduce the size of `to_binary` by 5% in...byroot (Jean Boussier)
The object list was an aligned array of 32-bit offsets, 4 bytes per object. Objects are dumped in list order, so the offsets only grow and each delta is roughly one object's size, which fits in a one or two byte varint. However this req...byroot (Jean Boussier)
The previous commit ensured that the high 32 bits of each opcode is free. With that space, we can use 16 bits for storing the `iseq_events` and 16 more bits to store the `lineno`. Since an instruction `lineno` can be as large as 32 bits...byroot (Jean Boussier)