Skip to content

Conversation

gvillo
Copy link

@gvillo gvillo commented Jul 22, 2019

Purpose / Goal

Adds index to every child node to identify the original order on given XML. More info on Issue #173

Type

Please mention the type of PR

  • [ ]Bug Fix
  • [ ]Refactoring / Technology upgrade
  • [x]New Feature

Performance Test BEFORE


GabrielsMBP:fast-xml-parser villo$ node benchmark/perfTest3.js
Running Suite: XML Parser benchmark
validation : 21246.883984142958 requests/second
xml to json : 17989.54813241312 requests/second
xml to json + json string : 15885.46499388386 requests/second
xml to json string : 2682.04659842737 requests/second
xml2js : 6192.755486464043 requests/second

Performance Test AFTER

GabrielsMBP:fast-xml-parser villo$ node benchmark/perfTest3.js
Running Suite: XML Parser benchmark
validation : 21089.960179732523 requests/second
xml to json : 17787.686907309126 requests/second
xml to json + json string : 16353.244154453696 requests/second
xml to json string : 2708.111563294958 requests/second

xml2js : 6201.116585927645 requests/second

Performance Test AFTER (index of arrays/objects enabled)

xml to json (index to arrays/object enabled) : 15191.607136661647 requests/second
xml to json + json string (index to arrays/object enabled) : 11922.822294326417 requests/second
xml to json string (index to arrays/object enabled) : 2553.678400083379 requests/second

@gvillo gvillo mentioned this pull request Jul 22, 2019
@coveralls
Copy link

Coverage Status

Coverage increased (+0.04%) to 97.237% when pulling b4d9dea on gvillo:add-index-childCount-xml-parser into 84f11db on NaturalIntelligence:master.

@coveralls
Copy link

coveralls commented Jul 22, 2019

Coverage Status

Coverage increased (+0.07%) to 96.494% when pulling bd71e08 on gvillo:add-index-childCount-xml-parser into 52c0495 on NaturalIntelligence:master.

attrNodeName: false,
textNodeName: '#text',
appendIndexInNodes: false,
indexInNodesName: '#index',
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would change this to just index or indexXmlPosition, since you cannot use this prop in a javascript file because props cannot start with #, it's a sintaxis error.

@gvillo
Copy link
Author

gvillo commented Apr 16, 2020

Solved conflicts, feel free to reach me if you have any questions/suggestions

@amitguptagwl
Copy link
Member

preserveOrder is supported in v4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants