2 ms·
And how is your custom format going to avoid copying? If you use the standard open()/[read()|write()]/close() then every read() or write() is a copy operation.
by pwg 5y ago
And how is your custom format going to avoid copying?
If you use the standard open()/[read()|write()]/close() then every read() or write() is a copy operation. Either copying from memory out to storage, or copying from storage into memory.
If you instead mmap() the data then the copying is just hidden behind the VM page swapping routines in the kernel. But ultimately there will be a copy from storage into memory or a copy from memory into storage.
And, have you bench-marked using Sqlite (in the simple form presented in the web page linked to above) to know whether the copying is an issue? If you have not bench-marked it, then you are just going on assumptions, and assumptions often have a very high probability of being wrong.