read all of the information at once instead of concatenating
a QString over and over untill the end of the file. This removes
uneeded memory allocation and speeds up loading complex css files
Details
- Reviewers
hindenburg - Commits
- R319:633eb056fece: Simplify/Speedup reading Stylesheet file
Diff Detail
- Repository
- R319 Konsole
- Branch
- simplifySetStylesheet
- Lint
No Linters Available - Unit
No Unit Test Coverage - Build Status
Buildable 5669 Build 5687: arc lint + arc unit
Ok, I think I/someone read the docs and did it that way from the start - I wonder what the Qt docs thinks is a large file.
Reads the entire content of the stream, and returns it as a QString. Avoid this function when working on large files, as it will consume a significant amount of memory.
Calling readLine() is better if you do not know how much data is available.
That makes sense if you are processing the line and doing something with it
and discarding, but not appending to a string doing nothing with it until
the result is the whole file content. If what you want is the same as the
readAll, this one is faster as there’s no allocations for the temporary.
Em ter, 4 de dez de 2018 às 02:50, Kurt Hindenburg <
noreply@phabricator.kde.org> escreveu:
hindenburg added a comment. View Revision
https://phabricator.kde.org/D17329Ok, I think I/someone read the docs and did it that way from the start - I
wonder what the Qt docs thinks is a large file.
Reads the entire content of the stream, and returns it as a QString. Avoid
this function when working on large files, as it will consume a significant
amount of memory.Calling readLine() is better if you do not know how much data is available.
*REPOSITORY*
R319 Konsole*REVISION DETAIL*
https://phabricator.kde.org/D17329*To: *tcanabrava, hindenburg
*Cc: *konsole-devel, ngraham, maximilianocuria, hindenburg