Skip to content

Instantly share code, notes, and snippets.

# -----------------------------------------------------------------------------
# A Sample build.mk
#
# Uncomment one of the following BuildFlavour settings to get the desired
# overall build type.
# -------- Build profiles -----------------------------------------------------
# Uncomment one of these to select a build profile below:
# Full build with max optimisation and everything enabled (very slow build)
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE ViewPatterns #-}
module Issue375 where
import Data.Array.Accelerate as A
import Data.Array.Accelerate.Debug as A
import Data.Array.Accelerate.Control.Lens
import Data.Array.Accelerate.Linear
{
"program": "dump",
"arguments": ["/Users/maoe/src/github.com/maoe/ghc-prof/dist-newstyle/build/x86_64-osx/ghc-8.2.0.20170404/ghc-prof-1.4.0.1/c/dump/noopt/build/dump/dump", "haddock.prof"],
"rts_arguments": ["-pj"],
"end_time": "Sun Apr 9 18:16 2017",
"initial_capabilities": 1,
"total_time": 0.15,
"total_ticks": 149,
"tick_interval": 1000,
"total_alloc":136426256,
### Keybase proof
I hereby claim:
* I am maoe on github.
* I am maoe (https://keybase.io/maoe) on keybase.
* I have a public key whose fingerprint is F64C D3B7 11BA 0021 4035 123C 91C5 6312 9845 7339
To claim this, I am signing this object:
@maoe
maoe / viewprof.prof
Created December 28, 2016 15:33
viewprof.prof
This file has been truncated, but you can view the full file.
Wed Dec 28 10:18 2016 Time and Allocation Profiling Report (Final)
viewprof +RTS -p -RTS ../ghc-prof/jonashaag.prof
total time = 68.98 secs (68985 ticks @ 1000 us, 1 processor)
total alloc = 93,896,514,944 bytes (excludes profiling overheads)
COST CENTRE MODULE %time %alloc
renderBox.renderHis Brick.Widgets.Core 10.1 16.9
{-# OPTIONS_GHC -O -fforce-recomp -dshow-passes -dverbose-core2core #-}
module BetaReduce where
e :: Int
e = (\x -> x + 2) 1
{-
-- RHS size: {terms: 6, types: 1, coercions: 0}
e :: Int
@maoe
maoe / c2hs.out
Last active August 29, 2015 14:18
c2hs fails to read the struct flock
% c2hs flock.chs -d trace -d ctrav
Attempting to read file `flock.chs'...
...parsing `flock'...
...successfully loaded `flock'.
Invoking cpp as `gcc -E -x c -U__BLOCKS__ -DC2HS_VERSION_MAJOR=0 -DC2HS_VERSION_MINOR=22 -DC2HS_VERSION_REV=1 flock.chs.h'...
Attempting to read file `flock.i'...
...parsing `flock.i'...
...name analysis of `flock.i'...
Defining object Ident "__builtin_va_list" 380505353 (OnlyPos <builtin> (<no file>,-1))...
Defining object Ident "__int8_t" 477252691 (NodeInfo ("/usr/include/i386/_types.h": line 37) (("/usr/include/i386/_types.h": line 37),8) (Name {nameId = 7}))...
@maoe
maoe / getByteStringN.hs
Last active August 29, 2015 14:15
Take n bytes of ByteString
import Data.ByteString (ByteString)
import Data.Iteratee
import qualified Data.ByteString as S
import qualified Data.ByteString.Builder as B
import qualified Data.ByteString.Lazy as L
getByteStringN :: Monad m => Int -> Iteratee ByteString m ByteString
getByteStringN = liftI . step mempty
where
step b n chunk
@maoe
maoe / bench.hs
Last active August 29, 2015 14:15
Memory allocation benchmark
import Control.Exception
import Data.Functor (void)
import Foreign hiding (void)
import Criterion.Main
main :: IO ()
main = defaultMain
[ bench "alloca" $ nfIO benchAlloca
, bench "malloc" $ nfIO benchMalloc