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 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. Regards, James ------------------------------------------------------------------------- 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