Coder Social home page Coder Social logo

openquickjs / quickjs Goto Github PK

View Code? Open in Web Editor NEW
19.0 1.0 2.0 2.44 MB

A community-driven QuickJS fork. Issues and Pull Requests are welcome.

Home Page: https://openquickjs.org

License: Other

JavaScript 6.56% CMake 0.15% C 92.99% Shell 0.03% Rust 0.27%
herm javascript javascript-engine javascript-engines javascriptcore quickjs v8 virtual vm

quickjs's Introduction

QuickJS

A community-driven QuickJS fork.

Optimizations

In addition to the relevant features and optimizations in the TODO file, the more important optimizations are:

  • Column number
  • Basic Debugger API
  • Poly IC
    • Self Poly IC
    • Prototype Poly IC
  • Replace malloc To mimalloc
  • Improve The Performance Of GC

In our plan, we first complete the above optimizations and then gradually add the remaining parts.

Develop

Clone

git clone --recurse-submodules https://github.com/openquickjs/quickjs.git

Install Build Tools

brew install cmake ninja # macOS
sudo apt install cmake ninja-build # Ubuntu

The Windows build environment is not yet officially supported.

Build

bash scripts/build.sh # build quickjs qjs
bash scripts/test.sh # run test262 tests

You can find libquickjs.a in lib folder and qjs / run-test262 in bin folder.

  1. If you're using Visual Studio Code, you can use the CMake Tools extension to build the program.
  2. If you're using CLion, you can open the project directly to build the program.

Using VSCode or CLion for regular development is recommended.

Debug

Install Debug Tools if you need.

brew install lldb # macOS
sudo apt install lldb # Ubuntu

If you're using VSCode, you can use the C/C++ and Code LLDB extension to debug.

Tests

Average memory statistics for 75250 tests:

NAME                    COUNT     SIZE
memory allocated         1011   124975  (123.6 per block)
memory used               967   117030  (0 overhead, 8.2 average slack)
atoms                     532    26858  (50.5 per atom)
objects                   172    12425  (72.2 per object)
properties              876    15798  (5.1 per object)
shapes                   60    13809  (230.2 per shape)
bytecode functions         13     1685
bytecode                 13      931  (71.6 per function)
C functions               100
arrays                      1
fast arrays               1
elements                  1       16  (1.0 per fast array)

Result: 515/75250 errors, 1392 excluded, 7972 skipped, 515 new

Benchmark

  • Apple M1 Pro
  • macOS Monterey 12.2.1
  • Clang 13.0.0 arm64-apple-darwin21.3.0
bellard/quickjs (2788d71) openwebf/quickjs (latest)
Richards 1188 1457
Crypto 1443 1527
RayTrace 744 1995
NavierStokes 2775 2979
DeltaBlue 1100 1595
Total score 1312 1840 (+40.2%)
File Size(KB) 1.3M 1.4M

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.