Skip to content
This repository has been archived by the owner on Dec 31, 2023. It is now read-only.

archive567/numhask-bench

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

numhask-bench

Performance testing of numhask-array using perf.

To install the benchmark locally:

cabal build && cabal install

defaults

numhask-bench -rc
label1label2old_resultnew_resultstatus
dynamictime27200.028000.0
fixedtime21300.020000.0improvement
hmatrixtime2220.02380.0slightly-degraded
numhask-hmatrixtime2490.02250.0improvement
numhask-bench -rc --best
label1label2old_resultnew_resultstatus
dynamictime1360.01360.0
fixedtime1370.01360.0
hmatrixtime908.0908.0
numhask-hmatrixtime943.0911.0
numhask-bench --dotm -n 1000 -rc
label1label2old_resultnew_resultstatus
dynamic-dottime1980000.01980000.0
dynamic-mmulttime15700.018200.0slightly-degraded
fixed-dottime57100.061000.0slightly-degraded
fixed-mmulttime7000.07740.0slightly-degraded
numhask-bench --dotm -n 1000 -rc --best
label1label2old_resultnew_resultstatus
dynamic-dottime136000.0136000.0
dynamic-mmulttime1360.01350.0
fixed-dottime3050.03040.0
fixed-mmulttime1400.01390.0
numhask-bench --dotv -n 1000 -rc
label1label2old_resultnew_resultstatus
fixed-dottime111.0204.0degraded
vector-dottime3360.04270.0degraded
numhask-bench --dotv -n 1000 -rc --best
label1label2old_resultnew_resultstatus
fixed-dottime91.3106.0slightly-degraded
vector-dottime2710.03090.0slightly-degraded

runtime control

https://downloads.haskell.org/~ghc/9.0.1/docs/html/users_guide/runtime_control.html

numhask-bench +RTS -A128m -Fd4 -xn
label1label2results
dynamictime2040.0
fixedtime2100.0
hmatrixtime27800.0
numhask-hmatrixtime1520.0

space

numhask-bench --spacetime +RTS -T -RTS
label1label2results
dynamicMaxMem1570.0
dynamicallocated8760.0
dynamicgcLiveBytes7570.0
dynamicgcollects0.0023
dynamicmaxLiveBytes0
dynamictime35500.0
fixedMaxMem15200.0
fixedallocated8960.0
fixedgcLiveBytes7830.0
fixedgcollects0.0022
fixedmaxLiveBytes8010.0
fixedtime55100.0
hmatrixMaxMem210.0
hmatrixallocated3620.0
hmatrixgcLiveBytes2910.0
hmatrixgcollects0.0009
hmatrixmaxLiveBytes0
hmatrixtime22100.0
numhask-hmatrixMaxMem4090.0
numhask-hmatrixallocated3230.0
numhask-hmatrixgcLiveBytes2560.0
numhask-hmatrixgcollects0.0008
numhask-hmatrixmaxLiveBytes1920.0
numhask-hmatrixtime24200.0

histograms

:r
:set prompt " > "
:set -Wno-type-defaults
:set -Wno-name-shadowing
:set -XOverloadedStrings
:set -XOverloadedLabels
import qualified Data.Text as Text
import qualified Data.Map.Strict as Map
import Chart
import Optics.Core
import Perf
putStrLn "ok"
>  >  >  >  >  >  >  >  >  > ok
t <- readFile "other/RunMMult-10000-10-StatAverage-MeasureTime.map"
m = read t :: (Map.Map Text.Text [[Double]])
d = m Map.! "dynamic"
take 10 $ mconcat $ d
>  > [3200.0,1584.0,1434.0,1510.0,1666.0,1406.0,1406.0,1522.0,1594.0,1404.0]

dynamic

