Update nanojson
- [x] I carefully read the contribution guidelines and agree to them.
- [x] I have tested the API against NewPipe.
- [x] I agree to create a pull request for NewPipe as soon as possible to make it compatible with the changed API.
Update our fork of nanojson. This includes a few dependency updates as well as smaller improvements from upstream.
I just want to add that the current fork of nanojson uses significantly more CPU than upstream!
In Piped, I'm now using a personal fork since https://github.com/TeamPiped/Piped-Backend/pull/357, the difference is MASSIVE!
I did this after seeing that nanojson was using a lot of CPU in the nextToken method. The NewPipe fork has changes, calling this method more times (for JS parsing?), which could be the cause of this.
I don't have a before screenshot, but here's the after (it was ~1800 seconds before, after 10 minutes of recording/profiling):
After:
nanojson is nowhere close to the top with this!
@FireMasterK If the only difference between this version and your fork is upstream changes, could they not be added to this fork?
@FireMasterK If the only difference between this version and your fork is upstream changes, could they not be added to this fork?
I suppose they could, but I only tested it on YouTube (in Piped), I'm not sure if other services require the JS json extraction. In my fork, I have the upstream changes and have cherry-picked only this commit: https://github.com/TeamNewPipe/nanojson/commit/d5da581ec79e6cc12962da8b92749038143f8e08
Closing in favor of #981. Thanks @FireMasterK for the heads-up!