[GRASS5] [bug #1170] (grass) m.in.e00 segmentation faults

Eric G. Miller egm2 at jps.net
Wed Jul 3 06:02:26 EDT 2002


On Wed, Jul 03, 2002 at 08:14:32AM +0000, Michel Wurtz wrote:
> Writing the dig_cat file (adding each entry) takes an exponential time
> (I guess  that each time you add a new record, the library function
> test it against any other previous entries).  This is done just after
> creating them, so I suspect that is the reason why it takes so much
> time... and never finished.  The only solution I'm thinking of is to
> write directly the cat files, without the use of the grass library,
> since there cannot be duplicate entries in e00.  I hope also that this
> problem will be solved in the new vector format (Grass 5.1).

Yes, that could be a huge bottleneck.  I was comparing insertion sorts
vs. insert and then merge sorts on linked lists, and found dramatic time
differences as the list got larger.  The merge sort after inserting 1.5 
million ints took about 30 secs. on my aged machine while I gave up on the
insertion sort after around 20 or 30 minutes... Making the results
unique only requires one additional pass through the data after sorting.

You could bypass the API (even though I dislike recommending it) in the
creation of the category list(s), and just use it to write the files.
A better solution would be to add a bulk category update routine to
the library.

-- 
Eric G. Miller <egm2 at jps.net>



More information about the grass-dev mailing list