Bug 10902 – some phobos unittests take an excessive amount of time
Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-08-26T10:51:44Z
Last change time
2019-11-13T01:54:46Z
Keywords
pull
Assigned to
No Owner
Creator
Martin Nowak
Comments
Comment #0 by code — 2013-08-26T10:51:44Z
Just listing tests that run longer than 500ms on an extremely fast machine.
Testing std.exception: OK (took 746ms)
Testing std.uri: OK (took 529ms)
Testing std.uni: OK (took 1235ms)
Testing std.xml: OK (took 1226ms)
Testing std.process: OK (took 2885ms)
Testing std.uuid: OK (took 2235ms)
Testing std.utf: OK (took 3191ms)
Testing std.regex: OK (took 4058ms)
Testing std.conv: OK (took 8541ms)
Testing std.parallelism: OK (took 8444ms)
Testing std.file: OK (took 16418ms)
Testing std.datetime: OK (took 49056ms)
Comment #1 by hsteoh — 2013-08-27T08:13:16Z
On my machine (AMD Phenom II X6 1055T), the longest-running tests are:
Testing std.conv: OK (took 5789ms)
Testing std.datetime: OK (took 26923ms)
Testing std.exception: OK (took 502ms)
Testing std.file: OK (took 16078ms)
Testing std.parallelism: OK (took 8988ms)
Testing std.process: OK (took 2423ms)
Testing std.regex: OK (took 2458ms)
Testing std.uni: OK (took 589ms)
Testing std.utf: OK (took 2003ms)
Testing std.uuid: OK (took 1504ms)
std.datetime totally takes the cake when it comes to tests, I'm guessing just because of the sheer number of tests?
Comment #2 by code — 2013-12-22T11:07:32Z
> AMD Phenom II X6 1055T
Quite nice, I'm running on a i5-2400S. I'm still considering a Haswell or Broadwell because of the 'gather' instruction.
> std.datetime totally takes the cake when it comes to tests, I'm guessing just
because of the sheer number of tests?
I think this is really low-hanging fruit. A lot of test times don't relate to the complexity or I/O requirements of the module, so most likely the unittests cover an overly huge amount of data.
Often random coverage is good enough, see https://github.com/D-Programming-Language/phobos/pull/653.
If you look at a test run, e.g.
http://d.puremagic.com/test-results/test_data.ghtml?projectid=1&runid=57240&logid=6, this is the tail.
2.747s PASS std.process
2.332s PASS std.uuid
3.278s PASS std.utf
4.290s PASS std.regex
4.447s PASS std.random
7.251s PASS std.parallelism
8.268s PASS std.conv
16.090s PASS std.file
45.696s PASS std.datetime
The suspect modules are std.uuid, std.random, std.conv and std.datetime.
Comment #3 by hsteoh — 2014-08-09T15:35:37Z
Things seem to have improved recently; the top 10 longest-running tests are now:
0.235s PASS std.uri
0.286s PASS std.regex
0.464s PASS std.uni
0.615s PASS std.socket
0.813s PASS std.digest.sha
2.155s PASS std.process
2.518s PASS std.random
3.599s PASS std.datetime
9.435s PASS std.parallelism
16.015s PASS std.file
Comment #4 by dlang-bot — 2019-11-12T18:29:20Z
@berni44 created dlang/phobos pull request #7270 "Fix Issue 10902 - some phobos unittests take an excessive amount of time" fixing this issue:
- Fix Issue 10902 - some phobos unittests take an excessive amount of time
https://github.com/dlang/phobos/pull/7270
Comment #5 by dlang-bot — 2019-11-13T01:54:46Z
dlang/phobos pull request #7270 "Fix Issue 10902 - some phobos unittests take an excessive amount of time" was merged into master:
- 97abb919524017f87fdfcedc4e86f0aaea03cd29 by Bernhard Seckinger:
Fix Issue 10902 - some phobos unittests take an excessive amount of time
https://github.com/dlang/phobos/pull/7270