4 ms·
We solved this with flat vectors and just sharing index values in cheap walker objects. It is much nicer to work with compared to arc/weak pointers. Code here:
by pimeys 4y ago
We solved this with flat vectors and just sharing index values in cheap walker objects. It is much nicer to work with compared to arc/weak pointers.
Code here: https://github.com/prisma/prisma-engines/tree/main/libs%2Fdatamodel%2Fparser-database https://github.com/prisma/prisma-engines/tree/main/libs%2Fda...
- int_19h 4y agoHow is this fundamentally different from raw pointers?
- dralley 4y agoNot OP It serializes better, it's memory safe, it can be much faster in performance terms, you can get better memory usage if you're holding a lot of "pointers" because the indexes don't need to be 64 bits.
- int_19h 4y agoBut you lose all ownership tracking / safety that Rust is famous for. I just can't help but wonder what it means for that paradigm, when the most popular answer to "how do I model my entities in safe Rust" is basically "backdoor the safety".