https://github.com/luispedro/testingngless
https://github.com/luispedro/testingngless
haskell
Last synced: 9 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/luispedro/testingngless
- Owner: luispedro
- License: other
- Created: 2018-03-15T22:31:58.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-03-16T11:33:13.000Z (over 8 years ago)
- Last Synced: 2025-03-12T13:25:51.635Z (over 1 year ago)
- Topics: haskell
- Language: Haskell
- Homepage: http://ngless.embl.de
- Size: 10.1 MB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: COPYING
Awesome Lists containing this project
README
# Testing of -O2 pessimization with GHC
This code **uses linear space with -O2**, but runs in constant space without it.
This is a stripped down bit of [NGLess](http://ngless.embl.de) where this
strange behaviour was first observed.
`stack setup`
# Build with O2
Build with `-O2` and run
```bash
stack build
/usr/bin/time -v $(stack path --local-install-root)/bin/testingNGLESS
```
This is the result (increasing memory usage, upt to 150M in 3.5 seconds):

# Build without O2
```bash
stack clean
stack build --fast
/usr/bin/time -v $(stack path --local-install-root)/bin/testingNGLESS
```
This is the result (roughly stable memory usage, maximum usage around 11MB)

# RESULTS
The files `testingNGLESS_O2.svg` and `testingNGLESS-FAST.svg` show the memory
profiles of running the above.
Note that this is a small input file. On real data, memory usage is much higher
(several GBs).