Über uns
Für Lynx optimierte JavaScript-Engine
Systeme und InfrastrukturWhat you can do
- Optimized Interpreter: PrimJS introduces a template interpreter leveraging stack caching and register optimizations, significantly enhancing performance.
- Seamless Object Model Integration: The engine's object model integrates efficiently with the Lynx object model, reducing data communication overhead and improving rendering performance.
- Advanced Memory Management: Utilizing a Garbage Collector (GC) instead of QuickJS's Reference Counting, PrimJS offers better performance, improved memory analyzability, and reduced risk of memory leaks.
- Comprehensive Debugging Support: Full implementation of the Chrome DevTools Protocol (CDP) enables seamless integration with Chrome Debugger for enhanced debugging capabilities.
Gemessener Sternzuwachs
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- +2
- in 1 month
- +4
Nettoänderungen in überlappenden Zeiträumen, keine Tagessummen. Fehlende Messwerte bleiben leer. Sterne zeigen Interesse, nicht Qualität.
README.md
OriginalPrimJS is a lightweight, high-performance JavaScript engine designed specifically for the Lynx cross-platform framework. Fully supporting ES2019, PrimJS is built on top of QuickJS and delivers superior performance and a better development experience compared to QuickJS.
Key features include:
- Optimized Interpreter: PrimJS introduces a template interpreter leveraging stack caching and register optimizations, significantly enhancing performance.
- Seamless Object Model Integration: The engine's object model integrates efficiently with the Lynx object model, reducing data communication overhead and improving rendering performance.
- Advanced Memory Management: Utilizing a Garbage Collector (GC) instead of QuickJS's Reference Counting, PrimJS offers better performance, improved memory analyzability, and reduced risk of memory leaks.
- Comprehensive Debugging Support: Full implementation of the Chrome DevTools Protocol (CDP) enables seamless integration with Chrome Debugger for enhanced debugging capabilities.
- WebAssembly Support: Initial WebAssembly support for module loading, instantiation, and basic JavaScript-to-WASM interoperability.
Performance
For detailed performance benchmarks, please refer to performance comparison document. On the Octane Benchmark suite, PrimJS outperforms QuickJS by approximately 56% in overall score (10326 vs 6630) and matches V8 in JIT-less mode (10326 vs 10296). We are continuously working on performance optimizations.
Quick Start
Dependencies
Clone the repository:
git clone [email protected]:lynx-family/primjs.gitInstall dependencies:
cd primjs source tools/envsetup.sh hab sync .
Building on Linux and macOS
PrimJS uses gn and ninja for building. Follow these steps to generate the qjs binary:
gn gen out/Default
ninja -C out/Default qjs_exe
PrimJS snapshot, compatible memory management, and tracing GC are enabled by
default only for arm64 targets with pre-generated embedded.S files. Currently,
these targets are Android, iOS, and macOS. The features remain disabled on Linux,
other platforms without embedded.S, and non-arm64 targets.
To explicitly target arm64 (on macOS, this also enables these features by default):
gn gen out/Default --args='target_cpu="arm64"'
ninja -C out/Default -j32 qjs_exe
Release Build
For a release build, set the is_debug = false argument during configuration.
Regenerating Bytecode Handlers
Pre-generated template interpreter assembly files (embedded*.S) are included in the repository, so building LLVM is not required for normal builds. If you modify bytecode semantics, src/interpreter/primjs/codegen/, or runtime struct layouts, follow Regenerating PrimJS Bytecode Handlers to build the patched LLVM toolchain and update embedded*.S.
Running PrimJS
The primary binary is qjs, located at out/Default/qjs. Use it to run JavaScript files:
./out/Default/qjs test.js
Running Tests
Run the following steps from the root directory to build and execute unit tests:
Build Unit Tests
python3 tools/ci/check_test_build.py
Run Unit Tests
python3 tools/ci/check_test_run.py
How to Contribute
Code of Conduct
We are devoted to ensuring a positive, inclusive, and safe environment for all contributors. Please find our Code of Conduct for detailed information.
Contributing Guide
We welcome you to join and become a member of Lynx Authors. It's people like you that make this project great.
Please refer to lynx contributing guide for details.
Open Source Roadmap
Discussions
Large discussions and proposals are discussed in Github Discussions
License
PrimJS is Apache licensed, as found in the LICENSE file.
Ähnliche Projekte entdecken
Wird geladen…