3 ms·
Use mmap and you won't need to write anything to disk; the operating system will do it for you. That's C's killer feature while also being the last thing on ear
by jart 5y ago
Use mmap and you won't need to write anything to disk; the operating system will do it for you. That's C's killer feature while also being the last thing on earth languages like Node and Java would ever permit developers to do.
- winrid 5y agoGood idea, will keep that in mind for next time.
- shakow 5y ago> while also being the last thing on earth languages like Node and Java would ever permit developers to do. You sure about that? https://www.npmjs.com/package/mmap-io https://www.npmjs.com/package/mmap-io https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/nio/MappedByteBuffer.html https://docs.oracle.com/en/java/javase/11/docs/api/java.base... mmap is a system call, not some C-exclusive fancy feature. If your language can print something on the screen, there is no reason it can't mmap a file. And if the serialization was the bottleneck, mmap would not have changed anything anyway.