Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-34495

QNetworkDiskCache heavy on small unbuffered reads.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: P2: Important
    • Resolution: Unresolved
    • Affects Version/s: 4.8.5, 5.2.0 Beta1
    • Fix Version/s: None
    • Component/s: Network: Cache
    • Labels:
      None

      Description

      QCacheItem::read does a lot of small, operator based QDataStream reads.
      That is be fine as long as the underlying device is buffered, which is the case in ::metaData() call.

      But during the actual ::data() call, the cachefile header is re-read, this time with unbuffered device, see qnetworkdiskcache.cpp:415-418:
      if (!file->open(QFile::ReadOnly | QIODevice::Unbuffered))
      return 0;

      if (!d->lastItem.read(file.data(), true)) {
      This is causing heavy I/O and an order of mangitude slowdown of given operation on small cache entries

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            shkearns Shane Kearns
            Reporter:
            nenik Petr NejedlĂ˝
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes