News for hackers. Stuff that matters.
Re:Speed of Rust vs. C by ReactiveJelly on Saturday March 13, 2021 @09:30AM (#26446771)
> If you snapshot your entire heap into an mmapped file for fast I/O,

I've never heard of this trick. And my first reaction is "That would be a nightmare of memory unsafety if I did it in C++"

What's it used for? IPC?

Re:Speed of Rust vs. C by loeg on Saturday March 13, 2021 @11:13AM (#26447498)
I think emacs (used to?) do something awful like this. https://lwn.net/Articles/707615/
Re:Speed of Rust vs. C by howinteresting on Saturday March 13, 2021 @12:09PM (#26447941)
I'd call mmaping data structures into memory an advanced systems programming trick which can result in a nice performance boost but which also has some severe drawbacks (portability across big/little endian architectures and internal pointers being two examples).

I know some very skilled C++ and Rust developers who can pull it off. If you're at that skill level, Rust is not going to get in your way because you're just going to use unsafe and throw some sanitizers and fuzzers at it. I wouldn't trust myself to implement it.

Re:Speed of Rust vs. C by amelius on Saturday March 13, 2021 @09:44AM (#26446870)
You have to combine it with other techniques, e.g. journaling to make it safe, but this is not always necessary (e.g. when using large read-only data-structures)