geos icon indicating copy to clipboard operation
geos copied to clipboard

Don't initialize CoordinateSequence in constructor

Open eyal0 opened this issue 3 years ago • 7 comments

This ought to improve performance in the common case where initialization is unnecessary.

This fixes #764

eyal0 avatar Dec 08 '22 05:12 eyal0

@dbaston Please take a look, thanks.

eyal0 avatar Dec 08 '22 05:12 eyal0

@dbaston, is this a go or a no?

pramsey avatar May 04 '23 03:05 pramsey

It makes me nervous despite seeing the tests pass. I would rather creation sites clearly indicate that they do not require initialization by using the constructor that provides this parameter.

dbaston avatar May 04 '23 14:05 dbaston

Does such a constructor exist?

I'm trying to remember why I found this issue in the first place. I suppose some unit test of mine found it. Maybe performance tanked or something?

eyal0 avatar May 04 '23 14:05 eyal0

Yes, see https://github.com/libgeos/geos/blob/4c3bd72ba73e9688b0712d9878d073559c84e4d6/include/geos/geom/CoordinateSequence.h#L85-L96

dbaston avatar May 04 '23 14:05 dbaston

This has been sitting here for over a year are we thinking about doing anything about it @dbaston @eyal0 @pramsey

robe2 avatar Jan 10 '24 05:01 robe2

Like @dbaston I hate mucking around in the initializers, because the knock-on effects are subtle. I defer to him as usual.

pramsey avatar Jan 10 '24 16:01 pramsey

I'm just going to close this one out cause it's been sitting here for 2 years and is beginning to seriously annoy me. I think you are all agreed it's not a good idea.

robe2 avatar Aug 21 '24 20:08 robe2