2 ms·
That's ridiculous. The overhead of fork is about a bajillion times higher than malloc.
by tedunangst 15y ago
That's ridiculous. The overhead of fork is about a bajillion times higher than malloc.
- aidenn0 15y agoAre you sure? I'd bet it's greater, I'd not bet that it's an order of magnitude better, fork() has been optimized a lot more than brk().
- adestefan 15y agoWith a COW fork() I bet it's smaller. I smell a test coming on, but alas it's late here and I'm going to bed. I'm also guessing that 4k was chosen because a malloc() of 1 page is faster than a malloc() of >1 page. Of course that's with the assumption that the systems use a 4k page size.