owlike/genson

GensonJsonObject impementation is very inefficient for most Map methods

aseovic opened this issue · 3 comments

GensonJsonObject extends java.util.AbstractMap, which implements most Map operations as O(n) or worse.

There is really no reason to extend AbstractMap when we already have the values field that we can delegate all Map operations to.

I don't have any objection in removing the abstract map and just delegating every call to the passed in map. I'm surprised that's not what I did initially ... well ... :)

It happens :-)

The same is true for GensonJsonArray, which extends AbstractList. That's not as bad, but I do think we should be consistent and delegate everything.

I will submit a PR shortly.

Fixed.