gdsestimating / dxf-parser

A javascript parser for DXF files. It reads DXF file strings into one large javascript object with more readable properties and a more logical structure.
MIT License
454 stars 140 forks source link

Performance: Make string splitting faster #117

Closed jamesbradleym closed 2 months ago

jamesbradleym commented 2 months ago

Using regex was making string splitting dreadfully slow. Moving to some good old fashioned indexOf('\n') made it ~24x faster

Before:

Screenshot 2024-06-20 at 5 39 04 PM

After:

Screenshot 2024-06-20 at 5 39 53 PM