[geos-devel] re:GEOS
Artem Pavlenko
artem at pavlenko.uklinux.net
Sat Mar 12 09:39:55 EST 2005
Hi strk,
Thanks for your reply.
>Thank you for your interest, GEOS needs some storming at the moment.
>About boost, I'd prefer to keep things simple and requirements low.
>
>
OK, here is some storming:-)
I suggest the following:
1. DONT do any optimization before datastructures, memory allocation etc
are sorted!!!
It might just obfuscate the algorithms and not lead to any performance
gains.
But instead:
2. Go through all the source and make sure that copying semantics are
implemented as they should be,
e.g something in Java:
Geometry(type1 a,type2 b) {
a_=a;
b_=b;
}
doesn't translates into:
Geometry(const type1& a,const type2& b) {
a_=a;
b_=b;
}
In C++ it is wrong and inefficient.
3. Where is operator=(const Object&) ?
Well, the compiler would generate one for you, but it's not a good idea
to rely on it.
4. Don't implement copy constructor in terms of assigment operator
(especially using a compiler generated one) e.g:
Object (const Object& other)
{
a_=other.a_;
b_=other.b_;
}
is wrong.
I bet most of the performance bottleneck will be solved by just applying
the above.
Re:boost
If you don't want GEOS to have extra dependencies, that's fine.
Why don't you use
http://svn.berlios.de/viewcvs/mapnik/trunk/src/ptr.hh?rev=17&view=markup
for your smart pointer needs? I does work for me. Or find something
else, there's plenty of other stuff around.
>Proposal for template application are welcome.
>
Well, one obvious thing would be to have PrecisionModel as a template
parameter:
template<typename PrecisionModel>
struct geometry
{
///
};
typedef geometry<MyPrecisionModel> MyGeometry;
I can come up with something more concrete if you like, but I need to
have a look at the implementation details.
Do you agree with the above?
Cheers!
Artem
More information about the geos-devel
mailing list