Hi,

On Thu, Nov 27, 2008 at 9:53 AM, James Turner <[EMAIL PROTECTED]> wrote:

>
> On 26 Nov 2008, at 12:19, James Turner wrote:
>
> >> strutils.cxx, simple..cxx, apt_loader.cxx
> >>    Accelerate parsing of apt.dat. As it stands it does aprox 5
> >> (five) million wasteful new/delete pairs, mostly in the
> >> strutils::split, vector<runway> growing and unnecessary string
> >> initializations in the main parse loop. Now it does >1 million new
> >> (1 per airport, 2 per runway/taxiway) and <100 (hundred) deletes. I
> >> find it's acceptably fast now. Also, it loads "Ypenburg The Hague"'s
> >> runways, seems nobody flew there ever :)
> >
> > Excellent. I've been doing some similar work in that area (not yet
> > ready for mass consumption) and also noticed the Ypenburg issue :)
> >
> > From a code aesthetic point of view, I can't say I like the extra
> > runway count and taxiway count arguments to addAirport, but I
> > appreciate the heap-traffic savings of getting the arrays correctly
> > sized.
>
> Just had a thought here - it should be possible to use
> std::vector::swap() to pass in std::vector<FGRunway*>&, and avoid the
> ugly 'count' arguments. I'll do up a patch for this today/tonight.


I changed it a bit, too. Now it passes the runways to the constructor and
addRunways is private. But using swap sounds like the solution. It'll need 2
vectors in the apt.dat main loop, one with runways, the other one with
taxis.


>
>
> I agree with Melchior's comments about putting apt.dat specifics into
> SimGear, the split helpers can happily live in apt_loader.cxx. That
> way we'll know to delete them if I ever replace the file format.


Changed the name to split_inplace and patching airways parsing to use it.
Still testing and timing. Possibly will look at the fix parsing, too, it's
slowish.


>
>
> Regards,
> James
>
>
greetings,
 yon
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to