html-entities
html-entities copied to clipboard
JSON.parse may be faster for namedReferences object
Not sure if this still holds up, but in 2019 it was apparently the case that JSON.parse would be faster for objects >10kb in size: https://v8.dev/blog/cost-of-javascript-2019
Hello @mwalkerr. What is the exact problem? What logic in html-entities you are comparing to JSON.parse?
@mdevils I haven't had a problem, I'm just saying that the definition of the named references object may be faster as a JAON.parse rather than an object literal
@mwalkerr sorry for a delay in the response. I've got your point now. I tried it out and got almost no difference (a little bit slower actually). So I'll keep it as is for now.
NP, thank you for checking