Thorsten

 
> > just a quick note to this interesting thread ...
> > its elsif in nasal , not elseif ... no e
> 
> Thanks. That would explain it ;-)
> 
> > I hope you're not suggesting that C++ is always slower than Nasal? :-)
> 
> Pascal summarized it nicely - we already have ported the important stuff
to
> C++, so what remains in Nasal is a small fraction of the total performance
cost
> and we gain little as such by porting that as well. I'm sure the loop
computes
> even faster in C++, but I don't have the means to measure that. It'd be
> intersting though to see how much the difference actually is.
> 

It was just a couple of mouse clicks to remove the unused vars and change to
elsif. The best than can be said is that if I look really closely I can
convince myself that there is less time spent in Events - from about 210 ms
down to 195. The worst that can be said is that it looks a bit prettier.
Improved frame rate? Possibly. It's just tinkering on the margins, as you
said. I didn't do more than that - since it was more than a couple of mouse
clicks, and I expect that we will gain much more by removing redundant code
so that GC has less to do. 

Just to remind ourselves, Andy Ross (the author of Nasal) says:

"Performance is not a design goal. Nasal isn't especially slow. Early
benchmarks of the garbage collector showed it as faster than perl's
reference counter, and its number crunching performance is on par with
python. But in all cases, simplicity, transparency and a sane feature set
are preferred over speed."

It is a scripting language that is an abstraction layer over C, so we might
expect it not to be as quick  as code written in directly in C++. And as we
know, we're running into GC issues. Andy also says of GC:

"The current implementation is a simple mark/sweep collector, which should
be acceptable for most applications. Future enhancements will include a
"return early" capability for latency-critical applications. The collector
can be instructed to return after a certain maximum delay, and be restarted
later. Fancy items like generational collectors fail the "small and simple"
criteria and are not likely to be included."

I don't think it was a design aim to handle time-critical stuff like
Advanced Weather: that it does is a bonus. Were the "future enhancements"
ever implemented? I don't recall. Porting to C++ might be a little faster,
but it might also be the only way to avoid GC issues. Not that we're there
yet: here with all settimers() set to 0.0, I can get acceptable framerate
and stability. 

Vivian 





------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to