[GHC] #13360: Add a flag to enable inferring HasCallStack constraints
GHC
ghc-devs at haskell.org
Fri Nov 10 10:14:16 UTC 2017
#13360: Add a flag to enable inferring HasCallStack constraints
-------------------------------------+-------------------------------------
Reporter: gridaphobe | Owner: (none)
Type: feature request | Status: new
Priority: normal | Milestone: 8.4.1
Component: Compiler | Version: 8.0.1
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by saurabhnanda):
Here are some benchmarks for postgresql-simple, a project which is doing
significant real-world IO (which is where most errors occur, in my
experience):
**No Callstack -- Benchmarking a query with/without error**
{{{
benchmarking complicatedQuery/without error
time 172.3 μs (169.0 μs .. 175.2 μs)
0.985 R² (0.971 R² .. 0.993 R²)
mean 224.5 μs (203.3 μs .. 271.1 μs)
std dev 110.9 μs (58.97 μs .. 200.8 μs)
variance introduced by outliers: 99% (severely inflated)
benchmarking complicatedQuery/with error
time 171.4 μs (169.6 μs .. 173.5 μs)
0.996 R² (0.992 R² .. 0.999 R²)
mean 174.4 μs (171.3 μs .. 179.8 μs)
std dev 14.00 μs (8.934 μs .. 19.24 μs)
variance introduced by outliers: 72% (severely inflated)
}}}
**HasCallStack -- Benchmarking same query but with
[https://github.com/vacationlabs/postgresql-
simple/commit/774d3eaa259c217ada3918e5c29f3dab792af38c: HasCallStack
applied on almost every function of the library]**
{{{
benchmarking complicatedQuery/without error
time 177.9 μs (176.3 μs .. 180.6 μs)
0.996 R² (0.992 R² .. 0.998 R²)
mean 186.8 μs (182.6 μs .. 192.6 μs)
std dev 17.42 μs (13.92 μs .. 21.59 μs)
variance introduced by outliers: 78% (severely inflated)
benchmarking complicatedQuery/with error
time 171.4 μs (168.7 μs .. 175.6 μs)
0.991 R² (0.981 R² .. 0.997 R²)
mean 175.3 μs (171.4 μs .. 182.1 μs)
std dev 17.27 μs (11.45 μs .. 25.30 μs)
variance introduced by outliers: 80% (severely inflated)
}}}
The difference in perf is coming across as almost noise.
**Is this an acceptable benchmark for measuring real-world impact of
enabling HasCallstack for IO-centric functions? Does this strengthen the
case for implementing this flag?**
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13360#comment:20>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list