3 ms·
My solution to level0 accounted for about 10% of the total process runtime (measured against an empty `int main() {}`. The rest was process/libc setup time. I
by lunixbochs 13y ago
My solution to level0 accounted for about 10% of the total process runtime (measured against an empty `int main() {}`. The rest was process/libc setup time.
I realized after the competition you can compile with -nostdlib or -nostartfiles and halve the process overhead, which would almost double any of the top 10 scores at that point.
- gibybo 13y agoThis was already the bottleneck for all of the top solutions. Reducing the start up time was the primary goal and the top solutions were heavily optimizing for it, including compiler configurations. One of the primary reason to compile in a bloom filter instead of a hash set was that it made your binary ~2 MB smaller which was a significant advantage in start up time.
- lunixbochs 13y agoI was #6 using a bloom filter. I don't think anybody properly used both a libc startup optimization and a bloom filter because the numbers I saw were significantly better than those required to score in the top few.
- voltagex_ 13y agoOn this tangent, where do I go to learn how to write C with nostdlib? I've tried this on both MSVC++ and gcc and it's really painful.
- recentdarkness 13y agoWell you just use system calls and import functions from other shared libs dynamically. There is really not more to it. The stdlibs are supposed to make your life more comfortable, of course its not that comfy without them.
- lunixbochs 13y agoThere was a suggestion to statically link against dietlibc. Not sure how the startup cost is compared to glibc. My -nostdlib version just uses inline assembly for the read(), write(), and exit() system calls.