hassansin / parse-address

US Street Address Parser
http://hassansin.github.io/parse-address/
Other
157 stars 81 forks source link

Parser is extremely slow #5

Closed esamelson closed 7 years ago

esamelson commented 7 years ago

I am trying to use this package to parse a large amount of GIS data on a node server, and I'm running into an issue in that parseLocation takes almost 500 milliseconds to parse just one string. As I need to parse upwards of 10,000 strings for each data set, this creates quite a hangup on my server!

My use cases all look something like parseLocation('NW GRANT AV') -- in each case I just need to separate out the directional prefix and street type from the street name. Am I doing something wrong which is causing it to take this long, or is this just the approximate expected time for the parser to complete?

Thanks in advance for any response.

hassansin commented 7 years ago

It's been a long time since I developed this package. Looks like there is a new version released for XRegExp. I quickly tested the package with the new version and seem pretty fast (arround 1/2 ms for your example) . I'll update the package soon. Thanks for filing the issue.

esamelson commented 7 years ago

Awesome, thank you so much for the quick response. I'll be on the lookout for an update!

hassansin commented 7 years ago

Updated. Let me know how it performs!

esamelson commented 7 years ago

That indeed did the trick - it performs significantly faster now. Thanks very much for your response!!!