Closed bluemel closed 1 year ago
I checked in a code formatter for Ecliplse in JSONata4Java/JSONata4Java/JSONata4JavaFormatter.xml -- you set it in Eclipse / Preferences / Java / Code Style / Formatter (import it). You can then reformat code using menu / keys... If you want to change the default settings go ahead.
Hi Nat,
I did a little reasearch if I could / should improve the performance of the parent operator and found out:
The performance of the current "brute force" approach to scan the whole JSON input node hierarchy and to store all child / parent links in a HashMapis is not so bad at all. On my developer box we can process a JSON with over 2million nodes with parent path in the JSONata expression in under 10 seconds while the "brute force" scan takes about 30% of the whole processing time. This behavor is quite linear in a broad range also comparing an expression without and with parent path.
It is not trivial at all to achieve any improvement of the current approach. Two ideas from my side: a) try to keep track of the path in the hierarchy of input JSON nodes how we came to the JSON node that is currently processed by the JSONata4Java expression interpreter. Very difficult with the current interpreter implementation. I gave up after some hours of investigations. b) extend the Jackson parser to create a hierarchy of duplicate linked JSON-Nodes from the start. I did not have a serious try so far.
However I'd recommend to merge my experiments (test code only) here to master without building a new release because it is only test code change and small refactoring in the production code.
Besides additional tests I've touched also slightly 2 production code classes:
Generally I'd raise the question if we have any code format guidelines for this project? If not maybe we should think about introducing some uniform format to the whole code base. I've made good experiences with that also with heterogenious teams.