Alexander Valyalkin wrote:
1) Automatic initialization of crc32tab[] at first call. So, the file crc32.h with definition of this tab is not nessesary any more now.
First of all, crc32tab is no longer in the .text segment, so it will not be shared between forked processes, taking more memory space than necessary. Each process will have to initialise it as well, so the init loop will run more than once.
Secondly, compiler optimisation is always more effective working on data known to be constant. So removing 'const' from cr32tab is likely to produce slower code.
Also, you used long int instead of int, which means your code will break on 64-bit platforms.
2) Speed is improved on large amount of data.
I seriously doubt that, as the tight main loop of the function didn't change that much. Using 'register' won't help you here (Windows cl.exe officialy ignores it altogether, GCC is smart enough to figure it out for itself)
3) Less source size. Current verison has near 6.5Kb length (including crc32.h). My version has only 2.5Kb length.
Yeah, you managed that. Well done.
-- Ard
-- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php