[squid-dev] Do not load icons one character at a time

Amos Jeffries squid3 at treenet.co.nz
Sat May 21 09:09:50 UTC 2016


On 21/05/2016 6:25 a.m., Alex Rousskov wrote:
> Hello,
> 
>> revno: 14682
>> committer: Alex Rousskov <rousskov at measurement-factory.com>
>> branch nick: trunk
>> timestamp: Fri 2016-05-20 12:16:19 -0600
>> message:
>>   Fixed icons loading speed.
>>   
>>   Since trunk r14100 (Bug 3875: bad mimeLoadIconFile error handling), each
>>   icon was read from disk and written to Store one character at a time. I
>>   did not measure startup delays in production, but in debugging runs,
>>   fixing this bug sped up icons loading from 1 minute to 4 seconds.
> 
> 
> FYI: Squid v3.5 suffers from the same bug but will need a different fix
> because trunk uses C++11 std::array.
> 

Do you know where it is coming from exactly?
 sizeof(*buf) on dynamic arrays should be the array length. Not the char
size.
 sizeof(buf) is the 32-bit/64-bit size of pointers in the build. So we
can't use that.

We could hard-code the 4KB size here for 3.5. But I'd rather learn what
was wrong.

Amos



More information about the squid-dev mailing list