-
-
Notifications
You must be signed in to change notification settings - Fork 7k
runtests: limit memanalyze.pl post-processing to torture tests
#19819
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This reverts commit 73a1d1b. Same perf, slightly worse maybe
|
Before fb7033d, AsyndDNS (= non-cares for most jobs) & TrackMemory jobs were tracking memory to the file In GHA/windows, there were two c-ares jobs that already had this overhead, before the patch above. E.g. windows arm64 MSVC timing details: Before: After: macOS before: https://github.com/curl/curl/actions/runs/19740488688/job/56562906727 Linux before: https://github.com/curl/curl/actions/runs/19740488712/job/56562906871 52s With the memanalyze pass disabled, Windows jobs are back to their previous perf: Questions:
|
memanalyze.pl post-processing to torture tests
|
memanalyze scans the memdump file which is produced by all tests when memdebug is enabled. The script verifies that memory, socket and file use is okay. That is done with and without torture. On Windows, memdebug is even more important than Linux because in Windows land they don't have valgrind. When using valgrind, the memdebug setup is less important: but only memanalyze can verify total allocation use for example. The memdebug tracking also helps us verify that individual test cases don't use more memory than allowed. So memanalyze adds quite a lot of checking. I suppose the main reason it takes a hit on Windows is that Windows is slow in general for files and processes and it is started many times and it scans that memdump file for every test. |
| } | ||
|
|
||
| if($feature{"TrackMemory"}) { | ||
| if($torture) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We want the file scanned for every yest. Torture and not torture.
It was. The feature capability |
|
Closing in favor of #19821 |
…t run) Patch #19786 removed an exception, which caused many more CI jobs to run `memanalyze.pl`. It resulted in a 10-30% (Linux), 15% (macOS), 100% (2x, on Windows) slowdown of runtest steps. It also made some jobs exceed their time limits and fail (seen with the Windows ARM64 job.) Turns out the overhead was caused by calling `memanalyze.pl` as an external process (twice per test), which in turn had to load a full Perl stack from scratch each time. Fix by converting memanalyze to a Perl modul, loaded as part of `runtests.pl`, which eliminated the overhead completely. It also sped up existing jobs where memanalyze was run for a long time, e.g. two c-ares Windows jobs, saving 4.5m per CI run. Supersedes #19819 Bug: #19786 (comment) Follow-up to fb7033d #19786 Closes #19821
Before this patch runtests with TrackMemory-enabled curl run
memanalyze.pltwice after each executed test. Except for the commoncase of AsynchDNS + non-c-ares (aka thread-resolver) builds, where
this step was skipped.
Patch #19786 removed this exception, which caused many CI jobs to run
memanalyze, resulting in a 10 (Linux) to 100% (2x, on Windows) increase
in test run times.
The intent before the patch above may have been to disable TrackMemory
for AsynchDNS builds, but what it really did was disabling tests 96,
558, 1330 that verified if TrackMemory is operating, displaying
a warning saying TrackMemory is disabled, but leaving memory tracking
enabled in curl (it's build-time option), which kept generating a
memdump, (but without runtests deleting it first). It also disabledmemanalyze.pl, to post-processmemdumpfiles.The patch above removed the above logic, but with side-effects.
Fix by limiting
memanalyze.plpost-processing to torture tests, whichseems to have been the original use-case for it, and the intent of
#19786 to enable it for all builds.
This also sped up existing jobs where memanalyze was accidentally run,
e.g. two c-ares Windows jobs, saving 4.5m per CI run.
Remaining questions: Why is
memanalyze.plso slow, esp. on Windows.Could it be made faster? Could be run just once per test, not twice?
Could Windows torture tests made usable by making it fast? #19675
Bug: #19786 (comment)
Follow-up to fb7033d #19786