4 ms·
It's definitely technically doable: you'd have to checksum every read-only page of a program and see if you already have one in cache. But is it worth it thoug
by simias 5y ago
It's definitely technically doable: you'd have to checksum every read-only page of a program and see if you already have one in cache.
But is it worth it though? Even "big" statically linked Rust programs are a few dozen MBs of executable (and not all of that is read-only, and even less will be shared with any other executable at any given time). With things like LTO identical source files can result in different machine code as well.
In the end it would be a lot of trouble for potentially very little gains.
At first I was annoyed that Rust defaulted to dynamic linking, it felt inefficient and overkill. But the more I think about it the less I can really justify doing it any other way, there are very few benefits to dynamic linking these days. The only one I can think of is overriding an application's behaviour through LD_PRELOAD, but few people know how to do that these days.
- amelius 5y ago> there are very few benefits to dynamic linking these days I think you might underestimate it. E.g. what if every program uses Electron under the hood?