Property Tree Performance

From FlightGear wiki
Revision as of 14:20, 25 February 2017 by Hooray (talk | contribs)
Jump to navigation Jump to search
This article is a stub. You can help the wiki by expanding it.

Background

getNode("foo") and getChild("bar") consumes CPU while setFloatValue() seems to be quick.[1]

when writing to the property tree. Yasim creates ~250 surfaces for the CRJ700 and ~150 for the Citation II If I try to write data for those surfaces to the property tree (at FDM rate), frame delay rises rapidly, if I write more than 4 or 5 values per surface. I use getNode(), getChild(), set/get*Value()[2]


That seems to be about the I/O speed of the property tree. Don't do it at FDM rate for starters, do it only as fast as you actually need and stagger the process.[3]

For a more recent benchmark/test case (self-contained via the Nasal Console), see: Howto:Canvas Path Benchmarking

Canvas-path-benchmarking.png[4]


Property name lookups are slow, there are some tricks to optimise that we could do, especially using a global hot cache. This would also allow an easy way to fix problem cases, by taking the hottest entries and fixing their call sites to cache the node. The first thing, however, is extending the existing unit test to do some basic benchmarking of reads & writes, and name lookups. And then the same but in the presence of narrow and broad listeners. [5]

References

References
  1. jsb  (Feb 25th, 2017).  Re: [Flightgear-devel] Properties benchmarking .
  2. jsb  (Feb 25th, 2017).  Re: [Flightgear-devel] Properties benchmarking .
  3. Thorsten Renk  (Feb 25th, 2017).  Re: [Flightgear-devel] Properties benchmarking .
  4. Hooray  (Dec 10th, 2016).  Re: Remote canvas utility .
  5. James Turner  (Feb 25th, 2017).  Re: [Flightgear-devel] Properties benchmarking .