I have a long GPX track of ~ 1.5 MB (10,492 trackpoints). When I import
it with Merkaartor (0.13-svn-20090102), it gets slower and slower
towards the end of the process. I have the impression that for every
imported trackpoint, more work is done. The CPU is at 50% (dual-core)
during the whole process. The entire import takes 25 seconds on my
machine: (Core 2 Duo, 2.4 GHz)

   50% -  5 seconds
   66% - 10 seconds
  100% - 25 seconds

I've investigated the issue but couldn't find any reason or solution for
this slow-down. Here's my "stack trace" to an interesting function call:

MainWindow.cpp - importFiles(...) - line 595
> importOK = importGPX(this, baseFileName, mapDocument, theTracklayers);

ImportGPX.cpp - diverse functions

ImportGPX.cpp - importTrkPt(...) - line 27
> theList->add(new AddFeatureCommand(theLayer,Pt, true));
(CommandList::add has no effect. I've added code to reserve sufficient
vector memory, to no effect. So I'm focussing on the AddFeatureCommand
constructor.)

DocumentCommands.cpp - AddFeatureCommand::AddFeatureCommand(...) - line 18
> redo();

DocumentCommands.cpp - AddFeatureCommand::redo() - line 41
> theLayer->add(theFeature);
(If this line is commented out, the process finishes quickly, but no
track layer is visible and nothing seems to be imported.)

MapLayer.cpp - MapLayer::add(MapFeature*) - line 196
> aFeature->setLayer(this);

MapFeature.cpp - MapFeature::setLayer(MapLayer*) - line 122
> p->theLayer = aLayer;
(If this last line of code is commented out, the application crashes
quickly during the import.)

I suppose that anywhere between the last two lines that I have
commented, there's the cause for the increasing slow-down. But I wasn't
able to find it.

Any ideas?

-- 
Yves Goergen "LonelyPixel" <[email protected]>
Visit my web laboratory at http://beta.unclassified.de

_______________________________________________
Merkaartor mailing list
[email protected]
http://lists.openstreetmap.org/listinfo/merkaartor

Reply via email to