Open ppalaga opened 5 months ago
@cowtowncoder here is the first sketch of what could become a real fix. Any feedback would be appreciated.
With a quick look that makes sense.
My one concern is that the attributes should only be tracked when information is needed (validation enabled, or duplicate check), and avoided otherwise. This because keeping track with a Maps will add measurable overhead for common case where validation is not enabled.
Thank for the feedback, @cowtowncoder!
My one concern is that the attributes should only be tracked when information is needed (validation enabled, or duplicate check), and avoided otherwise. This because keeping track with a Maps will add measurable overhead for common case where validation is not enabled.
+1. If SimpleOutputElement is the right place to implement the attribute tracking, then I can gladly have a look to make the implementation more performant.
My one concern is that the attributes should only be tracked when information is needed (validation enabled, or duplicate check)
That's actually the case already. All calls of SimpleOutputElement.checkAttrWrite(String, String, String, String)
are guarded by either BaseStreamWriter.mCheckAttrs
or by BaseStreamWriter.mValidator != null
.
Only the last commit is relevant. The rest is also available in https://github.com/FasterXML/woodstox/pull/191 where we can discuss it separately.
@cowtowncoder could you please review?
fix #179 fix #190