jsonix
jsonix copied to clipboard
Improve unmarshalling performance
Related to highsource/jsonix-support#6
@bartvde Here's an issue to address performance problems.
thanks @highsource do you think it's the stack based approach that the ol3 parser uses or something else?
"stack based approach that the ol3 parser uses" - not sure what this is, would you happen to have a specific pointer for me?
I've profiled around a bit, but, unfortunatelly don't see a single specific problem. However there are few things which may altogether contribute to inferior performance:
- Support for QNames - Jsonix effectively has to parse all the attributes looking for namespace declarations. This can be made configurable so that you could disable QNames support if you need.
- Support for
xsi:type- also means all the attributes must be read. Can be disabled. - Detecting whitespace - surprizingly seems to take much time. Can be optimized.
I see there are good chances to improve performance, but it'll take effort. No quick wins here, unfortunately.
A few years ago I had a similar case (competing vs. OL2 back then). With a few targeted tweaks I could match/overcome OL2 performance. As far as I remember, attributes were quite an issue back then as well as detecting blank strings.
there is some explanation on the stack based approach here: https://github.com/openlayers/ol3/tree/master/src/ol/format
No, don't think this would help much. I'll run a few experiments later on. There's definitely very good potential.