html-entities icon indicating copy to clipboard operation
html-entities copied to clipboard

JSON.parse may be faster for namedReferences object

Open mwalkerr opened this issue 3 years ago • 2 comments

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

mwalkerr avatar Jul 10 '22 06:07 mwalkerr

Hello @mwalkerr. What is the exact problem? What logic in html-entities you are comparing to JSON.parse?

mdevils avatar Aug 15 '22 09:08 mdevils

@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 avatar Aug 15 '22 15:08 mwalkerr

@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.

mdevils avatar Jun 05 '23 19:06 mdevils

NP, thank you for checking

mwalkerr avatar Jun 05 '23 19:06 mwalkerr