The structure for these functions is fairly similar: for an object, get its type and find its references (scan_julia_object) and its size (get_so_object_size).
The question is: there is common code here that could be lifted but also, from a performance perspective, it might just be worth memoizing the object size during object scanning, so we don't need to introspect its type again during the same GC cycle and simply return its size (from a Hashmap for instance.
The structure for these functions is fairly similar: for an object, get its type and find its references (
scan_julia_object) and its size (get_so_object_size).The question is: there is common code here that could be lifted but also, from a performance perspective, it might just be worth memoizing the object size during object scanning, so we don't need to introspect its type again during the same GC cycle and simply return its size (from a
Hashmapfor instance.