4 ms·
I love to see someone prove D as a Better C by porting the "small" sqlite 124K line of C code to D and run some benchmark/test code against it. I used to work
by srcmap 9y ago
I love to see someone prove D as a Better C by porting the "small" sqlite 124K line of C code to D and run some benchmark/test code against it.
I used to work on OO database engine that handles billions of records.
I end up rewriting/overloading my own new/delete and redesign everything how data is load/store around it. Shorten the open/close document time from hours to seconds for large documents.
Basically, one can easily mmap billions of records directly into data structures accessible by C API easily in a few ms. One can dispose billions of records also in a few ms. I saw similar design patterns from the sqlite code base.
Language with memory safety (GC) design in mind won't allow anything like that as far as I know.
I love to see some D experts prove me wrong.
- zombinedev 9y agoD provides the same low-level access as C. Heck, in D you can even use inline assembly, so there are really no barriers to what you can achieve. MMaping files and casting their contents to structures is often used technique. The GC only one of the many ways of getting memory in D. You'll just have to manage the other ways yourself like in C or C++ ;)
- jmh530 9y agoCould you recommend some resources on these techniques?
- anonfunction 9y agohttps://stackoverflow.com/questions/45972/mmap-vs-reading-blocks https://stackoverflow.com/questions/45972/mmap-vs-reading-bl...