News for hackers. Stuff that matters.
Re:Allocgate: Restructuring how allocators work in Zig by ayende on Wednesday December 15, 2021 @05:11PM (#29572229)
You aren't modifying the same object When you have a fat pointer, llvm can tell you are modifying the ptr, bot the vtable

You can then cache the function call

When your vtable is in the object you are mutating, it needs to read each time

Re:Allocgate: Restructuring how allocators work in Zig by celeritascelery on Wednesday December 15, 2021 @05:20PM (#29572333)
Does LLVM do the inline caching itself? Or does it just enable zig to do this optimization?
Re:Allocgate: Restructuring how allocators work in Zig by ayende on Wednesday December 15, 2021 @05:26PM (#29572394)
What happens is likely that the code gen can do the virtual lookup once, instead on each loop iteration

This is llvm, bit zig