D28528: UDSEntry: add constructor variant with std::initializer_list
Friedrich W. H. Kossebau
noreply at phabricator.kde.org
Fri Apr 3 02:05:30 BST 2020
kossebau created this revision.
kossebau added reviewers: Frameworks, dfaure, apol.
Herald added a project: Frameworks.
Herald added a subscriber: kde-frameworks-devel.
kossebau requested review of this revision.
REVISION SUMMARY
For entries with fixed set of fields having an initializer list option comes
as nice syntactix sugar and spares the need of the explicit reserve() call,
and making sure to use the right size value there.
Due to fields having either a numeric value or a string one, this needs some
bit of C++ vodoo to avoid extra costs of having both a QString & a longlong
field per every entry, which would also mean a QString constructor &
destructor call also for each numeric field of the init list.
The UDSEntryBenchmark showed that those constructors & destructors add
notable cossts over explicit code to reserve & fill a UDSEntry, while using
a union with a QString mapped onto a char array gets numbers close.
TEST PLAN
New & old unit tests work, KIO usage e.g. in Dolphin with local filesystem
or FTP server works as before.
REPOSITORY
R241 KIO
BRANCH
udsentryinitlistconstructor
REVISION DETAIL
https://phabricator.kde.org/D28528
AFFECTED FILES
autotests/udsentrytest.cpp
autotests/udsentrytest.h
src/core/slavebase.cpp
src/core/udsentry.cpp
src/core/udsentry.h
src/ioslaves/ftp/ftp.cpp
src/ioslaves/http/http.cpp
src/widgets/renamedialog.cpp
tests/udsentrybenchmark.cpp
To: kossebau, #frameworks, dfaure, apol
Cc: kde-frameworks-devel, LeGast00n, cblack, GB_2, michaelh, ngraham, bruns
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20200403/83811ead/attachment.html>
More information about the Kde-frameworks-devel
mailing list