Improving Nasal: Difference between revisions

Jump to navigation Jump to search
m
Line 65: Line 65:
Also see: [[How the Nasal GC works]]
Also see: [[How the Nasal GC works]]


Year: 2011
Year: 2011-2012
 


URL: http://www.mail-archive.com/flightgear-devel@lists.sourceforge.net/msg33190.html
URL: http://www.mail-archive.com/flightgear-devel@lists.sourceforge.net/msg33190.html
Line 168: Line 169:
blocking may occur. Frame rate may also influce it: many Nasal timers  
blocking may occur. Frame rate may also influce it: many Nasal timers  
run at delay 0 (in every update loop).
run at delay 0 (in every update loop).
URL: http://www.mail-archive.com/flightgear-devel@lists.sourceforge.net/msg37308.htmla
A significant part of Nasal-related frame rate impact is
caused by garbage collection. Its delay/jitter only depends on the
number of Nasal objects and their references which need to be searched.
Increasing the number of Nasal objects (code+data) existing in memory
also increases the delay.
The amount of Nasal code which is actually being executed only
influences the g/c frequency, i.e. whether the effect is visible every
few seconds vs several times per second.
URL: http://www.mail-archive.com/flightgear-devel@lists.sourceforge.net/msg37310.html
I did look at incremental GC for Nasal last year, but couldn't find a 'simple
enough' generational algorithm. Still happy for someone else to try - the Nasal
GC interface is very clean and self-contained, so quite easy to experiment with
different GC schemes.
URL: http://www.mail-archive.com/flightgear-devel@lists.sourceforge.net/msg37338.html
But as I said, I think really  the GC needs to be addressed. There's only so
much hacking around the actual problem one can do.
URL: http://www.mail-archive.com/flightgear-devel@lists.sourceforge.net/msg37338.html
Right, a problem is that I've possibly studied all Nasal documentation I could
get without finding any reference of the GC problem - that was only transmitted
to me much later. I think you'll find that most Nasal users are not aware of
any such problems, because it's not documented anywhere. It doesn't help so
much if you are aware of it.
URL: http://www.mail-archive.com/flightgear-devel@lists.sourceforge.net/msg37338.html
the current GC is bad, and big Nasal shows this while small Nasal doesn't.
URL: http://www.mail-archive.com/flightgear-devel@lists.sourceforge.net/msg37338.html
We have an implementation of Nasal which dumps all the GC into a single frame
and is apparently sensitive to the total amount of code, regardless if the code
is actually run or not. This fact has historically not been widely advertized
or explained. That turns out to be a problem.
The way this usually comes across is 'Advanced Weather causes stutter'. But it
actually doesn't really (or at least that remains to be shown) - what causes
stutter is mainly the GC, and Advanced Weather just happens to trigger this.
The range of suggested solutions in the past included almost everything, from
avoiding Nasal to porting code to Nasal to hacking around the problem to
loading things on-demand - except fixing the actual cause of the problems.
I don't honestly know how complex code to collect garbage across many frames
is, but somehow I doubt that in terms of man-hours the effort beats porting the
existing large-scale Nasal codes to C++. Just my 2 cents in any case.


== Separate GC implementations ==
== Separate GC implementations ==

Navigation menu