summaryrefslogtreecommitdiff
path: root/bench_util/js_runtime.rs
AgeCommit message (Collapse)Author
2024-03-05chore: upgrade deno_core (#22699)Bartek Iwańczuk
Co-authored-by: Matt Mastracci <matthew@mastracci.com>
2024-01-01chore: update copyright to 2024 (#21753)David Sherret
2023-12-13refactor(cli): update to new deno_core promise/call methods (#21519)Matt Mastracci
2023-05-04fix(core): allow esm extensions not included in snapshot (#18980)Nayeem Rahman
Fixes #18979. This changes the predicate for allowing `ext:` specifier resolution from `snapshot_loaded_and_not_snapshotting` to `ext_resolution_allowed` which is only set to true during the extension module loading phase. Module loaders as used in core are now declared as `ExtModuleLoader` rather than `dyn ModuleLoader`.
2023-04-04refactor(core): Improve ergonomics of managing ASCII strings (#18498)Matt Mastracci
This is a follow-on to the earlier work in reducing string copies, mainly focused on ensuring that ASCII strings are easy to provide to the JS runtime. While we are replacing a 16-byte reference in a number of places with a 24-byte structure (measured via `std::mem::size_of`), the reduction in copies wins out over the additional size of the arguments passed into functions. Benchmarking shows approximately the same if not slightly less wallclock time/instructions retired, but I believe this continues to open up further refactoring opportunities.
2023-03-21perf(core) Reduce script name and script code copies (#18298)Matt Mastracci
Reduce the number of copies and allocations of script code by carrying around ownership/reference information from creation time. As an advantage, this allows us to maintain the identity of `&'static str`-based scripts and use v8's external 1-byte strings (to avoid incorrectly passing non-ASCII strings, debug `assert!`s gate all string reference paths). Benchmark results: Perf improvements -- ~0.1 - 0.2ms faster, but should reduce garbage w/external strings and reduces data copies overall. May also unlock some more interesting optimizations in the future. This requires adding some generics to functions, but manual monomorphization has been applied (outer/inner function) to avoid code bloat.
2023-03-09refactor(core): remove RuntimeOptions::extensions_with_js (#18099)Bartek Iwańczuk
This commit removes "deno_core::RuntimeOptions::extensions_with_js". Now it's embedders' responsibility to properly register extensions that will not contains JavaScript sources when running from an existing snapshot. Prerequisite for https://github.com/denoland/deno/pull/18080
2023-03-08refactor: rename InternalModuleLoader to ExtModuleLoader, use ext: scheme ↵Bartek Iwańczuk
for snapshotted modules (#18041) This commit renames "deno_core::InternalModuleLoader" to "ExtModuleLoader" and changes the specifiers used by the modules loaded from this loader to "ext:". "internal:" scheme was really ambiguous and it's more characters than "ext:", which should result in slightly smaller snapshot size. Closes https://github.com/denoland/deno/issues/18020
2023-02-23fix(core): remove async op inlining optimization (#17899)Divy Srivastava
Runtime generation of async op wrappers contributed to increased startup time and core became unusable with `--disallow-code-generation-from-strings` flag. The optimization only affects very small microbenchmarks so this revert will not cause any regressions.
2023-02-08refactor: internal runtime code TS support (#17672)Leo Kettmeir
This is a proof of concept for being able to snapshot TypeScript files. Currently only a single runtime file is authored in TypeScript - "runtime/js/01_version.ts". Not needed infrastructure was removed from "core/snapshot_util.rs". --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-02-07refactor: Use ES modules for internal runtime code (#17648)Leo Kettmeir
This PR refactors all internal js files (except core) to be written as ES modules. `__bootstrap`has been mostly replaced with static imports in form in `internal:[path to file from repo root]`. To specify if files are ESM, an `esm` method has been added to `Extension`, similar to the `js` method. A new ModuleLoader called `InternalModuleLoader` has been added to enable the loading of internal specifiers, which is used in all situations except when a snapshot is only loaded, and not a new one is created from it. --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-01-27chore: upgrade to Rust 1.67 (#17548)David Sherret
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-01-02chore: update copyright year to 2023 (#17247)David Sherret
Yearly tradition of creating extra noise in git.
2022-11-27feat(core): support initializing extensions with and without JS (#16789)Bartek Iwańczuk
This commit allows to execute more JS code from extensions when creating a snapshot from an existing snapshot. "deno_core::RuntimeOptions::extensions_with_js" field was added that is used to pass a list of extensions whose both "ops" and associated JS source should be executed upon start. Co-authored-by: crowlkats <crowlkats@toaxl.com>
2022-10-28Reland "perf(core): generate inlined wrappers for async ops" (#16455)Divy Srivastava
Reland https://github.com/denoland/deno/pull/16428
2022-10-27Revert "perf(core): generate inlined wrappers for async ops (#16428)" (#16443)Divy Srivastava
2022-10-27perf(core): generate inlined wrappers for async ops (#16428)Divy Srivastava
V8's JIT can do a better job knowing the argument count and also enable fast call path (in future). This also lets us call async ops without `opAsync`: ```js const { ops } = Deno.core; await ops.op_void_async(); ``` this patch: 4405286 ops/sec main: 3508771 ops/sec
2022-03-24chore: drop src/ in bench_util & serde_v8 (#14097)Aaron O'Mullan
To align with conventions used in our other crates