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

JSC is very slow when using cryptography #130

Open
sirpy opened this issue Jan 12, 2020 · 6 comments
Open

JSC is very slow when using cryptography #130

sirpy opened this issue Jan 12, 2020 · 6 comments

Comments

@sirpy
Copy link

sirpy commented Jan 12, 2020

Question

When using javascript based crypto libraries such as hdkey (uses crypto.createHmac)
performance is very low
generating 10 addresses with hdkey takes about 1.8 seconds with latest JSC. for comparison:
bundled JSC around 4 sec
react-native-v8 without JIT also around 4 sec
ios simulator 100mili
react-native-v8 with JIT 200mili

Maybe the jsc-bundle is not really configured for JIT? any other explanation for the slow runtime on JSC?

@newyankeecodeshop
Copy link

What version of JSC are you using? Some versions of 241213 had JIT completely turned off.

@sirpy
Copy link
Author

sirpy commented Jan 13, 2020

i've tried the packaged version with 0.61 and the latest npm jsc-android
the packaged version is 4 seconds latest npm is 1.8 seconds
where can i see the JIT flag?

@Kudo
Copy link
Member

Kudo commented Jan 14, 2020

JSC has four tiers of JIT executions.
(Reference from https://webkit.org/blog/9329/a-new-bytecode-format-for-javascriptcore/)

  • Low Level Interpreter (LLInt): the start-up interpreter
  • Baseline JIT: a template JIT
  • DFG JIT: a low-latency optimizing compiler
  • FTL JIT: a high-throughput optimizing compiler

For balancing between resource usage and performance, we only enable LLInt and Baseline JIT.
If you would like to check the build flags, here it is

@sirpy
Copy link
Author

sirpy commented Jan 17, 2020

thanks! i'll try these

@khoanguyen-yang
Copy link

Hi @Kudo, @sirpy

So if we want to enable all the JITs, we just simply need to set DENABLE_DFG_JIT=ON and DENABLE_FTL_JIT=ON?

@sirpy
Copy link
Author

sirpy commented Dec 9, 2022

@sirpy I dont recall the results or if I was able to build and use JSC with JIT.
We are still using v8, so I guess it still has the best performance

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

4 participants