[PATCH] ipsum_calc_block: Optimize size and speed

Martin Mares mj at ucw.cz
Fri Apr 23 23:02:29 CEST 2010


Hello!

> How did you come to the conclusion the the current code was better than
> the previous version? Seems like "hand waving" to me.

Did I claim anywhere that the old code is better?  I only pointed out
the lack of arguments about the new code being better, which is a reason
to stay with the old, tested code.

> I told told you I had benched the "add carry in C" before and it wasn't
> any better(worse actually).

Actually, back in the ages when I wrote the old checksum function, I have
checked that it performs better than a trivial implementation, and now you
claim otherwise, so I naturally want to see new data which show that modern
hardware behaves differently.

> Santiago benched it too and it was better
> or just as good as before. Only the MIPS had a regression.

If I recall his results correctly, he has performed three tests:

In the 1st one, your code was 20% faster.
In the 2nd one, it was of the same speed.
In the 3rd one, it was 20% slower.

Maybe I wear different glasses from yours, but I clearly see that on average,
there is no improvement.

> So what now? what more proof do you need?

First of all, I want at least a rudimentary proof that IT MATTERS AT ALL.
We are spending lots of time talking about a minor (20%) speedup in a small
chunk of code, without having any clue about how often it gets called and what
fraction of the total time is really spent there.

Unless it shows up on the profile, I really think it is a waste of time
to optimize that place at all.

> Actually, I give up now. There is nothing more to add and if
> every change I propose needs this level of "proof", I can't image
> how it hard it must be to propose something more advanced.

Well, the choice is yours.

				Have a nice fortnight
-- 
Martin `MJ' Mares                          <mj at ucw.cz>   http://mj.ucw.cz/
Faculty of Math and Physics, Charles University, Prague, Czech Rep., Earth
To understand a program you must become both the machine and the program.



More information about the Bird-users mailing list