Opened 9 years ago

Closed 9 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:


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) (1.1 KB) - added by rudi 9 years ago.
Patch for src/network/access/qnetworkdiskcache.cpp

Download all attachments as: .zip

Change History (8)

Changed 9 years ago by rudi

Patch for src/network/access/qnetworkdiskcache.cpp

comment:1 Changed 9 years ago by dmik

  • Milestone changed from Qt Enhanced to Qt 4.6.3

comment:2 Changed 9 years ago by dmik

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 Changed 9 years ago by dmik

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

comment:4 Changed 9 years ago by rudi

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 Changed 9 years ago by dmik

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 Changed 9 years ago by rudi

Yes, we can ;-).

comment:7 Changed 9 years ago by dmik

  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.