-
Notifications
You must be signed in to change notification settings - Fork 97
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
bench runner can run external command #1028
base: develop
Are you sure you want to change the base?
Conversation
An automated preview of the documentation is available at https://1028.jsondocs.prtest.cppalliance.org/libs/json/doc/html/index.html |
Hi @grisumbras , thanks! There were two ideas in the issue with the newer, later idea being a log file. Upon further consideration I think that would have been preferable, having output nearly identical to the benchmark output, which makes correlating the logs and the benches as easy as possible. Well, in this case, I will need to generate the log file. By designing a "./1.sh". Can 1.sh generate this output, distinguishing Serialize and Parse, and including the bench results times?
The bench code is/was already writing "Parse mesh.json,clang x64/sse2,boost (pool),3200,5006,441" . Since it has that information, is it available as a string, and passed to "./1.sh"? |
Yeah, I think it should be possible. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #1028 +/- ##
========================================
Coverage 93.40% 93.40%
========================================
Files 87 87
Lines 8622 8622
========================================
Hits 8053 8053
Misses 569 569 Continue to review full report in Codecov by Sentry.
|
The debugging commands for the moment, the current most interesting goal is to generate a log file that looks as similar to the bench output as possible. (but adds timestamps. start/stop.) |
5ff581c
to
4ca398f
Compare
With the new version the accomapying script would be #!/bin/sh
echo >>/tmp/json-benchmarks.log $(date +'%Y/%m/%d %H:%M:%S:%3N') "$@" |
4ca398f
to
365b46e
Compare
An automated preview of the documentation is available at https://1028.jsondocs.prtest.cppalliance.org/libs/json/doc/html/index.html |
Great!! I will test it. |
An automated preview of the documentation is available at https://1028.jsondocs.prtest.cppalliance.org/libs/json/doc/html/index.html |
/tmp/benchmark_external_script.sh
Bench command: BOOST_JSON_BENCH_EXTERNAL_COMMAND=/tmp/benchmark_external_script.sh ./bench -i:b * Quotes are missing around /tmp/benchmark_external_script.sh to avoid escaping quotes through multiple scripts. However that shouldn't affect things. Result: The files Locally, could you try to replicate this using |
Everything works locally for me. Please check if the script has executable flag set. |
Ok thanks. I think I know what it is. |
|
Suddenly slow canada.json strikes again! |
Compare the numerical results at the end of the line.
/tmp/json-benchmarks.log
The current benchmarks might be lucky to have a chipset from 2010. The new machine exhibits more randomness. This is the problem - https://www.kernel.org/doc/Documentation/cpu-freq/intel-pstate.txt
|
To be honest, this doesn't explain to me the canada.json phenomenon. Or this PR wasn't an attempt to investigate it? |
This PR was an attempt to analyze and debug the performance of a new server, in general. Not specific to canada.json. Now there is a new server. So far it has been mostly consistent, with variability in the twitter data set. If that continues it could be worthwhile to examine the data and try to figure out why. |
Something else affecting the current benchmarks is that new machine is running Ubuntu 22.04 and clang-14. As soon as there is a supported upgrade path to Ubuntu 24.04 and clang-18 I will upgrade. That could improve the results. ( "It is recommended to wait until the release of 24.04.1 LTS (scheduled for August 15th, 2024) before upgrading from Ubuntu 22.04 LTS." ) |
Interesting. It looks like on this new machine it doesn't like parsing twitter.json with clang. |
Right. The results have a lot of randomization. Either red or green is not important there. |
Fix #1026.
The idea is that you can run an external command from the benchmark. The command is communicated via an environment variable. E.g. in bash:
BOOST_JSON_BENCH_EXTERNAL_COMMAND="./1.sh" ./bench -i:b
The bench runner invokes the command with these arguments:
start
orfinish
gcc
,clang
)For example, here's a script that does what was suggested in the issue: