roseus is almost 30x slower than irteusgl when testing transparent.l
Affonso-Gui opened this issue · 0 comments
Affonso-Gui commented
When testing https://github.com/euslisp/jskeus/blob/master/irteus/test/transparent.l with the current opt version:
$ time irteusgl transparent.l
real 0m49.797s
user 0m44.197s
sys 0m2.729s
$ time roseus transparent.l
real 24m4.576s
user 23m54.317s
sys 0m4.024s
This is due to having the misfortune of landing in a situation in which there is not enough heap memory available, so the gc runs many unnecessary times.
;; irteusgl
0 gc:(2981970 7902582), vmrss:126252(86324), gctimes:71
1 gc:(2981970 7902582), vmrss:130440(86324), gctimes:78
2 gc:(2981970 7902582), vmrss:130440(86324), gctimes:85
3 gc:(2981970 7902582), vmrss:130464(86324), gctimes:92
;; roseus
0 gc:(936039 6134703), vmrss:131620(105268), gctimes:346
1 gc:(936039 6134703), vmrss:135944(105268), gctimes:633
2 gc:(936039 6134703), vmrss:135944(105268), gctimes:920
Usually the heap memory is resized to totalheap * gcmargin
to avoid this issue. However, in this case it happens that enough memory is allocated in the first gc attempt, so the heap is never resized.
https://github.com/euslisp/EusLisp/blob/master/lisp/c/memory.c#L287-L293