quick performance measurements

Hi devs, I have a few ideas for tweaks to improve compiler performance. (For example, reversing the order of comparisons in a short-circuiting comparison operation.) I don't have a particular test case with a profile that tells me where the smoking gun is. But I'd like to try these easy tweaks just to see if performance improves. My question: Is there an easy way to run some command that will give me helpful feedback on my performance tweak? Of course, I could push to a branch and have perf.haskell.org tell me. But that takes a long time. I could compile a few files and examine the output manually. But that's a bit painful. Ideally, there would be a way to run a portion of the testsuite and have the testsuite tool aggregate performance characteristics and report. Or perhaps there's a way to get cabal to aggregate performance characteristics, and I could just try compiling a few libraries. Any ideas out there? Thanks! Richard

cd testsuite/tests/perf; make
| -----Original Message-----
| From: ghc-devs [mailto:ghc-devs-bounces@haskell.org] On Behalf Of Richard
| Eisenberg
| Sent: 12 February 2016 19:04
| To: ghc-devs@haskell.org developers

On Feb 12, 2016, at 3:28 PM, Simon Peyton Jones
cd testsuite/tests/perf; make
But that tells me only about failures. What if I have a tweak that makes an average 1% improvement over lots of files? That would be a nice improvement, but we don't have an easy way to collect this info, I think, other than perf.haskell.org.

You could tweak the function `checkStats` in `testsuite/driver/testlib.py`
a bit, to not only report failures.
Maybe also disable the following check, if you're doing this from a debug
build:
# Compiler performance numbers change when debugging is on, making the
results
# useless and confusing. Therefore, skip if debugging is on.
if compiler_debugged():
skip(name, opts)
On Fri, Feb 12, 2016 at 9:30 PM, Richard Eisenberg
On Feb 12, 2016, at 3:28 PM, Simon Peyton Jones
wrote: cd testsuite/tests/perf; make
But that tells me only about failures. What if I have a tweak that makes an average 1% improvement over lots of files? That would be a nice improvement, but we don't have an easy way to collect this info, I think, other than perf.haskell.org. _______________________________________________ ghc-devs mailing list ghc-devs@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs

Richard Eisenberg
Hi devs,
I have a few ideas for tweaks to improve compiler performance. (For example, reversing the order of comparisons in a short-circuiting comparison operation.) I don't have a particular test case with a profile that tells me where the smoking gun is. But I'd like to try these easy tweaks just to see if performance improves.
My question: Is there an easy way to run some command that will give me helpful feedback on my performance tweak?
Of course, I could push to a branch and have perf.haskell.org tell me. But that takes a long time. I could compile a few files and examine the output manually. But that's a bit painful. Ideally, there would be a way to run a portion of the testsuite and have the testsuite tool aggregate performance characteristics and report. Or perhaps there's a way to get cabal to aggregate performance characteristics, and I could just try compiling a few libraries. Any ideas out there?
Indeed I wish we had better infrastructure for this. There is nofib, which IIRC tracks compile-time performance although the coverage isn't terribly great. Otherwise, beyond tweaking the testsuite driver as thomie suggests the options are sadly fairly limited. Cheers, - Ben

Hi, Am Freitag, den 12.02.2016, 14:04 -0500 schrieb Richard Eisenberg:
Ideally, there would be a way to run a portion of the testsuite and have the testsuite tool aggregate performance characteristics and report.
if you run the test suite with $ VERBOSE=4 you get the detailed stats for every perf test, not only for the failing ones. This is what the gipeda runner does. You’d still have to manually compare them, though; no aggregation happening. Also, the compiler perf test cases usually check one specific extreme code path, so they are not a good measure of real world performance. nofib is better there, and has comparing integrated, but only checks those parts of the compiler that deal with idiomatic Haskell code from 10 or 20 years back. Maybe I should write a text that explains how to run gipeda locally on a bunch of commits on a local branch... but it’s only making the results more shiny, not more significant, than running nofib or the test suite manually. Greetings, Joachim -- Joachim “nomeata” Breitner mail@joachim-breitner.de • https://www.joachim-breitner.de/ XMPP: nomeata@joachim-breitner.de • OpenPGP-Key: 0xF0FBF51F Debian Developer: nomeata@debian.org

I realized there is a very simple way to do what I want: --make +RTS -s Specifically, I've arbitrarily chosen compiling Cabal as a test case, saying
ghc-stage2 Distribution/*.hs Distribution/*/*.hs --make -fforce-recomp +RTS -s
and seeing what I get.
Richard
On Feb 12, 2016, at 4:31 PM, Joachim Breitner
Hi,
Am Freitag, den 12.02.2016, 14:04 -0500 schrieb Richard Eisenberg:
Ideally, there would be a way to run a portion of the testsuite and have the testsuite tool aggregate performance characteristics and report.
if you run the test suite with $ VERBOSE=4 you get the detailed stats for every perf test, not only for the failing ones. This is what the gipeda runner does.
You’d still have to manually compare them, though; no aggregation happening.
Also, the compiler perf test cases usually check one specific extreme code path, so they are not a good measure of real world performance. nofib is better there, and has comparing integrated, but only checks those parts of the compiler that deal with idiomatic Haskell code from 10 or 20 years back.
Maybe I should write a text that explains how to run gipeda locally on a bunch of commits on a local branch... but it’s only making the results more shiny, not more significant, than running nofib or the test suite manually.
Greetings, Joachim
-- Joachim “nomeata” Breitner mail@joachim-breitner.de • https://www.joachim-breitner.de/ XMPP: nomeata@joachim-breitner.de • OpenPGP-Key: 0xF0FBF51F Debian Developer: nomeata@debian.org
_______________________________________________ ghc-devs mailing list ghc-devs@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
participants (5)
-
Ben Gamari
-
Joachim Breitner
-
Richard Eisenberg
-
Simon Peyton Jones
-
Thomas Miedema