Hi,

I've been running a simple test on various OSes, which creates a 64MB file on a memory-backed filesystem, writing it in 4K chunks, and then measures the time for a full read and rewrite (without truncating). My intention was to get some metrics for the latency of minimal read() and write() operations.

Running this test in HelenOS (this is my first contact, after years wanting to play with it), I've noticed that the results are pretty decent (almost the same numbers as Google's Magenta). But laying out the test file takes _a lot_ of time, in the order of several minutes.

Taking a look at tmpfs's code, I tracked down the problem to realloc(). When growing a buffer in relatively large chunks (4K), it always resorts to malloc()+memcpy(), making the operation unbearable slow.

I did a quick change, so if the next block in the area is small or not free, it tries to grow the area itself. This seems to do the trick, and the time for laying out the file decreases drastically. I can share the change, it's just 3-4 LoCs, but probably someone with better knowledge of malloc.c should do a proper implementation.

Sergio.

_______________________________________________
HelenOS-devel mailing list
[email protected]
http://lists.modry.cz/listinfo/helenos-devel

Reply via email to