How the Nasal GC works: Difference between revisions

Jump to navigation Jump to search
m (Use Nasal highlighter)
Line 15: Line 15:


The garbage collector in Nasal is pretty self-contained and entirely implemented in the file [https://gitorious.org/fg/simgear/blobs/next/simgear/nasal/gc.c gc.c].
The garbage collector in Nasal is pretty self-contained and entirely implemented in the file [https://gitorious.org/fg/simgear/blobs/next/simgear/nasal/gc.c gc.c].
{{FGCquote
  |The built-in osgviewer stats can be extended with custom stats, that works by subclassing [http://trac.openscenegraph.org/documentation/OpenSceneGraphReferenceDocs/a00804.html osg::StatsHandler], this is already done in [https://gitorious.org/fg/flightgear/source/130f581b18711b63138580d306a39c27b891178c:src/Viewer/FGEventHandler.hxx#L14 $FG_SRC/Viewer/FGEventHandler.?xx]<br/>
The class can be  extended to add your own stats via [http://trac.openscenegraph.org/documentation/OpenSceneGraphReferenceDocs/a00804.html#a0472f445cdd72838f107766b2f67a220 osgViewer::StatsHandler::addUserStatsLine()]<br/>
<br/>
You can even register totally custom stats via [http://trac.openscenegraph.org/documentation/OpenSceneGraphReferenceDocs/a00801.html osg::Stats]<br/>
<br/>
The main suspects in this  case are probably 1) scenery, 2) cockpit, 3) Nasal (GC - bottleneck() function in simgear/nasal )<br/>
For the Nasal stats, you'll probably want to register them in FGNasalSys::FGNasalSys() by accessing globals-&gt;viewer-&gt; <br/>
That should give you a better idea about what's going on there, and it's been suggested by core developers, too:<br/>
<br/>
[http://www.mail-archive.com/flightgear-devel%40lists.sourceforge.net/msg37823.html http://www.mail-archive.com/flightgear- ... 37823.html]<br/>
{{cquote|Another goal is to add more node bits (and a GUI dialog to control them) so <br/>
various categories of objects can be disabled during the update pass. This will <br/>
mean the direct hit of, say, AI models vs particles vs random trees can be <br/>
measured. Of course it won't account for resources (memory, textures) burned by <br/>
such things, but would still help different people identify slowness on their <br/>
setups.}}
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=201742#p201742
    |title=<nowiki>Re: New Aircraft: the Extra500</nowiki>
    |author=<nowiki>Hooray</nowiki>
    |date=<nowiki>Sun Feb 23</nowiki>
  }}
}}


= Problem =
= Problem =

Navigation menu