Coder Social home page Coder Social logo

Comments (10)

winston01 avatar winston01 commented on July 18, 2024 1

@amitguptagwl

Can you give any hint on the point to "tweak" to improve the performance on large XML files?

from fast-xml-parser.

Delagen avatar Delagen commented on July 18, 2024

Also parser hang with large xml files, where sax based gives more predictable result

from fast-xml-parser.

amitguptagwl avatar amitguptagwl commented on July 18, 2024

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.

Delagen avatar Delagen commented on July 18, 2024

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.

amitguptagwl avatar amitguptagwl commented on July 18, 2024

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.

amitguptagwl avatar amitguptagwl commented on July 18, 2024

I tested for validator and I got to know that there are 2 reasons of failure.

  1. RangeError: Maximum call stack size exceeded.
  2. 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.

Delagen avatar Delagen commented on July 18, 2024

I think this issue can be closed? Performance issues is not the subject of this.

from fast-xml-parser.

amitguptagwl avatar amitguptagwl commented on July 18, 2024

@Delagen I have updated the validator to handle large files as well.

from fast-xml-parser.

Delagen avatar Delagen commented on July 18, 2024

@amitguptagwl Thanks for work. Have you any performance comparison for large files?

from fast-xml-parser.

amitguptagwl avatar amitguptagwl commented on July 18, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.