From: Florent M. <fmo...@li...> - 2008-06-03 18:29:38
|
> with this change, I still get roughly 2 million ops (only slightly faster). > This would lead me to believe that time is not spent in doing ALU ops but > rather time is spent either in the garbage collector or data cache misses. Have you tryed my (write_double_opt) version in your benchs to compare? How much was the difference? and if time is spent more in allocs and GC, this explains too why (write_double_opt) is 3 times faster: it doesn't alloc anything. > Isn't there a way to perform the same double_cast using some GC/Ocaml > object structure magic like the Obj module? I haven't found any ocaml function equivalent to the C function memcpy() even in the Obj module. > How fast does a write_double have to be? Yes I admit happily that this is a geekish issue :) but we are geeks and love trying to optimise code ;-) Well more seriously if I had found a speedup of only 5% or 10% I wouldn't have bother you. If I decided to write it's because an enhancement of close to 3 times faster was not that bad. But with a (String.create) to make it thread safe, the enhancement is only about 2.5 times faster. -- With Regards Florent |