mirror of https://github.com/pyodide/pyodide.git
![]() This switches it so that when we call `jsobj.f()` instead of introspecting what operations are possible on `jsobj.f` and creating an appropriate callable `JsProxy` corresponding to the bound method, then calling this bound method, then destroying the `JsProxy`, `_PyObject_GetMethod(jsobj, f_unicode)` will now return a funny temporary object. We always use the same object so that we don't need to allocate or destroy anything, and we know it must be immediately called so we only check if the object is indeed callable. This makes a HUGE difference to the efficiency of calling a method on a JsProxy, reducing the time it takes by about 80%. We assume that the return value of `_PyObject_GetMethod` is only expected to be callable. In practice, it is only ever used once and then destroyed so we use this to allow us to repeatedly reuse the same helper object. |
||
---|---|---|
.. | ||
patches | ||
Makefile | ||
README.md | ||
Setup.local | ||
adjust_sysconfig.py |
README.md
Credits
Based on the hard work of @dgym on cpython-emscripten.