Archive: Buggy CRCCheck?


Buggy CRCCheck?
Hi,

I'm using NSIS 2 Modern UI, and in my installer the CRC Check is configured on. I believe this leads to the initial status dialog "Verifying installer", right? Anyway, I believe the implementation of this CRC check may be flawed, not from a functionality perspective but a performance perspective. If running the installer from a CD, the process may take up to a minute for a 10MB installer, whereas it's instantaneous from the hard disk. This is a showstopper for shrinkwrapped software. I believe the implementation bug probably lies in that file I/O (reading from the file) is done in pathetic little chunks (e.g. 100 bytes each) instead of loading the file in generous chunks of dozens of K in each gulp. This is a typical developer mistake - reading a file byte-by-byte in numerous i/o calls takes many orders of magnitude longer than reading it at once or in a few calls. Please review the implementation of the CRC check and let me know if my suspicions are correct. As it stands now, I unfortunately have to cancel it in my installer because it takes too long when installing from CD.

Regards,
GJ


It reads chunks of 512 bytes so it can easily find the header. I'll see what can be done.


Thanks. Unfortunately, my suspicions were correct. Reading in 512-byte chunks is very bad. It means NSIS is doing about 20000 separate i/o calls to verify my 10MB installer.
I've no doubt that you'll set about fixing it, but my question is whether I can obtain or apply a fix without getting all the new NSIS files - this will completely break my currently stable installer. How can I go about applying just this isolated fix if/when it becomes available?

Shalom,
GJ


That code has already been changed a lot. It'll probably be possible to implement in b3 too though. I will know better when it's ready.


Fixed in latest CVS version.