Diffusion KIO f7e00b40a6d3

Don't stat(/etc/localtime) between read() and write() copying files

Authored by jtamate on Jan 12 2018, 3:59 PM.

Description

Don't stat(/etc/localtime) between read() and write() copying files

Summary:
CCBUG: 384561

Unfortunately, QDateTime::currentDateTime() checks /etc/localtime
each time it is called.
Chaning to QElapsedTime, no check of /etc/localtime.
Reproducing bug 384561, the strace of file.so was something like:
read(), stat(/etc/localtime), stat(/etc/localtime),
stat(/etc/localtime), stat(/etc/localtime), stat(/etc/localtime),
write(), read() ......
Now it is: read(), write()
It also reduces the cpu in io/wait around 10% in a debug build.

Reviewers: Frameworks, dfaure

Reviewed By: dfaure

Subscribers: broulik, ngraham, Dolphin

Tags: Frameworks

Differential Revision: https://phabricator.kde.org/D9844