[Users] Search for messages between timestamps
Removed GDPR
removed-gdpr at example.com
Thu Aug 23 11:05:06 CEST 2018
Thanks for the explanation Colin.
I checked the files you mention:
[~]: du -Dh /etc/ld.so.cache \
> /lib/x86_64-linux-gnu/libc.so.6 \
> /usr/lib/locale/locale-archive \
> /etc/localtime \
> /etc/ld.so.cache
196K /etc/ld.so.cache
du: cannot access '/lib/x86_64-linux-gnu/libc.so.6': No such file or directory
du: cannot access '/usr/lib/locale/locale-archive': No such file or directory
4.0K /etc/localtime
So only 200Kb of files which will surely be cached on
first read (and are on an SSD drive too).
I also tried this test script which calls the first
one 1000 times to check how long it takes:
#!/bin/bash
for ((n=0;n<1000;n++)); do
`is-date-in-range 2018-08-05 2018-08-01 2018-08-10`
done
[~]: time ./test
real 0m3.407s
user 0m2.977s
sys 0m0.575s
Then I replaced the `date` calls with fixed values in
is-date-in-range script like this:
current=1533416400
start=1533070800
end=1533934799
which resulted in:
[~]: time ./test
real 0m1.139s
user 0m0.821s
sys 0m0.225s
Obviously there is a difference but even without
hard coding the values the 1000 calls are about 8 times
faster than the 491 calls which CM makes.
Copying the whole folder containing the messages takes
less than a second:
[~]: time `cp -a ~/mail/folder/ /tmp/`
real 0m0.499s
user 0m0.000s
sys 0m0.029s
Extracting the dates only is fast too:
[~]: time grep -riE '^Date:' ~/mail/folder/
...
real 0m0.009s
user 0m0.005s
sys 0m0.004s
So that is a total of 3.407 + 0.499 + 0.009 s. Far
below the ~25 s which CM takes.
How would you explain that? Could there be some
inefficiency in the way CM uses the external command?
--
George
More information about the Users
mailing list