filter (>= 1e5) $ mconcat d
[7668902.0,8348156.0,8809846.0,1.0789044e7,1.1317536e7,1.1542064e7,1.1922436e7,1.53579968e8,9022516.0,8921140.0,8971586.0,8850112.0,1.070094e7]
writeChartSvg "other/dynamic.svg" $ mempty & #hudOptions .~ colourHudOptions (rgb light) defaultHudOptions & #charts .~ unnamed [(RectChart (defaultRectStyle & #borderSize .~ 0 & #color .~ Colour 1 1 1 1) (zipWith (\y x -> Rect x (x + 1) 0 y) (fmap log $ mconcat d) [0..]))]

other/dynamic.svg

fixed

let (Just d) = Map.lookup "fixed" m
take 10 $ mconcat $ d
filter (>= 1e5) $ mconcat d
5225344.012773898.010488018.025661112.07318078.07116930.09726052.09709020.09599806.065775042.07350670.07046240.07293398.08669668.0
writeChartSvg "other/fixed.svg" $ mempty & #hudOptions .~ colourHudOptions (rgb light) defaultHudOptions & #charts .~ unnamed ([(RectChart (defaultRectStyle & #borderSize .~ 0 & #color .~ Colour 1 1 1 1) (zipWith (\y x -> Rect x (x + 1) 0 y) (fmap log $ mconcat d) [0..]))])

other/fixed.svg

hmatrix

let (Just d) = Map.lookup "hmatrix" m
take 10 $ mconcat d
filter (>= 1e5) $ mconcat d
7586972.03526798.0941788.0913168.0
writeChartSvg "other/hmatrix.svg" $ mempty & #hudOptions .~ colourHudOptions (rgb light) defaultHudOptions & #charts .~ unnamed [(RectChart (defaultRectStyle & #borderSize .~ 0 & #color .~ Colour 1 1 1 1) (zipWith (\y x -> Rect x (x + 1) 0 y) (fmap log $ mconcat d) [0..]))]

other/hmatrix.svg

numhask-hmatrix

let (Just d) = Map.lookup "numhask-hmatrix" m
take 10 $ mconcat d
filter (>= 1e5) $ mconcat d
758078.01633186.0916998.0132930.0604870.02835802.0566076.01975676.0419074.01231560.0602724.03088010.0
writeChartSvg "other/numhask-hmatrix.svg" $ mempty & #hudOptions .~ colourHudOptions (rgb light) defaultHudOptions & #charts .~ unnamed [(RectChart (defaultRectStyle & #borderSize .~ 0 & #color .~ Colour 1 1 1 1) (zipWith (\y x -> Rect x (x + 1) 0 y) (fmap log $ mconcat d) [0..]))]

other/numhask-hmatrix.svg

dynamic dotm

t <- readFile "other/RunDotM-10000-10-StatMedian-MeasureTime.map"
m = read t :: (Map.Map Text.Text [[Double]])
d = m Map.! "dynamic"
take 10 $ mconcat $ d
>  > [3200.0,1584.0,1434.0,1510.0,1666.0,1406.0,1406.0,1522.0,1594.0,1404.0]
filter (>= 1e7) $ mconcat d
[1.0789044e7,1.1317536e7,1.1542064e7,1.1922436e7,1.53579968e8,1.070094e7]
writeChartSvg "other/dynamic-dot.svg" $ mempty & #hudOptions .~ (colourHudOptions (rgb light) defaultHudOptions & #frames .~ [(20, FrameOptions (Just (border 0.004 white)) 0.1)]) & #charts .~ unnamed [(RectChart (defaultRectStyle & #borderSize .~ 0 & #color .~ Colour 1 1 1 1) (zipWith (\y x -> Rect x (x + 1) 0 y) (fmap log $ mconcat d) [0..]))]

other/dynamic-dot.svg

array comparison

https://stackoverflow.com/questions/11768656/reasonably-efficient-pure-functional-matrix-product-in-haskell

numhask-bench --array --median
label1label2results
array-mmulttime7640.0
fixed-dottime3220.0

About

Performance benchmarking of numhask-array.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published