[MLton] Re: [MLton-user] FFI and pointer relocation

Florian Weimer fw at deneb.enyo.de
Wed Nov 28 06:17:00 PST 2007


* Wesley W. Terpstra:

> In a well written network application, an strace looks like: select()
> gettimeofday() maybe read() maybe write() gettimeofday() repeat. I was
> pleasantly surprised to see that Time.now () can be called about 1M/s.
> However, due to the IntInf arithmetic, it's actually 4* slower than
> Int64 gettimeofday() on powerpc/osx and 1.5* on x86/linux.

Nowadays, clock_gettime with CLOCK_MONOTONIC is a better choice because
this should not be affected by the sysadmin resetting the clock.

> It also wastes about 140 bytes of heap. It's interesting the osx
> system calls are so much faster.

gettimeofday is probably not implemented as a system call on OS X.



More information about the MLton mailing list