On Thu, Sep 16, 2010 at 1:28 PM, <thorsten.i.r...@jyu.fi> wrote:

> > You just discovered that Nasal is 10x slower than C++
> > code! This is exactly why I prefer core code to end up in C++ in the end.
>
> I don't think that's a valid interpretation of my results. Consider the
> two cases where I achieved a significant performance gain by replacing
> hard-coded structures with my own Nasal code (range animation,
> distance_to() method) - you wouldn't conclude from that that Nasal is
> faster either.
>
> I think what I have discovered is that well-designed code runs much faster
> than merely working code and that there's room for improvement in some
> places and it's worth looking for that room.
>
> Here's a case where your original Nasal code was the better algorithm:  it
"ought" to be better to hold the property tree nodes and index them
explicitly using getChild() than to create a property tree path string for
each child. However, the code that parses property tree paths has been
optimized, especially to allocate as little heap storage as possible, so its
speed outclasses the Nasal parser.

> The algorithm being equal, I don't think there's a question that C++ is
> faster (I doubt the factor 10 though - that seems to be an extreme case).
> Everything else being equal, I also don't think there's a question that
> Nasal code is more accessible. And I would base any decision what to
> hard-code and what not on that balance.
>
> Well, just my 2 cents...
>
> * Thorsten
>
> There's no question that scripting languages are good; fgfs has a lot of
Nasal code now. In my profiling I have never seen the nasal interpreter as a
hot spot, though I haven't profiled the new weather or some of Vivian's
experiments. At some point we might need to get more eyeballs looking at
Nasal performance.

Tim
------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to