Skip to content

Repository files navigation

Fast XML Parser vs @nodable/flexible-xml-parser

Compact Output

This is equivalent to running fast-xml-parser with preserveOrder mode false. Parser produces compact JS output. In this case fast-xml-parser goes through 2 layers of processing. But Flexible XML Parser gives the opportunity to write direct output builder for any format.

ptestptest_with_prologsample
fast-xml-parser19721.5480120030.7275119731.82809
@nodable/flexible-xml-parser33500.4875532858.3168333274.53886
Total1.698674341.6403955781.686338372

All the values in the table shows requests per second

Sequential Output

This is equivalent to running fast-xml-parser with preserveOrder mode true. Parser produces JS array.

ptestptest_with_prologsample
fast-xml-parser (preserveOrder)24482.7804421866.791177986.529038
@nodable/flexible-xml-parser30151.6715526204.8380411267.0917
Total1.231546051.198385161.410762003

All the values in the table shows requests per second

higher is better

Sequential Output with IO

This test includes reading file, parsing, writing the output to file.Fast XML parser doesn't support streams directly so it reads synchronously. Flexible XML Parser using stream reader and stream writer (output builder).

1.5 KB13 MB98 MB
fast-xml-parser (preserveOrder)2534.3490360.777774450.096257164
@nodable/flexible-xml-parser (using streams)4176.0318140.4756038190.016075023
Total1.6477729610.611493240.167000801

All the values in the table shows requests per second

Though, the performance of Flexible XML Parser is degrading with increasing file size but there is a clear advantage in memory.

File Size: 1.5 KB

All the values in the table are in MBs.

heap usedheap totalRSS
before FXP5.119.7853.39
after FXP5.4110.2854.39
before Flexible5.410.5354.39
after Flexible5.6611.0354.64

File Size: 13 MB

All the values in the table are in MBs.

heap usedheap totalRSS
before FXP5.119.7854.02
after FXP127.45164.28230.75
before Flexible5.4938.28208.07
after Flexible18.1852.49223.09

File Size: 101 MB

All the values in the table are in MBs.

heap usedheap totalRSS
before FXP5.1110.0353.57
after FXP920.21968.911019.68
before Flexible5.4838.53848.61
after Flexible102.31144.2948.99

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages