Open lopuhin opened 5 years ago
Yeah, that's slow.. The reason is probably this code: https://github.com/scrapinghub/splash/blob/a1f44885affca5d5460e6c773914a5f4dc2d0e13/splash/jsutils.py#L9
Oh I see, makes sense
I'm not sure what do do about it. Options:
I think option 1 is good, another variant would be adding this to the jsfunc
docs.
It is for jsfunc, evaljs, wait_for_resume, maybe some other functions, so I think FAQ + links from individual functions in Lua API is good
Consider the script
this takes around 0.20 s. If we change the value to
const_value: ['foo'],
then time goes up to 0.25 -- 0.30 s. If we return result as a JSON string instead (commented out) then it takes 0.05 -- 0.07 s in both cases. So it looks like passing a big nested value from JS to the script is quite slow.