Opened 14 years ago

Closed 14 years ago

#178 closed defect (fixed)

Poor QNetworkDiskCache performance

Reported by: rudi Owned by:
Priority: major Milestone: Qt 4.6.3
Component: QtNetwork Version: 4.6.2
Severity: low Keywords:
Cc:

Description

Not sure if we should do this kind of things, because it's a multiplatform issue. Even though it probably hurts most on OS/2 (see also #176). Find attached a patch to improve the performance of QNetworkDiskCache::expire(). It avoids to stat() cache files before they get deleted.

It sees to futher improve Arora browser's behavior.

Attachments (1)

diskcache_speedup.zip (1.1 KB ) - added by rudi 14 years ago.
Patch for src/network/access/qnetworkdiskcache.cpp

Download all attachments as: .zip

Change History (8)

by rudi, 14 years ago

Attachment: diskcache_speedup.zip added

Patch for src/network/access/qnetworkdiskcache.cpp

comment:1 by Dmitry A. Kuminov, 14 years ago

Milestone: Qt EnhancedQt 4.6.3

comment:2 by Dmitry A. Kuminov, 14 years ago

Rudi, thanks for the patch. I applied it in r774, please check (note that your could potentially cause an infinite loop if cache files couldn't be deleted for some reason).

The patch you suggested reduces the number of stat() calls in two times which may be a good speedup if there are a lot of cache files and they are located on a relatively slow file system (like in our case), so I think it's worth adding it no matter if it's a multiplatform issue or not.

comment:3 by Dmitry A. Kuminov, 14 years ago

Rudi, I have a feeling that you overlooked my comment. Could you please check if you are satisfied?

comment:4 by rudi, 14 years ago

Ahh... yes. The QPair implementation together certainly looks more elegant. However, I don't see the possibility of an infinite loop in the my code. It merely tries to keep the numbers correctly even if the removal of a file failed.

comment:5 by Dmitry A. Kuminov, 14 years ago

Okay, the second look at your patch shows that there is no loop indeed. Anyway, I'd actually want to know if we can close this defect now :)

comment:6 by rudi, 14 years ago

Yes, we can ;-).

comment:7 by Dmitry A. Kuminov, 14 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.