How boring. Somebody should check, seems to be too good.
Vector with attributes:
Number of nodes : 50201
Number of primitives: 50200
Number of points : 10000
Number of lines : 10000
Number of boundaries: 20200
Number of centroids : 10000
Number of areas : 10000
Number of isles : 1
Vector without attributes:
Number of nodes : 40201
Number of primitives: 40200
Number of points : 10000
Number of lines : 10000
Number of boundaries: 20200
Number of centroids : 0
Number of areas : 10000
Number of isles : 1
Note: It is slower for isolated areas. Even for isolated areas it could be
improved by searching for nodes of islands in area box, but in final
version (which should have spatial index), will be searching for areas better
because number of isles is usually less than number of areas. Just note -
you can forget it.
How boring. Somebody should check, seems to be too good.
Mmm, I haven't looked at the new code, but the old
version uses a hand made realloc that allocates a new
array and then copies the old array into the new
element by element, thus making
lots of works each time an array has to be enlarged
(according to the few comments available realloc was
buggy on Solaris at the time v.build was written) ...
maybe your new implementation uses the standard libc
realloc, which is much faster than this... just a guess
(maybe I am completely wrong)
ciao
Andrea Aime
On Mon, Feb 18, 2002 at 08:18:53AM +0100, Andrea Aime wrote:
Radim Blazek wrote:
>
> v.build accelerated now:
>
> grass50 grass51
> 270s 9s (with attributes)
> 124s 6s (without attributes)
>
> How boring. Somebody should check, seems to be too good.
>
Mmm, I haven't looked at the new code, but the old
version uses a hand made realloc that allocates a new
array and then copies the old array into the new
element by element, thus making
lots of works each time an array has to be enlarged
(according to the few comments available realloc was
buggy on Solaris at the time v.build was written) ...
maybe your new implementation uses the standard libc
realloc, which is much faster than this... just a guess
(maybe I am completely wrong)
ciao
Andrea Aime
Ciao Andrea,
is your comment a hint how to speed up the v.build in 5.0?
That would be really great. To build topology for the GSHHS shoreline
data takes more than 2 days on an average machine (o.k., yes, it is
possible and not crashing as seen with market place GIS software).
On Mon, Feb 18, 2002 at 08:18:53AM +0100, Andrea Aime wrote:
Radim Blazek wrote:
>
> v.build accelerated now:
>
> grass50 grass51
> 270s 9s (with attributes)
> 124s 6s (without attributes)
>
> How boring. Somebody should check, seems to be too good.
>
Hi Radim,
as promised I made a test with 5.1 and compared the last week's and the
latest version of v.build (330000 lines SHAPE, 1GHz machine)
"Old" version:
time v.build map=ITAIT2________GC.shp option=build
Registering lines: xxxxx/338971
338971 lines registered
Building areas: 100%
0 areas built
0 isles built
Attaching islands:
Attaching centroids: 100%
Writing topo file ...
Topology was built.
Number of primitives: 338971
Number of points : 0
Number of lines : 338971
Number of boundaries: 0
Number of centroids : 0
Number of areas : 0
Number of isles : 0
"New" version:
time v.build map=ITAIT2________GC.shp option=build
Build topology for 338971 shapes:
Registering lines:
338971 lines registered
Building areas: 100%
0 areas built
0 isles built
Attaching islands:
Attaching centroids:
Writing topo file ...
Topology was built.
Number of nodes : 283431
Number of primitives: 338971
Number of points : 0
Number of lines : 338971
Number of boundaries: 0
Number of centroids : 0
Number of areas : 0
Number of isles : 0
real 0m22.022s
user 0m10.510s
sys 0m4.000s
Comparing the results:
22.022/9251.405
[1] 0.002380395
The new version takes 0.2% (note: below 1 percent) of the time of the
old version of v.build.
GREAT JOB, Radim!! It is incredible fast now. Next I
will fill in the GSHHS data, another really large vector data set.
On Monday 18 February 2002 08:43, Markus Neteler wrote:
On Mon, Feb 18, 2002 at 08:18:53AM +0100, Andrea Aime wrote:
> Radim Blazek wrote:
> > v.build accelerated now:
> >
> > grass50 grass51
> > 270s 9s (with attributes)
> > 124s 6s (without attributes)
> >
> > How boring. Somebody should check, seems to be too good.
>
> Mmm, I haven't looked at the new code, but the old
> version uses a hand made realloc that allocates a new
> array and then copies the old array into the new
> element by element, thus making
> lots of works each time an array has to be enlarged
> (according to the few comments available realloc was
> buggy on Solaris at the time v.build was written) ...
> maybe your new implementation uses the standard libc
> realloc, which is much faster than this... just a guess
> (maybe I am completely wrong)
> ciao
> Andrea Aime
Ciao Andrea,
is your comment a hint how to speed up the v.build in 5.0?
That would be really great. To build topology for the GSHHS shoreline
data takes more than 2 days on an average machine (o.k., yes, it is
possible and not crashing as seen with market place GIS software).
Reallocation is not the problem, most of the time is consumed by looking
for spatialy related objects - nodes, lines, labels. Time increases
number of objects ^ 2 because build goes through all objects always.