Comments (7)
The branch may serve as a starting point for further future optimizations, of which arrM
is only one.
from dunai.
Further bisecting of all the possible inlines suggests that inlining arr
is also a huge performance win.
from dunai.
Just a note: Issue #375 addressed the introduction of a benchmark. It will require discussion before making changes, but it may be worth seeing if those benchmarks, or how they are used, should be improved.
from dunai.
@turion thanks a lot for this very detailed report. I know it's a lot to ask on top of what you've already done, but would you be able to put together a small benchmark that shows the difference in terms of performance with one and the other?
from dunai.
Yes, I managed to find a benchmark using ListT that reproduces the issue, I believe. It's much more visible there because many MSFs are launched.
Reproduce with cabal run spaceleak --enable-profiling -- +RTS -hc -l-agu -i0.01 && eventlog2html spaceleak.eventlog
on branch https://github.com/turion/dunai/tree/dev_spaceleak.
Library on branch develop
, with benchmark added
89d4125 Adding spaceleak
Replaced arrM
definition with direct implementation
110e026 Write out arrM
- Huge performance win (time per tick is reduced a lot)
- Peak memory usage reduced from 28 to 21 MB
- Space leak still visible
Heavy inlining and strictification in many places (shotgun optimization)
11ba331 Inline many functions
- Again huge performance win
- Peak memory usage further reduced
- Space leak still visible
- Unclear yet which of the many optimizations had an effect, further research necessary
from dunai.
My current strategy to identify the minimal set of necessary changes is:
- Bisect on the profiling result until a commit is identified that improves performance
- Cherry-pick that commit onto a branch
improvements
- Rebase the whole branch with all inlinings onto
improvements
- Repeat until the performance improving commit is already on
improvements
from dunai.
Trying the benchmarks briefly seems to show that these changes here have a significant impact on the benchmarks. I think it would be very helpful if we could plot benchmarks (+ error bars) for several commits to compare them.
from dunai.
Related Issues (20)
- `dunai-examples`: Failure to compile in CI server due to version constraints on `SDL-gfx` HOT 1
- `bearriver`: Offer all definitions from `FRP.Yampa.Conditional`
- `bearriver`: Offer all definitions from `FRP.Yampa.Scan`
- `bearriver`: Offer all definitions from `FRP.Yampa.Delays`
- `dunai-test`: Reduce number of ways of defining past-time predicates
- `dunai-frp-bearriver`: Relax upper version constraint on `deepseq`
- `dunai`: Document compatibility with GHC 9.8
- Release dunai-0.12.0, dunai-test-0.12.0, bearriver-0.14.5
- `bearriver`: Offer all definitions from `FRP.Yampa.Time`
- `dunai`: CI job fails due to missing release file for postgresql repository
- `dunai`: Cabal file does not specify version bounds for dependencies
- Prevent hackage maintainers from modifying the cabal files
- Release dunai-0.12.1, dunai-test-0.12.1, bearriver-0.14.6
- Fix typo in CHANGELOG
- Release dunai-0.12.2, dunai-test-0.12.2, bearriver-0.14.7
- `dunai-test`: Cabal file does not specify version bounds for dependencies
- `bearriver`: Offer all definitions from `FRP.Yampa.EventS`
- `dunai`: Does not build with `transformers-0.6` because of `ListT` HOT 2
- strange asymmetry in composition of MSF (MaybeT m) a b using <|> HOT 2
- Build failure: Could not find module ‘Control.Monad.Trans.List’ HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dunai.