Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for perf_hooks #87

Open
Shariar076 opened this issue Jul 9, 2023 · 0 comments
Open

Support for perf_hooks #87

Shariar076 opened this issue Jul 9, 2023 · 0 comments

Comments

@Shariar076
Copy link

Shariar076 commented Jul 9, 2023

When I try to use perf_hooks functionality I am getting Error

System:

Python: 3.8.17
NodeJS: 14.17.0
javascript: 1!1.0.2

Code:

from javascript import require


def some_fn(a, b):
    result = a + b

    return result


perf_hooks = require("perf_hooks")
performance = perf_hooks.performance
wrapped = performance.timerify(some_fn)

Error:

[JSE] node[66424]: ../src/node_perf.cc:375:void node::performance::Timerify(const v8::FunctionCallbackInfo<v8::Value>&): Assertion `args[1]->IsNumber()' failed.
[JSE]  1: 0xa222f0 node::Abort() [node]
[JSE]  2: 0xa2236e  [node]
[JSE]  3: 0xa8887a node::performance::Timerify(v8::FunctionCallbackInfo<v8::Value> const&) [node]
[JSE]  4: 0xc03d0b  [node]
[JSE]  5: 0xc052b6  [node]
[JSE]  6: 0xc05936 v8::internal::Builtin_HandleApiCall(int, unsigned long*, v8::internal::Isolate*) [node]
[JSE]  7: 0x1423359  [node]

** The Node process has crashed. Please restart the runtime to use JS APIs. **

Traceback (most recent call last):
  File "event_loop_monitor.py", line 15, in <module>
    wrapped = performance.timerify(some_fn)
  File "/home/himel/Documents/Academic/venv/lib/python3.8/site-packages/javascript/proxy.py", line 213, in __call__
    else self._exe.callProp(
  File "/home/himel/Documents/Academic/venv/lib/python3.8/site-packages/javascript/proxy.py", line 153, in callProp
    resp = self.pcall(ffid, "call", method, args, timeout=timeout, forceRefs=forceRefs)
  File "/home/himel/Documents/Academic/venv/lib/python3.8/site-packages/javascript/proxy.py", line 132, in pcall
    raise Exception(
Exception: Call to 'timerify' timed out. Increase the timeout by setting the `timeout` keyword argument.

I don't have much experience using JS but want to use some of its libraries. Am I doing something wrong?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant