Hacker News new | ask | show | jobs
by pjmlp 1384 days ago
You can surely allocate a Vector<T> inline, no need for pointers, just make use of compile time polymorphism instead of runtime one.

On OOP languages with GC, you can reduce GC scanning by having precise GC, and if the languages support value types by making use of structs with method pointers.

With the help of PGO for AOT or the JIT, the compiler can optimize the layout of types for the target architecture.