From: Nicolas C. <war...@fr...> - 2003-06-25 02:57:51
|
> > I do some benchmarks. While the test repeating "buf.add_uchar 'a' > > buf" and "buf.clear buf" shows 25% speed up, the more realistic test > > that repeatedly puts 1K uchars into a buffer shows only 3% speed up. > > Not a big deal, really. > > Yes it is. It is a big deal. Let me ask you something: > > would you give up 3% interest on an investment? > would you give 3% of a year extra to your employer > instead of holidays? That's about 11 days of holidays, > which is two whole weeks .. around here that's the whole > of your Xmas holdiday .. and over half your total holidays. The thing here is that if we're sure to get a 3% improvement, then it's perhaps worth it ( if the code doesn't get bigger - since for some people space is more an issue than time - and if the source doesn't get ugly so it can still be maintained , modified , etc. ). But since hardware are different, memory issues and not-so-good process timing, you can be pretty sure that this 3% is not relevent, and then a +3% on Yamagata-san computer can be a -10% on my windows box for example :-) Always be careful with micro benchmarks, watch the generated assembly code (using ocamlopt -S) to be sure that this actually an optimisation ! Nicolas Cannasse |