theldus / 1brc Goto Github PK
View Code? Open in Web Editor NEWMy (many) attempts to solve the 1brc (One Billion Row Challenge) in C
License: The Unlicense
My (many) attempts to solve the 1brc (One Billion Row Challenge) in C
License: The Unlicense
Hi @Theldus!
First of all let me thank you for the very much enjoyable read that you gave me with this repo.
You did an excellent write-up and it was very nice to see all the changes discussed and their improvements!
Speaking of that, I have an idea on what is causing the speed up on v10, with the removal of the MAP_POPULATE flag.
Taken from man page of mmap
:
MAP_POPULATE (since Linux 2.5.46)
Populate (prefault) page tables for a mapping. For a file
mapping, this causes read-ahead on the file. This will
help to reduce blocking on page faults later.
Since you are mapping a file, the MAP_POPULATE flag caused a prefault for the entire memory block. It is true that the memory will eventually be completely faulted (since the file will be read wholly), however the actual read is performed in threads, while the MAP_POPULATE flag happens in the main thread only.
So apparently, the concurrency of the page fault happening in the threads is causing the speedup.
What do you think about that?
Thanks again, wish you a wonderful day!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.