extruct icon indicating copy to clipboard operation
extruct copied to clipboard

JSON-LD: Use UltraJSON if available

Open redapple opened this issue 8 years ago • 1 comments

Motivation: https://github.com/scrapinghub/extruct/issues/37#issuecomment-284255022

redapple avatar Jun 13 '17 09:06 redapple

If you were to use something else than the built-in json for parsing, you'd probably want to also change https://github.com/scrapinghub/extruct/blob/master/extruct/jsonld.py#L38 that uses built-in json behind the scenes.

You could use the comment-removal dispose function from jstyleson directly for that.

Or, use https://pypi.org/project/nojsoncomments/ that uses the exact same logic for comment removal but is over twice as fast. The use case is somewhat marginal of course, so the typical real benefit is not big despite speed increase and it's a Cython extension so someone would have to provide Windows & Linux wheels (I'm on a Mac).

petri avatar Aug 31 '22 20:08 petri