-
Notifications
You must be signed in to change notification settings - Fork 1
Draft: feat: --max-bytes-used (#2) #6
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
base: master
Are you sure you want to change the base?
Conversation
Hello @simonmichael, In #6 , I just added It would be quite easy to support any or all of the following ghc runtime stats:
Rather than a separate flag for each, something like What do you think? |
33a12ee
to
cc70cf8
Compare
Woo that's a lot! Let's keep it simple, max_byte_used looks the most useful. This is quite a specific feature, but useful to haskell devs like us. How about calling it -m/--mem (or -m/--mem-ghc if we want to be more accurate). |
If used with a non-haskell program, or a haskell program not compiled the right way, what happens ? Is it worth using GHC's RTS stats, or could we get the same info by a more general technique, not depending on GHC ? |
I think "bytes allocated" could be quite useful as well, as a proxy for runtime. For example from https://hasura.io/blog/hasura-and-well-typed-collaborate-on-haskell-tooling#fn1:
I can't find a better reference now, but it's what the ghc project itself used to do / does. It would be a partial answer to your question in simonmichael/hledger#2122 (comment):
|
+----------------------------------------------++---------------------------++-----------------------------+ | || Time (s) || Max bytes used | +==============================================++===========================++=============================+ | || hledger-1.40 hledger-1.41 || hledger-1.40 hledger-1.41 | +==============================================++===========================++=============================+ | -f examples/1ktxns-1kaccts.journal balance || 0.21 0.21 || 3.84M 4.28M | | -f examples/2ktxns-1kaccts.journal balance || 0.35 0.33 || 7.43M 6.39M | | -f examples/3ktxns-1kaccts.journal balance || 0.49 0.49 || 10.48M 11.59M | | -f examples/4ktxns-1kaccts.journal balance || 0.53 0.36 || 14.61M 11.49M | | -f examples/5ktxns-1kaccts.journal balance || 0.47 0.41 || 18.32M 15.52M | | -f examples/6ktxns-1kaccts.journal balance || 0.47 0.49 || 21.72M 21.60M | | -f examples/7ktxns-1kaccts.journal balance || 0.55 0.57 || 22.35M 25.17M | | -f examples/8ktxns-1kaccts.journal balance || 0.61 0.64 || 22.28M 24.02M | | -f examples/9ktxns-1kaccts.journal balance || 0.70 0.67 || 31.41M 24.03M | | -f examples/10ktxns-1kaccts.journal balance || 0.77 0.78 || 36.00M 35.56M | | -f examples/20ktxns-1kaccts.journal balance || 1.52 1.55 || 72.62M 72.62M | | -f examples/30ktxns-1kaccts.journal balance || 2.19 2.29 || 85.87M 96.99M | | -f examples/40ktxns-1kaccts.journal balance || 2.91 3.04 || 120.17M 130.21M | | -f examples/50ktxns-1kaccts.journal balance || 3.60 3.62 || 129.01M 140.33M | | -f examples/60ktxns-1kaccts.journal balance || 4.28 4.44 || 162.47M 175.05M | | -f examples/70ktxns-1kaccts.journal balance || 4.99 5.07 || 195.87M 207.53M | | -f examples/80ktxns-1kaccts.journal balance || 5.60 5.76 || 211.37M 219.93M | | -f examples/90ktxns-1kaccts.journal balance || 6.34 6.49 || 241.11M 250.92M | | -f examples/100ktxns-1kaccts.journal balance || 6.90 7.01 || 255.24M 264.18M | +----------------------------------------------++---------------------------++-----------------------------+
You get some inexplicable error message: hGetLine: end of file
error: hledger-1.42: Most RTS options are disabled. Link with -rtsopts to enable them. I guess it would be better to first check if the program is a haskell program and whether it's linked with -rtsopts (by checking
There are multiple different memory measurements collected by the ghc runtime system, so just "--mem-ghc" is perhaps not accurate enough (is it max or average or total allocation?). A |
Currently, quickbench is positioned as a really quick and easy (quick and dirty, some might say) reporting tool - "a better |
I'm not against adding a simple "memory" measurement for haskell programs, as I'd personally find that very handy, but I wonder how far to go. |
I'd also love to show "transactions per second" in these reports when benchmarking hledger or other PTA apps. Supporting such custom metrics, somehow, would be another nice feature (and scope expansion). |
We could add a Its argument should be the path to a program whose task it is to parse the output of the program under test and output custom metrics in some standardized format (json/csv). quickbench would then take those metrics and report them alongside the time measurements. In hledger, there would be a
Then
|
Increasingly off topic, but while we're brainstorming: I wished for an easy display of changes (perhaps only between two executables). Eg to summarise results for two hledger versions I made this one by hand:
|
When supplying the flag
--max-bytes-used
, quickbench now also reports the max residency of the program under test. Works for haskell programs only, and they need to be compiled with-rtsopts
.Example output: