You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To demonstrate this problem, the following code is used:
# saying you have a large html file called "target.html"fromjavascriptimportrequireJSDOM=require("jsdom").JSDOMfilepath="target.html"withopen(filepath,"r") asf:
html=f.read()
dom=JSDOM(html) # the step taking foreverprint("dom loaded?", dom)
I can only get this working by writing this in javascript and read the file in the js script, only return the final result to python.
The text was updated successfully, but these errors were encountered:
James4Ever0
changed the title
calling function with large string parameter blocks forever
Calling function with large string parameter blocks forever
Dec 10, 2022
I believe is for the same reason as #67 (comment) / #103 (comment), just with the opposite direction. JSON serialization isn't suitable to transfer big binary data.
PR #103 proposes a new transfer strategy that would fix the Js -> Py direction. Something similar will be needed for Py -> Js. And I suppose pythonia will be affected as well and equally require a bidirectional fix.
However, note that it will still be more performant to produce data natively in the language where it's needed and avoid transferring big values if you can help it, for even though the transfer can be made much more efficient, it will always add some overhead. This is because Js/Py are separate processes that do not share the same memory, but have to communicate over a pipe instead.
To demonstrate this problem, the following code is used:
I can only get this working by writing this in javascript and read the file in the js script, only return the final result to python.
The text was updated successfully, but these errors were encountered: