NaturalIntelligence / fast-xml-parser

Validate XML, Parse XML and Build XML rapidly without C/C++ based libraries and no callback.
https://naturalintelligence.github.io/fast-xml-parser/
MIT License
2.49k stars 302 forks source link

520 preserveorder formatting #526

Closed mdeknowis closed 1 year ago

mdeknowis commented 1 year ago

Purpose / Goal

Improve the indentation behaviour in case of preserveOrder as mentioned in issue #520

Performance

Before

$  node XmlBuilder.js
Running Suite: XML Builder benchmark
fxp : 87861.97295953878 requests/second
fxp - preserve order : 85976678.00085683 requests/second
xml2js  : 24993.80134645897 requests/second

$  node XmlParser.js
Running Suite: XML Parser benchmark
fxp v3 : 75320.38483930491 requests/second
fxp : 50433.057600239335 requests/second
fxp - preserve order : 54474.10059634518 requests/second
xmlbuilder2 : 19436.208365520688 requests/second
xml2js  : 13894.559475966855 requests/second

After

$  node XmlBuilder.js
Running Suite: XML Builder benchmark
fxp : 84735.79374909295 requests/second
fxp - preserve order : 79211254.59850551 requests/second
xml2js  : 23660.05480193879 requests/second

$  node XmlParser.js
Running Suite: XML Parser benchmark
fxp v3 : 77556.56255708831 requests/second
fxp : 52079.023194610905 requests/second
fxp - preserve order : 55343.6890609055 requests/second
xmlbuilder2 : 17231.516957593492 requests/second
xml2js  : 13254.958157840982 requests/second

Type

Please mention the type of PR

Note : Please ensure that you've read contribution guidelines before raising this PR. If your PR is in progress, please prepend [WIP] in PR title. Your PR will be reviewed when [WIP] will be removed from the PR title.

Bookmark this repository for further updates.

coveralls commented 1 year ago

Coverage Status

Coverage: 98.467% (+0.01%) from 98.454% when pulling 769cda56d1b5191e23fd572e0e0f4810ca8d984e on mdeknowis:520-preserveorder-formatting into 6689ed2ebc237b767f55270aa5b92fb95543cfc6 on NaturalIntelligence:master.

amitguptagwl commented 1 year ago

Thanks for your changes. Can you please create the PR against the dev branch?

mdeknowis commented 1 year ago

@amitguptagwl Created #527