Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@timo
Copy link
Contributor

@timo timo commented Nov 9, 2025

Instead of having an object array with many three-element obj-arrays in it, have two int-arrays and a str-array.

This removes one indirection from line number lookup when searching through the array of comp line directives. Also, this should use less memory at compile time.

This rarely matters very much, except for the generated RakuAST source file that is concatenated into the BOOTSTRAP/v6c.nqp file, which has multiple thousand comp_line_directives and compiling the v6c bootstrap used to spend almost 10% of its time inside method linefileof.

A side-effect of this change is that we now store only a string instead of the whole match object for the filename inside the comp line directives array, which I expect only has a very minor impact on anything.

(SoA means Struct of Array and AoS means Array of Struct. Technically, this was an AoA and turned into a different kind of AoA, but the smaller arrays were always constant-length and each slot had a specified meaning, just like members of a struct, so I think it makes sense to call it that)

Instead of having an object array with many three-element obj-arrays in it,
have two int-arrays and a str-array.

This removes one indirection from line number lookup when searching through
the array of comp line directives. Also, this should use less memory at
compile time.

This rarely matters very much, except for the generated RakuAST source file
that is concatenated into the BOOTSTRAP/v6c.nqp file, which has multiple
thousand comp_line_directives and compiling the v6c bootstrap used to spend
almost 10% of its time inside method linefileof.

A side-effect of this change is that we now store only a string instead of
the whole match object for the filename inside the comp line directives
array, which I expect only has a very minor impact on anything.

(SoA means Struct of Array and AoS means Array of Struct. Technically,
this was an AoA and turned into a different kind of AoA, but the smaller
arrays were always constant-length and each slot had a specified meaning,
just like members of a struct, so I think it makes sense to call it that)
@timo timo marked this pull request as draft November 9, 2025 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant