Gauche
Gauche copied to clipboard
Optimize data.heap
Looks like it has too much overhead.
http://chaton.practical-scheme.net/gauche/a/2017/04/11#entry-58ed2fb2-3245c https://gist.github.com/torus/35d71f5016957cd64659b0e5bb23ed21
Two significant factors:
- Overhead of method dispatch: We use '~' a lot in data.heap so that the code works generically across different backend storage. It is order of magnitude slower than the specific referencer.
- Overhead of comparator ops. Compared with direct comparison procedure, comparator ops (e.g. <?) are 7-10 times slower.
For the first point, we're introducing several measures to improve the performance. A couple of them are merged to master. More to come. https://github.com/shirok/Gauche/commit/55d275a78cee11d496d1b1f1ba62bccbd120b18d https://github.com/shirok/Gauche/commit/556fee985246eed0dd0189b3763d662bf0b0075b
For the second point, we've optimized comparator ops 2-3x so far. https://github.com/shirok/Gauche/commit/ac0441da21fc78024bb180394ebe3edb554b6d34