Comments (10)
Can you give any hint on the point to "tweak" to improve the performance on large XML files?
from fast-xml-parser.
Also parser hang with large xml files, where sax based gives more predictable result
from fast-xml-parser.
Thanks for your contribution.
Regarding performance issue. Can you please tell me what exact behavior you experienced? What was the size of XML? And whether it was error out or took a long time to convert it into JSON? if it was error out then what was the error it thrown?
It can help me or others to tweak it.
from fast-xml-parser.
With small data this library faster up to 10-15 times
At xml 10M up to 1.5 times
At 100M it hang and terminates with allocation memory error
xml2js parse it at 14 seconds
from fast-xml-parser.
thanks for this data. I never tested this for big XML yet. I think I know where I can tweak it. I'll do it as soon as I find some free time. Once again thanks for your time to do this comparison.
from fast-xml-parser.
I tested for validator and I got to know that there are 2 reasons of failure.
- RangeError: Maximum call stack size exceeded.
- JS RegExp Very Long String
As I'm relying on RE heavily and JS RE engine is not able to parse a very long string (in MBs), it crashes. So either I'll have to change the implementation to read the string char-by-char and put many if conditions or I'll have to use some other 3rd party library or OS specific commands to parse it.
from fast-xml-parser.
I think this issue can be closed? Performance issues is not the subject of this.
from fast-xml-parser.
@Delagen I have updated the validator to handle large files as well.
from fast-xml-parser.
@amitguptagwl Thanks for work. Have you any performance comparison for large files?
from fast-xml-parser.
I didn't check the exact time. But I guess it is few seconds for 98mb long file. There was total 21s for 66 tests. including large and small files
from fast-xml-parser.
Related Issues (20)
- Online demo does not handle DOCTYPE correctly and gives an error HOT 2
- Regex Injection Via Doctype Entities HOT 4
- unreliable for parsing html HOT 2
- Introduce isObject option for unpaired tags HOT 2
- Parsing of Empty Tags HOT 4
- Entities are being processed in CDATA sections HOT 1
- Attribute in oneListGroup is not parsed correctly HOT 1
- All special characters are not correctly parsed HOT 4
- Ability to read & write DOCTYPE information HOT 2
- parser malfunctions when textNodeName is the same as a tag name HOT 8
- Node attributes get lost on XML parsing HOT 1
- Decimal point is not preserved after parsed to json. HOT 6
- Difficulty treating some numeric tags as string HOT 2
- XML parse looks good on Online tool, but when using API crashes HOT 2
- Any tag which has a format like <!D%s> where %s - any sequence of characters is perceived as <!DOCTYPE> and causes error HOT 2
- Not getting attribute value using XMLBuilder.build function HOT 7
- Object doesn't support property or method 'trimStart' HOT 3
- Parser erroneously adds `"@_/": true` attr for self-closing stop nodes HOT 2
- Missing `entities` option in XMLBuilder HOT 2
- XMLBuilder Incorrectly Serializes String "true" as Boolean Attribute HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fast-xml-parser.