NewPipeExtractor icon indicating copy to clipboard operation
NewPipeExtractor copied to clipboard

Update nanojson

Open TobiGr opened this issue 4 years ago • 3 comments

  • [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.

TobiGr avatar Jan 02 '22 16:01 TobiGr

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: image nanojson is nowhere close to the top with this!

FireMasterK avatar Sep 05 '22 20:09 FireMasterK

@FireMasterK If the only difference between this version and your fork is upstream changes, could they not be added to this fork?

opusforlife2 avatar Sep 07 '22 20:09 opusforlife2

@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

FireMasterK avatar Sep 07 '22 20:09 FireMasterK

Closing in favor of #981. Thanks @FireMasterK for the heads-up!

Stypox avatar Nov 24 '22 08:11 Stypox