-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Performance optimizations on Haskell simulation (#64)
* sample: fix parsing of --output option * runSampleModel: only print progress every 10k events * add perf flag to ouroboros-leios-sim includes some ghc-options we might want for more costly runs. * simulation: forking threads directly for SimPraosP2P io-sim's representation of ThreadId's is too costly with deeply nested children, such as what Concurrently's sequenceA produces on a 1000 length list. * moved to io-sim fork that uses IntPSQ for timers, 20x faster.
- Loading branch information
Showing
6 changed files
with
58 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,17 @@ maintainer: [email protected] | |
build-type: Simple | ||
extra-source-files: CHANGELOG.md | ||
|
||
flag perf | ||
description: Ghc options for improved performance, disables asserts. | ||
default: False | ||
manual: True | ||
|
||
-- These give us another 10% improvement (on short runs at least) | ||
common performance-opts | ||
ghc-options: | ||
-fignore-asserts -O2 -fexpose-all-unfoldings | ||
-fspecialise-aggressively | ||
|
||
library | ||
exposed-modules: | ||
Chan | ||
|
@@ -97,9 +108,18 @@ library | |
|
||
hs-source-dirs: src | ||
default-language: Haskell2010 | ||
ghc-options: -Wall -fno-ignore-asserts | ||
ghc-options: -Wall | ||
|
||
if flag(perf) | ||
import: performance-opts | ||
|
||
else | ||
ghc-options: -fno-ignore-asserts | ||
|
||
executable viz | ||
if flag(perf) | ||
import: performance-opts | ||
|
||
main-is: src/Main.hs | ||
build-depends: | ||
, base | ||
|
@@ -110,6 +130,9 @@ executable viz | |
ghc-options: -Wall | ||
|
||
executable sample | ||
if flag(perf) | ||
import: performance-opts | ||
|
||
main-is: src/SampleMain.hs | ||
build-depends: | ||
, base | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters