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

QTextStream::pos() seems to be linear over QFile size (or QFile::pos())

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.11
    • None
    • 54204fc79 (dev), c59e6b534 (6.10)

    Description

      The tst_QTextStream::pos3LargeFile() test shows quadratic behaviour in the size of the test file:

      File Size [KiB] Run Time [ms]
      1 34
      2 108
      4 783
      8 2243
      16 13742
      32 91884
      50 293146

      If I comment out the pos() calls, it takes 18ms for 50KiB.

      Even if the stream has to back off, this shouldn't take time linear in the file size or the position in the file. It should be possible to implement this in amortized constant time, which would make tst_QTextStream::pos3LargeFile() linear in the size of the test file.

      Attachments

        Issue Links

          For Gerrit Dashboard: QTBUG-138435
          # Subject Branch Project Status CR V

          Activity

            People

              thiago Thiago Macieira
              mmutz Marc Mutz
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are 2 open Gerrit changes