Skip to content

Instantly share code, notes, and snippets.

@ptek
Created October 21, 2017 10:06
Show Gist options
  • Save ptek/933a4ace5d02790f0ee9cc3e7c638331 to your computer and use it in GitHub Desktop.
Save ptek/933a4ace5d02790f0ee9cc3e7c638331 to your computer and use it in GitHub Desktop.
ghc and hello world linux vs macOS - benchmarking the run times
ptek ~/hello> bench .stack-work/install/x86_64-linux/*/*/bin/hello
benchmarking bench/.stack-work/install/x86_64-linux/ghc-7.10.3/7.10.3/bin/hello
time 1.099 ms (1.092 ms .. 1.107 ms)
1.000 R² (0.999 R² .. 1.000 R²)
mean 1.106 ms (1.100 ms .. 1.112 ms)
std dev 20.16 μs (15.32 μs .. 29.03 μs)
benchmarking bench/.stack-work/install/x86_64-linux/ghc-8.0.2/8.0.2/bin/hello
time 1.001 ms (994.6 μs .. 1.008 ms)
0.999 R² (0.998 R² .. 1.000 R²)
mean 999.8 μs (995.3 μs .. 1.007 ms)
std dev 18.92 μs (11.83 μs .. 33.00 μs)
benchmarking bench/.stack-work/install/x86_64-linux/ghc-8.2.1/8.2.1/bin/hello
time 985.9 μs (975.9 μs .. 994.3 μs)
0.999 R² (0.999 R² .. 1.000 R²)
mean 993.0 μs (987.5 μs .. 997.5 μs)
std dev 18.40 μs (14.44 μs .. 24.60 μs)
ptek ~/hello> ls -lah .stack-work/install/x86_64-linux/*/*/bin/hello
-rwxr-xr-x 1 ptek staff 815K Oct 21 11:30 .stack-work/install/x86_64-linux/ghc-7.10.3/7.10.3/bin/hello
-rwxr-xr-x 1 ptek staff 829K Oct 21 11:30 .stack-work/install/x86_64-linux/ghc-8.0.2/8.0.2/bin/hello
-rwxr-xr-x 1 ptek staff 741K Oct 21 11:30 .stack-work/install/x86_64-linux/ghc-8.2.1/8.2.1/bin/hello
ptek ~/hello> bench .stack-work/install/x86_64-osx/ghc-*/*/bin/hello
benchmarking bench/.stack-work/install/x86_64-osx/ghc-7.10.3/7.10.3/bin/hello
time 5.709 ms (5.638 ms .. 5.772 ms)
0.999 R² (0.998 R² .. 0.999 R²)
mean 5.663 ms (5.625 ms .. 5.707 ms)
std dev 130.2 μs (106.8 μs .. 173.0 μs)
benchmarking bench/.stack-work/install/x86_64-osx/ghc-8.0.2/8.0.2/bin/hello
time 8.866 ms (8.760 ms .. 8.966 ms)
0.999 R² (0.998 R² .. 1.000 R²)
mean 8.975 ms (8.900 ms .. 9.068 ms)
std dev 224.1 μs (152.0 μs .. 311.2 μs)
benchmarking bench/.stack-work/install/x86_64-osx/ghc-8.2.1/8.2.1/bin/hello
time 24.77 ms (24.35 ms .. 25.20 ms)
0.999 R² (0.998 R² .. 1.000 R²)
mean 24.80 ms (24.62 ms .. 25.09 ms)
std dev 522.8 μs (353.3 μs .. 807.1 μs)
ptek ~/hello> ls -lah .stack-work/install/x86_64-osx/ghc-*/*/bin/hello
-rwxr-xr-x 1 ptek staff 1.0M Oct 20 23:09 .stack-work/install/x86_64-osx/ghc-7.10.3/7.10.3/bin/hello
-rwxr-xr-x 1 ptek staff 1.1M Oct 20 23:08 .stack-work/install/x86_64-osx/ghc-8.0.2/8.0.2/bin/hello
-rwxr-xr-x 1 ptek staff 965K Oct 20 23:08 .stack-work/install/x86_64-osx/ghc-8.2.1/8.2.1/bin/hello
module Main where
main :: IO ()
main = putStrLn "hello world"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment