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

feat(bench-test): Benchmark Testing #2720

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

muhammadahmadasifbhatti

Note: This PR is migrated from the agoric-sdk. All the comments from Mark's reviewed PR are addressed.

Description

This is PR is just a minimalistic POC to create a small tool for the benchmark testing.

How to run locally

Run the command yarn test in the packages/benchmark-test folder.

Pre-reqs of running yarn test

Install esvu globally

Select the v8 and xs from CLI so that it can download the binaries of those engines.

Install eshost-cli globally.

Run the following commands to configure the binaries of engines with eshost.

  • eshost --add "v8" d8 $ESHOST_PATH_V8
  • eshost --add "xs" xs $ESHOST_PATH_XS

Now you are good to go to run yarn test

@muhammadahmadasifbhatti muhammadahmadasifbhatti marked this pull request as ready for review February 13, 2025 07:40
@muhammadahmadasifbhatti
Copy link
Author

Currently, I am working the following changes but planing them for the follow-up PRs.

  • yarn test should run all the files in the /test folder.
  • yarn test filename should run the test from that specific file.
  • See any system level libraries that provide time in ~ns.

}

async function test(name, fn) {
await null;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this await null?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added this line due to our lint checking rules for await safety

cc: @erights

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have an eslint rule enabled that the first await cannot be nested which is why we often need this needless await

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is to enforce that the "synchronous prelude" (a neat concept discovered by @gibson042 ) is statically, not dynamically, distinct from the rest of the code of an asynchronous function. The reason is that the synchronous prelude executes on top of its caller's call stack, so when it hits this first await, it synchronously returns a promise for its eventual outcome to the caller. Everything after the synchronous prelude happens in later turns with an empty call stack above it, i.e., at the bottom of the stack.

Without this rule, whether a particular bit of code in the asynchronous function executes with or without a call stack underneath it would be data dependent, creating a debugging nightmare. If the code is tested under only one of these scenarios, it may fail under the other for reasons that the test author did not anticipate.

The irony for the code in question here is that this rationale does not apply to the test framework code itself, only to the production code being tested. Nevertheless, unless there is a reason not to, it is better to stick with this convention than not. Every line of code we have is implicitly an expository example for the next line of code written by someone else. Best to practice everywhere the habits we want everyone to learn.

@gibson042 , do you know where we've documented the rational for the synchronous prelude and the resulting await safety rule?

@@ -0,0 +1 @@

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add Readme for this package. It can be the details we've added in the description of PR

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure.

Copy link
Contributor

@erights erights left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!!!!

Comment on lines 1 to 151


### [1.1.3](https://github.com/endojs/endo/compare/@endo/[email protected]...@endo/[email protected]) (2024-07-30)

**Note:** Version bump only for package @endo/skel





### [1.1.2](https://github.com/endojs/endo/compare/@endo/[email protected]...@endo/[email protected]) (2024-05-07)

**Note:** Version bump only for package @endo/skel





### [1.1.1](https://github.com/endojs/endo/compare/@endo/[email protected]...@endo/[email protected]) (2024-04-04)

**Note:** Version bump only for package @endo/skel





## [1.1.0](https://github.com/endojs/endo/compare/@endo/[email protected]...@endo/[email protected]) (2024-03-20)


### Features

* **ses-ava:** import test from @endo/ses-ava/prepare-endo.js ([#2133](https://github.com/endojs/endo/issues/2133)) ([9d3a7ce](https://github.com/endojs/endo/commit/9d3a7ce150b6fd6fe7c8c4cc43da411e981731ac))



### [1.0.4](https://github.com/endojs/endo/compare/@endo/[email protected]...@endo/[email protected]) (2024-02-23)

**Note:** Version bump only for package @endo/skel





### [1.0.3](https://github.com/endojs/endo/compare/@endo/[email protected]...@endo/[email protected]) (2024-02-15)


### Bug Fixes

* Add repository directory to all package descriptors ([e5f36e7](https://github.com/endojs/endo/commit/e5f36e7a321c13ee25e74eb74d2a5f3d7517119c))



### [1.0.2](https://github.com/endojs/endo/compare/@endo/[email protected]...@endo/[email protected]) (2024-01-18)

**Note:** Version bump only for package @endo/skel





### [1.0.1](https://github.com/endojs/endo/compare/@endo/[email protected]...@endo/[email protected]) (2023-12-20)

**Note:** Version bump only for package @endo/skel





## [1.0.0](https://github.com/endojs/endo/compare/@endo/[email protected]...@endo/[email protected]) (2023-12-12)


### Bug Fixes

* Adjust type generation in release process and CI ([9465be3](https://github.com/endojs/endo/commit/9465be369e53167815ca444f6293a8e9eb48501d))



### [0.1.3](https://github.com/endojs/endo/compare/@endo/[email protected]...@endo/[email protected]) (2023-09-12)

**Note:** Version bump only for package @endo/skel





### 0.1.2 (2023-08-07)


### Bug Fixes

* Fix scaffold and transforms yarn pack ([42439e7](https://github.com/endojs/endo/commit/42439e7d452e839b9856eac0e852766c237219d0))



### 0.1.1 (2023-08-07)


### Bug Fixes

* Fix scaffold and transforms yarn pack ([42439e7](https://github.com/endojs/endo/commit/42439e7d452e839b9856eac0e852766c237219d0))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Change Log
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
### [1.1.9](https://github.com/endojs/endo/compare/@endo/[email protected]...@endo/[email protected]) (2025-01-24)
**Note:** Version bump only for package @endo/skel
### [1.1.8](https://github.com/endojs/endo/compare/@endo/[email protected]...@endo/[email protected]) (2024-11-13)
**Note:** Version bump only for package @endo/skel
### [1.1.7](https://github.com/endojs/endo/compare/@endo/[email protected]...@endo/[email protected]) (2024-10-22)
**Note:** Version bump only for package @endo/skel
### [1.1.6](https://github.com/endojs/endo/compare/@endo/[email protected]...@endo/[email protected]) (2024-10-10)
**Note:** Version bump only for package @endo/skel
### [1.1.5](https://github.com/endojs/endo/compare/@endo/[email protected]...@endo/[email protected]) (2024-08-27)
**Note:** Version bump only for package @endo/skel
### [1.1.4](https://github.com/endojs/endo/compare/@endo/[email protected]...@endo/[email protected]) (2024-08-01)
**Note:** Version bump only for package @endo/skel
### [1.1.3](https://github.com/endojs/endo/compare/@endo/[email protected]...@endo/[email protected]) (2024-07-30)
**Note:** Version bump only for package @endo/skel
### [1.1.2](https://github.com/endojs/endo/compare/@endo/[email protected]...@endo/[email protected]) (2024-05-07)
**Note:** Version bump only for package @endo/skel
### [1.1.1](https://github.com/endojs/endo/compare/@endo/[email protected]...@endo/[email protected]) (2024-04-04)
**Note:** Version bump only for package @endo/skel
## [1.1.0](https://github.com/endojs/endo/compare/@endo/[email protected]...@endo/[email protected]) (2024-03-20)
### Features
* **ses-ava:** import test from @endo/ses-ava/prepare-endo.js ([#2133](https://github.com/endojs/endo/issues/2133)) ([9d3a7ce](https://github.com/endojs/endo/commit/9d3a7ce150b6fd6fe7c8c4cc43da411e981731ac))
### [1.0.4](https://github.com/endojs/endo/compare/@endo/[email protected]...@endo/[email protected]) (2024-02-23)
**Note:** Version bump only for package @endo/skel
### [1.0.3](https://github.com/endojs/endo/compare/@endo/[email protected]...@endo/[email protected]) (2024-02-15)
### Bug Fixes
* Add repository directory to all package descriptors ([e5f36e7](https://github.com/endojs/endo/commit/e5f36e7a321c13ee25e74eb74d2a5f3d7517119c))
### [1.0.2](https://github.com/endojs/endo/compare/@endo/[email protected]...@endo/[email protected]) (2024-01-18)
**Note:** Version bump only for package @endo/skel
### [1.0.1](https://github.com/endojs/endo/compare/@endo/[email protected]...@endo/[email protected]) (2023-12-20)
**Note:** Version bump only for package @endo/skel
## [1.0.0](https://github.com/endojs/endo/compare/@endo/[email protected]...@endo/[email protected]) (2023-12-12)
### Bug Fixes
* Adjust type generation in release process and CI ([9465be3](https://github.com/endojs/endo/commit/9465be369e53167815ca444f6293a8e9eb48501d))
### [0.1.3](https://github.com/endojs/endo/compare/@endo/[email protected]...@endo/[email protected]) (2023-09-12)
**Note:** Version bump only for package @endo/skel
### 0.1.2 (2023-08-07)
### Bug Fixes
* Fix scaffold and transforms yarn pack ([42439e7](https://github.com/endojs/endo/commit/42439e7d452e839b9856eac0e852766c237219d0))
### 0.1.1 (2023-08-07)
### Bug Fixes
* Fix scaffold and transforms yarn pack ([42439e7](https://github.com/endojs/endo/commit/42439e7d452e839b9856eac0e852766c237219d0))

The initial contents of this file as made by the create-package.js script should be empty. The junk above is due to #2697 . This junk should all be deleted before this PR is merged. Attn @kriskowal

@@ -0,0 +1 @@
{"nodes":[{"id":1,"callFrame":{"functionName":"(root)","scriptId":"0","url":"","lineNumber":-1,"columnNumber":-1},"hitCount":0,"children":[2,3,56,66,67,69,70,83,88,108]},{"id":2,"callFrame":{"functionName":"(program)","scriptId":"0","url":"","lineNumber":-1,"columnNumber":-1},"hitCount":2},{"id":3,"callFrame":{"functionName":"","scriptId":"446","url":"node:internal/main/run_main_module","lineNumber":0,"columnNumber":0},"hitCount":0,"children":[4,6,49]},{"id":4,"callFrame":{"functionName":"requireBuiltin","scriptId":"15","url":"node:internal/bootstrap/loaders","lineNumber":356,"columnNumber":23},"hitCount":0,"children":[5]},{"id":5,"callFrame":{"functionName":"compileForInternalLoader","scriptId":"15","url":"node:internal/bootstrap/loaders","lineNumber":319,"columnNumber":26},"hitCount":1,"positionTicks":[{"line":332,"ticks":1}]},{"id":6,"callFrame":{"functionName":"prepareMainThreadExecution","scriptId":"447","url":"node:internal/process/pre_execution","lineNumber":38,"columnNumber":35},"hitCount":0,"children":[7]},{"id":7,"callFrame":{"functionName":"prepareExecution","scriptId":"447","url":"node:internal/process/pre_execution","lineNumber":54,"columnNumber":25},"hitCount":0,"children":[8,10,11,17]},{"id":8,"callFrame":{"functionName":"patchProcessObject","scriptId":"447","url":"node:internal/process/pre_execution","lineNumber":138,"columnNumber":27},"hitCount":0,"children":[9]},{"id":9,"callFrame":{"functionName":"resolve","scriptId":"74","url":"node:path","lineNumber":1090,"columnNumber":9},"hitCount":1,"positionTicks":[{"line":1097,"ticks":1}]},{"id":10,"callFrame":{"functionName":"setupFetch","scriptId":"447","url":"node:internal/process/pre_execution","lineNumber":224,"columnNumber":19},"hitCount":1,"positionTicks":[{"line":226,"ticks":1}]},{"id":11,"callFrame":{"functionName":"initializeSourceMapsHandlers","scriptId":"447","url":"node:internal/process/pre_execution","lineNumber":585,"columnNumber":37},"hitCount":0,"children":[12]},{"id":12,"callFrame":{"functionName":"requireBuiltin","scriptId":"15","url":"node:internal/bootstrap/loaders","lineNumber":356,"columnNumber":23},"hitCount":0,"children":[13]},{"id":13,"callFrame":{"functionName":"compileForInternalLoader","scriptId":"15","url":"node:internal/bootstrap/loaders","lineNumber":319,"columnNumber":26},"hitCount":0,"children":[14]},{"id":14,"callFrame":{"functionName":"","scriptId":"451","url":"node:internal/source_map/source_map_cache","lineNumber":0,"columnNumber":0},"hitCount":0,"children":[15]},{"id":15,"callFrame":{"functionName":"requireBuiltin","scriptId":"15","url":"node:internal/bootstrap/loaders","lineNumber":356,"columnNumber":23},"hitCount":0,"children":[16]},{"id":16,"callFrame":{"functionName":"compileForInternalLoader","scriptId":"15","url":"node:internal/bootstrap/loaders","lineNumber":319,"columnNumber":26},"hitCount":1,"positionTicks":[{"line":332,"ticks":1}]},{"id":17,"callFrame":{"functionName":"setupUserModules","scriptId":"447","url":"node:internal/process/pre_execution","lineNumber":124,"columnNumber":25},"hitCount":0,"children":[18]},{"id":18,"callFrame":{"functionName":"initializeCJSLoader","scriptId":"447","url":"node:internal/process/pre_execution","lineNumber":546,"columnNumber":28},"hitCount":0,"children":[19]},{"id":19,"callFrame":{"functionName":"requireBuiltin","scriptId":"15","url":"node:internal/bootstrap/loaders","lineNumber":356,"columnNumber":23},"hitCount":0,"children":[20]},{"id":20,"callFrame":{"functionName":"compileForInternalLoader","scriptId":"15","url":"node:internal/bootstrap/loaders","lineNumber":319,"columnNumber":26},"hitCount":1,"children":[21],"positionTicks":[{"line":332,"ticks":1}]},{"id":21,"callFrame":{"functionName":"","scriptId":"456","url":"node:internal/modules/cjs/loader","lineNumber":0,"columnNumber":0},"hitCount":0,"children":[22]},{"id":22,"callFrame":{"functionName":"requireBuiltin","scriptId":"15","url":"node:internal/bootstrap/loaders","lineNumber":356,"columnNumber":23},"hitCount":0,"children":[23]},{"id":23,"callFrame":{"functionName":"compileForInternalLoader","scriptId":"15","url":"node:internal/bootstrap/loaders","lineNumber":319,"columnNumber":26},"hitCount":0,"children":[24]},{"id":24,"callFrame":{"functionName":"","scriptId":"458","url":"node:internal/process/esm_loader","lineNumber":0,"columnNumber":0},"hitCount":1,"children":[25],"positionTicks":[{"line":43,"ticks":1}]},{"id":25,"callFrame":{"functionName":"requireBuiltin","scriptId":"15","url":"node:internal/bootstrap/loaders","lineNumber":356,"columnNumber":23},"hitCount":0,"children":[26]},{"id":26,"callFrame":{"functionName":"compileForInternalLoader","scriptId":"15","url":"node:internal/bootstrap/loaders","lineNumber":319,"columnNumber":26},"hitCount":0,"children":[27]},{"id":27,"callFrame":{"functionName":"","scriptId":"459","url":"node:internal/modules/esm/loader","lineNumber":0,"columnNumber":0},"hitCount":0,"children":[28]},{"id":28,"callFrame":{"functionName":"requireBuiltin","scriptId":"15","url":"node:internal/bootstrap/loaders","lineNumber":356,"columnNumber":23},"hitCount":0,"children":[29]},{"id":29,"callFrame":{"functionName":"compileForInternalLoader","scriptId":"15","url":"node:internal/bootstrap/loaders","lineNumber":319,"columnNumber":26},"hitCount":0,"children":[30,33,43]},{"id":30,"callFrame":{"functionName":"","scriptId":"460","url":"node:internal/modules/esm/module_map","lineNumber":0,"columnNumber":0},"hitCount":0,"children":[31]},{"id":31,"callFrame":{"functionName":"requireBuiltin","scriptId":"15","url":"node:internal/bootstrap/loaders","lineNumber":356,"columnNumber":23},"hitCount":0,"children":[32]},{"id":32,"callFrame":{"functionName":"compileForInternalLoader","scriptId":"15","url":"node:internal/bootstrap/loaders","lineNumber":319,"columnNumber":26},"hitCount":1,"positionTicks":[{"line":335,"ticks":1}]},{"id":33,"callFrame":{"functionName":"","scriptId":"463","url":"node:internal/modules/esm/resolve","lineNumber":0,"columnNumber":0},"hitCount":0,"children":[34]},{"id":34,"callFrame":{"functionName":"requireBuiltin","scriptId":"15","url":"node:internal/bootstrap/loaders","lineNumber":356,"columnNumber":23},"hitCount":0,"children":[35]},{"id":35,"callFrame":{"functionName":"compileForInternalLoader","scriptId":"15","url":"node:internal/bootstrap/loaders","lineNumber":319,"columnNumber":26},"hitCount":0,"children":[36]},{"id":36,"callFrame":{"functionName":"","scriptId":"465","url":"node:internal/modules/esm/get_format","lineNumber":0,"columnNumber":0},"hitCount":0,"children":[37]},{"id":37,"callFrame":{"functionName":"requireBuiltin","scriptId":"15","url":"node:internal/bootstrap/loaders","lineNumber":356,"columnNumber":23},"hitCount":0,"children":[38]},{"id":38,"callFrame":{"functionName":"compileForInternalLoader","scriptId":"15","url":"node:internal/bootstrap/loaders","lineNumber":319,"columnNumber":26},"hitCount":0,"children":[39]},{"id":39,"callFrame":{"functionName":"","scriptId":"466","url":"node:internal/modules/esm/fetch_module","lineNumber":0,"columnNumber":0},"hitCount":0,"children":[40,42]},{"id":40,"callFrame":{"functionName":"requireBuiltin","scriptId":"15","url":"node:internal/bootstrap/loaders","lineNumber":356,"columnNumber":23},"hitCount":0,"children":[41]},{"id":41,"callFrame":{"functionName":"compileForInternalLoader","scriptId":"15","url":"node:internal/bootstrap/loaders","lineNumber":319,"columnNumber":26},"hitCount":1,"positionTicks":[{"line":332,"ticks":1}]},{"id":42,"callFrame":{"functionName":"addAddress","scriptId":"469","url":"node:internal/blocklist","lineNumber":59,"columnNumber":12},"hitCount":1,"positionTicks":[{"line":66,"ticks":1}]},{"id":43,"callFrame":{"functionName":"","scriptId":"473","url":"node:internal/modules/esm/load","lineNumber":0,"columnNumber":0},"hitCount":0,"children":[44]},{"id":44,"callFrame":{"functionName":"requireBuiltin","scriptId":"15","url":"node:internal/bootstrap/loaders","lineNumber":356,"columnNumber":23},"hitCount":0,"children":[45]},{"id":45,"callFrame":{"functionName":"compileForInternalLoader","scriptId":"15","url":"node:internal/bootstrap/loaders","lineNumber":319,"columnNumber":26},"hitCount":0,"children":[46]},{"id":46,"callFrame":{"functionName":"","scriptId":"474","url":"node:internal/fs/promises","lineNumber":0,"columnNumber":0},"hitCount":0,"children":[47]},{"id":47,"callFrame":{"functionName":"requireBuiltin","scriptId":"15","url":"node:internal/bootstrap/loaders","lineNumber":356,"columnNumber":23},"hitCount":0,"children":[48]},{"id":48,"callFrame":{"functionName":"compileForInternalLoader","scriptId":"15","url":"node:internal/bootstrap/loaders","lineNumber":319,"columnNumber":26},"hitCount":1,"positionTicks":[{"line":332,"ticks":1}]},{"id":49,"callFrame":{"functionName":"executeUserEntryPoint","scriptId":"482","url":"node:internal/modules/run_main","lineNumber":78,"columnNumber":30},"hitCount":0,"children":[50]},{"id":50,"callFrame":{"functionName":"resolveMainPath","scriptId":"482","url":"node:internal/modules/run_main","lineNumber":14,"columnNumber":24},"hitCount":0,"children":[51]},{"id":51,"callFrame":{"functionName":"Module._findPath","scriptId":"456","url":"node:internal/modules/cjs/loader","lineNumber":583,"columnNumber":27},"hitCount":0,"children":[52]},{"id":52,"callFrame":{"functionName":"toRealPath","scriptId":"456","url":"node:internal/modules/cjs/loader","lineNumber":477,"columnNumber":19},"hitCount":0,"children":[53]},{"id":53,"callFrame":{"functionName":"realpathSync","scriptId":"76","url":"node:fs","lineNumber":2576,"columnNumber":21},"hitCount":0,"children":[54]},{"id":54,"callFrame":{"functionName":"","scriptId":"80","url":"node:internal/fs/utils","lineNumber":693,"columnNumber":37},"hitCount":0,"children":[55]},{"id":55,"callFrame":{"functionName":"","scriptId":"80","url":"node:internal/fs/utils","lineNumber":362,"columnNumber":34},"hitCount":1,"positionTicks":[{"line":369,"ticks":1}]},{"id":56,"callFrame":{"functionName":"loadESM","scriptId":"458","url":"node:internal/process/esm_loader","lineNumber":98,"columnNumber":40},"hitCount":0,"children":[57]},{"id":57,"callFrame":{"functionName":"","scriptId":"482","url":"node:internal/modules/run_main","lineNumber":59,"columnNumber":28},"hitCount":0,"children":[58]},{"id":58,"callFrame":{"functionName":"import","scriptId":"459","url":"node:internal/modules/esm/loader","lineNumber":507,"columnNumber":14},"hitCount":0,"children":[59]},{"id":59,"callFrame":{"functionName":"getModuleJob","scriptId":"459","url":"node:internal/modules/esm/loader","lineNumber":409,"columnNumber":20},"hitCount":0,"children":[60]},{"id":60,"callFrame":{"functionName":"resolve","scriptId":"459","url":"node:internal/modules/esm/loader","lineNumber":785,"columnNumber":15},"hitCount":0,"children":[61]},{"id":61,"callFrame":{"functionName":"ObjectDefineProperty.__proto__","scriptId":"459","url":"node:internal/modules/esm/loader","lineNumber":147,"columnNumber":4},"hitCount":0,"children":[62]},{"id":62,"callFrame":{"functionName":"defaultResolve","scriptId":"463","url":"node:internal/modules/esm/resolve","lineNumber":1040,"columnNumber":29},"hitCount":0,"children":[63,64]},{"id":63,"callFrame":{"functionName":"shouldBeTreatedAsRelativeOrAbsolutePath","scriptId":"463","url":"node:internal/modules/esm/resolve","lineNumber":910,"columnNumber":48},"hitCount":1,"positionTicks":[{"line":914,"ticks":1}]},{"id":64,"callFrame":{"functionName":"defaultGetFormatWithoutErrors","scriptId":"465","url":"node:internal/modules/esm/get_format","lineNumber":105,"columnNumber":38},"hitCount":0,"children":[65]},{"id":65,"callFrame":{"functionName":"getFileProtocolModuleFormat","scriptId":"465","url":"node:internal/modules/esm/get_format","lineNumber":53,"columnNumber":36},"hitCount":1,"positionTicks":[{"line":56,"ticks":1}]},{"id":66,"callFrame":{"functionName":"(idle)","scriptId":"0","url":"","lineNumber":-1,"columnNumber":-1},"hitCount":1},{"id":67,"callFrame":{"functionName":"moduleProvider","scriptId":"459","url":"node:internal/modules/esm/loader","lineNumber":451,"columnNumber":27},"hitCount":0,"children":[68]},{"id":68,"callFrame":{"functionName":"moduleStrategy","scriptId":"479","url":"node:internal/modules/esm/translators","lineNumber":113,"columnNumber":55},"hitCount":2,"positionTicks":[{"line":119,"ticks":2}]},{"id":69,"callFrame":{"functionName":"_instantiate","scriptId":"461","url":"node:internal/modules/esm/module_job","lineNumber":105,"columnNumber":20},"hitCount":1,"positionTicks":[{"line":124,"ticks":1}]},{"id":70,"callFrame":{"functionName":"run","scriptId":"461","url":"node:internal/modules/esm/module_job","lineNumber":188,"columnNumber":11},"hitCount":0,"children":[71]},{"id":71,"callFrame":{"functionName":"","scriptId":"483","url":"file:///Users/muhammadahmad/Desktop/agoric-repos/endo/packages/benchmark/dist/bundle.js","lineNumber":0,"columnNumber":0},"hitCount":0,"children":[72]},{"id":72,"callFrame":{"functionName":"","scriptId":"483","url":"file:///Users/muhammadahmad/Desktop/agoric-repos/endo/packages/benchmark/dist/bundle.js","lineNumber":0,"columnNumber":10},"hitCount":0,"children":[73,78]},{"id":73,"callFrame":{"functionName":"getGlobalIntrinsics","scriptId":"483","url":"file:///Users/muhammadahmad/Desktop/agoric-repos/endo/packages/benchmark/dist/bundle.js","lineNumber":3642,"columnNumber":30},"hitCount":0,"children":[74]},{"id":74,"callFrame":{"functionName":"addIntrinsics","scriptId":"483","url":"file:///Users/muhammadahmad/Desktop/agoric-repos/endo/packages/benchmark/dist/bundle.js","lineNumber":3544,"columnNumber":26},"hitCount":0,"children":[75]},{"id":75,"callFrame":{"functionName":"initProperties","scriptId":"483","url":"file:///Users/muhammadahmad/Desktop/agoric-repos/endo/packages/benchmark/dist/bundle.js","lineNumber":3517,"columnNumber":25},"hitCount":0,"children":[76]},{"id":76,"callFrame":{"functionName":"initProperty","scriptId":"483","url":"file:///Users/muhammadahmad/Desktop/agoric-repos/endo/packages/benchmark/dist/bundle.js","lineNumber":3496,"columnNumber":23},"hitCount":0,"children":[77]},{"id":77,"callFrame":{"functionName":"defineProperty","scriptId":"483","url":"file:///Users/muhammadahmad/Desktop/agoric-repos/endo/packages/benchmark/dist/bundle.js","lineNumber":94,"columnNumber":25},"hitCount":1,"positionTicks":[{"line":104,"ticks":1}]},{"id":78,"callFrame":{"functionName":"lockdown$1","scriptId":"483","url":"file:///Users/muhammadahmad/Desktop/agoric-repos/endo/packages/benchmark/dist/bundle.js","lineNumber":10453,"columnNumber":21},"hitCount":0,"children":[79]},{"id":79,"callFrame":{"functionName":"universalThis.lockdown","scriptId":"483","url":"file:///Users/muhammadahmad/Desktop/agoric-repos/endo/packages/benchmark/dist/bundle.js","lineNumber":10341,"columnNumber":27},"hitCount":0,"children":[80,84]},{"id":80,"callFrame":{"functionName":"repairIntrinsics","scriptId":"483","url":"file:///Users/muhammadahmad/Desktop/agoric-repos/endo/packages/benchmark/dist/bundle.js","lineNumber":9974,"columnNumber":27},"hitCount":0,"children":[81]},{"id":81,"callFrame":{"functionName":"shimArrayBufferTransfer","scriptId":"483","url":"file:///Users/muhammadahmad/Desktop/agoric-repos/endo/packages/benchmark/dist/bundle.js","lineNumber":9703,"columnNumber":34},"hitCount":0,"children":[82]},{"id":82,"callFrame":{"functionName":"defineProperty","scriptId":"483","url":"file:///Users/muhammadahmad/Desktop/agoric-repos/endo/packages/benchmark/dist/bundle.js","lineNumber":94,"columnNumber":25},"hitCount":1,"positionTicks":[{"line":104,"ticks":1}]},{"id":84,"callFrame":{"functionName":"hardenIntrinsics","scriptId":"483","url":"file:///Users/muhammadahmad/Desktop/agoric-repos/endo/packages/benchmark/dist/bundle.js","lineNumber":10271,"columnNumber":29},"hitCount":0,"children":[85]},{"id":85,"callFrame":{"functionName":"harden","scriptId":"483","url":"file:///Users/muhammadahmad/Desktop/agoric-repos/endo/packages/benchmark/dist/bundle.js","lineNumber":1586,"columnNumber":12},"hitCount":0,"children":[86]},{"id":86,"callFrame":{"functionName":"dequeue","scriptId":"483","url":"file:///Users/muhammadahmad/Desktop/agoric-repos/endo/packages/benchmark/dist/bundle.js","lineNumber":1692,"columnNumber":24},"hitCount":0,"children":[87]},{"id":87,"callFrame":{"functionName":"baseFreezeAndTraverse","scriptId":"483","url":"file:///Users/muhammadahmad/Desktop/agoric-repos/endo/packages/benchmark/dist/bundle.js","lineNumber":1615,"columnNumber":38},"hitCount":1,"positionTicks":[{"line":1635,"ticks":1}]},{"id":83,"callFrame":{"functionName":"(garbage collector)","scriptId":"0","url":"","lineNumber":-1,"columnNumber":-1},"hitCount":8},{"id":88,"callFrame":{"functionName":"test","scriptId":"483","url":"file:///Users/muhammadahmad/Desktop/agoric-repos/endo/packages/benchmark/dist/bundle.js","lineNumber":14820,"columnNumber":21},"hitCount":0,"children":[89]},{"id":89,"callFrame":{"functionName":"","scriptId":"483","url":"file:///Users/muhammadahmad/Desktop/agoric-repos/endo/packages/benchmark/dist/bundle.js","lineNumber":6318,"columnNumber":44},"hitCount":1,"children":[90],"positionTicks":[{"line":6321,"ticks":1}]},{"id":90,"callFrame":{"functionName":"consoleCall","scriptId":"0","url":"","lineNumber":-1,"columnNumber":-1},"hitCount":0,"children":[91]},{"id":91,"callFrame":{"functionName":"log","scriptId":"111","url":"node:internal/console/constructor","lineNumber":378,"columnNumber":5},"hitCount":0,"children":[92]},{"id":92,"callFrame":{"functionName":"value","scriptId":"111","url":"node:internal/console/constructor","lineNumber":339,"columnNumber":19},"hitCount":0,"children":[93,99]},{"id":93,"callFrame":{"functionName":"get","scriptId":"111","url":"node:internal/console/constructor","lineNumber":213,"columnNumber":13},"hitCount":0,"children":[94]},{"id":94,"callFrame":{"functionName":"getStdout","scriptId":"132","url":"node:internal/bootstrap/switches/is_main_thread","lineNumber":145,"columnNumber":18},"hitCount":0,"children":[95]},{"id":95,"callFrame":{"functionName":"createWritableStdioStream","scriptId":"132","url":"node:internal/bootstrap/switches/is_main_thread","lineNumber":44,"columnNumber":34},"hitCount":0,"children":[96]},{"id":96,"callFrame":{"functionName":"WriteStream","scriptId":"491","url":"node:tty","lineNumber":83,"columnNumber":20},"hitCount":1,"children":[97],"positionTicks":[{"line":91,"ticks":1}]},{"id":97,"callFrame":{"functionName":"Socket","scriptId":"467","url":"node:net","lineNumber":365,"columnNumber":15},"hitCount":0,"children":[98]},{"id":98,"callFrame":{"functionName":"initSocketHandle","scriptId":"467","url":"node:net","lineNumber":321,"columnNumber":25},"hitCount":1,"positionTicks":[{"line":328,"ticks":1}]},{"id":99,"callFrame":{"functionName":"value","scriptId":"111","url":"node:internal/console/constructor","lineNumber":319,"columnNumber":19},"hitCount":0,"children":[100]},{"id":100,"callFrame":{"functionName":"lazyUtilColors","scriptId":"111","url":"node:internal/console/constructor","lineNumber":83,"columnNumber":23},"hitCount":0,"children":[101]},{"id":101,"callFrame":{"functionName":"requireBuiltin","scriptId":"15","url":"node:internal/bootstrap/loaders","lineNumber":356,"columnNumber":23},"hitCount":0,"children":[102]},{"id":102,"callFrame":{"functionName":"compileForInternalLoader","scriptId":"15","url":"node:internal/bootstrap/loaders","lineNumber":319,"columnNumber":26},"hitCount":0,"children":[103]},{"id":103,"callFrame":{"functionName":"","scriptId":"493","url":"node:internal/util/colors","lineNumber":0,"columnNumber":0},"hitCount":0,"children":[104]},{"id":104,"callFrame":{"functionName":"refresh","scriptId":"493","url":"node:internal/util/colors","lineNumber":24,"columnNumber":9},"hitCount":0,"children":[105]},{"id":105,"callFrame":{"functionName":"getStderr","scriptId":"132","url":"node:internal/bootstrap/switches/is_main_thread","lineNumber":167,"columnNumber":18},"hitCount":0,"children":[106]},{"id":106,"callFrame":{"functionName":"createWritableStdioStream","scriptId":"132","url":"node:internal/bootstrap/switches/is_main_thread","lineNumber":44,"columnNumber":34},"hitCount":0,"children":[107]},{"id":107,"callFrame":{"functionName":"WriteStream","scriptId":"491","url":"node:tty","lineNumber":83,"columnNumber":20},"hitCount":1,"positionTicks":[{"line":98,"ticks":1}]},{"id":108,"callFrame":{"functionName":"benchmark","scriptId":"483","url":"file:///Users/muhammadahmad/Desktop/agoric-repos/endo/packages/benchmark/dist/bundle.js","lineNumber":14804,"columnNumber":26},"hitCount":2,"children":[109,120,132],"positionTicks":[{"line":14808,"ticks":2}]},{"id":109,"callFrame":{"functionName":"","scriptId":"483","url":"file:///Users/muhammadahmad/Desktop/agoric-repos/endo/packages/benchmark/dist/bundle.js","lineNumber":14844,"columnNumber":8},"hitCount":3,"children":[110,113],"positionTicks":[{"line":14846,"ticks":3}]},{"id":110,"callFrame":{"functionName":"passStyleOf","scriptId":"483","url":"file:///Users/muhammadahmad/Desktop/agoric-repos/endo/packages/benchmark/dist/bundle.js","lineNumber":13820,"columnNumber":24},"hitCount":0,"children":[111]},{"id":111,"callFrame":{"functionName":"passStyleOfRecur","scriptId":"483","url":"file:///Users/muhammadahmad/Desktop/agoric-repos/endo/packages/benchmark/dist/bundle.js","lineNumber":13826,"columnNumber":31},"hitCount":0,"children":[112]},{"id":112,"callFrame":{"functionName":"passStyleOfInternal","scriptId":"483","url":"file:///Users/muhammadahmad/Desktop/agoric-repos/endo/packages/benchmark/dist/bundle.js","lineNumber":13846,"columnNumber":34},"hitCount":2,"children":[116],"positionTicks":[{"line":13893,"ticks":1},{"line":13877,"ticks":1}]},{"id":116,"callFrame":{"functionName":"canBeValid","scriptId":"483","url":"file:///Users/muhammadahmad/Desktop/agoric-repos/endo/packages/benchmark/dist/bundle.js","lineNumber":13521,"columnNumber":16},"hitCount":1,"positionTicks":[{"line":13527,"ticks":1}]},{"id":113,"callFrame":{"functionName":"harden","scriptId":"483","url":"file:///Users/muhammadahmad/Desktop/agoric-repos/endo/packages/benchmark/dist/bundle.js","lineNumber":1586,"columnNumber":12},"hitCount":0,"children":[114,117,118]},{"id":114,"callFrame":{"functionName":"dequeue","scriptId":"483","url":"file:///Users/muhammadahmad/Desktop/agoric-repos/endo/packages/benchmark/dist/bundle.js","lineNumber":1692,"columnNumber":24},"hitCount":0,"children":[115]},{"id":115,"callFrame":{"functionName":"baseFreezeAndTraverse","scriptId":"483","url":"file:///Users/muhammadahmad/Desktop/agoric-repos/endo/packages/benchmark/dist/bundle.js","lineNumber":1615,"columnNumber":38},"hitCount":2,"positionTicks":[{"line":1628,"ticks":1},{"line":1635,"ticks":1}]},{"id":117,"callFrame":{"functionName":"enqueue","scriptId":"483","url":"file:///Users/muhammadahmad/Desktop/agoric-repos/endo/packages/benchmark/dist/bundle.js","lineNumber":1594,"columnNumber":24},"hitCount":1,"positionTicks":[{"line":1610,"ticks":1}]},{"id":118,"callFrame":{"functionName":"commit","scriptId":"483","url":"file:///Users/muhammadahmad/Desktop/agoric-repos/endo/packages/benchmark/dist/bundle.js","lineNumber":1702,"columnNumber":23},"hitCount":0,"children":[119]},{"id":119,"callFrame":{"functionName":"markHardened","scriptId":"483","url":"file:///Users/muhammadahmad/Desktop/agoric-repos/endo/packages/benchmark/dist/bundle.js","lineNumber":1698,"columnNumber":29},"hitCount":1,"positionTicks":[{"line":1700,"ticks":1}]},{"id":120,"callFrame":{"functionName":"","scriptId":"483","url":"file:///Users/muhammadahmad/Desktop/agoric-repos/endo/packages/benchmark/dist/bundle.js","lineNumber":6318,"columnNumber":44},"hitCount":0,"children":[121]},{"id":121,"callFrame":{"functionName":"consoleCall","scriptId":"0","url":"","lineNumber":-1,"columnNumber":-1},"hitCount":0,"children":[122]},{"id":122,"callFrame":{"functionName":"log","scriptId":"111","url":"node:internal/console/constructor","lineNumber":378,"columnNumber":5},"hitCount":0,"children":[123]},{"id":123,"callFrame":{"functionName":"value","scriptId":"111","url":"node:internal/console/constructor","lineNumber":276,"columnNumber":19},"hitCount":0,"children":[124]},{"id":124,"callFrame":{"functionName":"Writable.write","scriptId":"68","url":"node:internal/streams/writable","lineNumber":335,"columnNumber":35},"hitCount":0,"children":[125]},{"id":125,"callFrame":{"functionName":"_write","scriptId":"68","url":"node:internal/streams/writable","lineNumber":285,"columnNumber":15},"hitCount":0,"children":[126]},{"id":126,"callFrame":{"functionName":"writeOrBuffer","scriptId":"68","url":"node:internal/streams/writable","lineNumber":367,"columnNumber":22},"hitCount":0,"children":[127]},{"id":127,"callFrame":{"functionName":"Socket._write","scriptId":"467","url":"node:net","lineNumber":972,"columnNumber":34},"hitCount":0,"children":[128]},{"id":128,"callFrame":{"functionName":"Socket._writeGeneric","scriptId":"467","url":"node:net","lineNumber":930,"columnNumber":41},"hitCount":0,"children":[129]},{"id":129,"callFrame":{"functionName":"writeGeneric","scriptId":"87","url":"node:internal/stream_base_commons","lineNumber":146,"columnNumber":21},"hitCount":0,"children":[130]},{"id":130,"callFrame":{"functionName":"handleWriteReq","scriptId":"87","url":"node:internal/stream_base_commons","lineNumber":44,"columnNumber":23},"hitCount":0,"children":[131]},{"id":131,"callFrame":{"functionName":"writeUtf8String","scriptId":"0","url":"","lineNumber":-1,"columnNumber":-1},"hitCount":1,"positionTicks":[{"line":61,"ticks":1}]},{"id":132,"callFrame":{"functionName":"","scriptId":"483","url":"file:///Users/muhammadahmad/Desktop/agoric-repos/endo/packages/benchmark/dist/bundle.js","lineNumber":14855,"columnNumber":8},"hitCount":0,"children":[133,137]},{"id":133,"callFrame":{"functionName":"passStyleOf","scriptId":"483","url":"file:///Users/muhammadahmad/Desktop/agoric-repos/endo/packages/benchmark/dist/bundle.js","lineNumber":13820,"columnNumber":24},"hitCount":0,"children":[134]},{"id":134,"callFrame":{"functionName":"passStyleOfRecur","scriptId":"483","url":"file:///Users/muhammadahmad/Desktop/agoric-repos/endo/packages/benchmark/dist/bundle.js","lineNumber":13826,"columnNumber":31},"hitCount":2,"children":[135],"positionTicks":[{"line":13839,"ticks":2}]},{"id":135,"callFrame":{"functionName":"passStyleOfInternal","scriptId":"483","url":"file:///Users/muhammadahmad/Desktop/agoric-repos/endo/packages/benchmark/dist/bundle.js","lineNumber":13846,"columnNumber":34},"hitCount":13,"children":[136,140],"positionTicks":[{"line":13894,"ticks":13}]},{"id":136,"callFrame":{"functionName":"assertValid","scriptId":"483","url":"file:///Users/muhammadahmad/Desktop/agoric-repos/endo/packages/benchmark/dist/bundle.js","lineNumber":13532,"columnNumber":17},"hitCount":25,"children":[142,144],"positionTicks":[{"line":13543,"ticks":6},{"line":13538,"ticks":6},{"line":13545,"ticks":13}]},{"id":142,"callFrame":{"functionName":"getOwnDataDescriptor","scriptId":"483","url":"file:///Users/muhammadahmad/Desktop/agoric-repos/endo/packages/benchmark/dist/bundle.js","lineNumber":12261,"columnNumber":31},"hitCount":5,"positionTicks":[{"line":12268,"ticks":3},{"line":12273,"ticks":2}]},{"id":144,"callFrame":{"functionName":"passStyleOfRecur","scriptId":"483","url":"file:///Users/muhammadahmad/Desktop/agoric-repos/endo/packages/benchmark/dist/bundle.js","lineNumber":13826,"columnNumber":31},"hitCount":5,"children":[150],"positionTicks":[{"line":13839,"ticks":2},{"line":13828,"ticks":3}]},{"id":150,"callFrame":{"functionName":"passStyleOfInternal","scriptId":"483","url":"file:///Users/muhammadahmad/Desktop/agoric-repos/endo/packages/benchmark/dist/bundle.js","lineNumber":13846,"columnNumber":34},"hitCount":1,"positionTicks":[{"line":13849,"ticks":1}]},{"id":140,"callFrame":{"functionName":"canBeValid","scriptId":"483","url":"file:///Users/muhammadahmad/Desktop/agoric-repos/endo/packages/benchmark/dist/bundle.js","lineNumber":13521,"columnNumber":16},"hitCount":7,"children":[141],"positionTicks":[{"line":13527,"ticks":7}]},{"id":141,"callFrame":{"functionName":"","scriptId":"483","url":"file:///Users/muhammadahmad/Desktop/agoric-repos/endo/packages/benchmark/dist/bundle.js","lineNumber":13526,"columnNumber":35},"hitCount":8,"children":[148],"positionTicks":[{"line":13528,"ticks":8}]},{"id":148,"callFrame":{"functionName":"checkPropertyCanBeValid","scriptId":"483","url":"file:///Users/muhammadahmad/Desktop/agoric-repos/endo/packages/benchmark/dist/bundle.js","lineNumber":13498,"columnNumber":34},"hitCount":1,"positionTicks":[{"line":13506,"ticks":1}]},{"id":137,"callFrame":{"functionName":"harden","scriptId":"483","url":"file:///Users/muhammadahmad/Desktop/agoric-repos/endo/packages/benchmark/dist/bundle.js","lineNumber":1586,"columnNumber":12},"hitCount":2,"children":[138,145],"positionTicks":[{"line":1707,"ticks":1},{"line":1661,"ticks":1}]},{"id":138,"callFrame":{"functionName":"dequeue","scriptId":"483","url":"file:///Users/muhammadahmad/Desktop/agoric-repos/endo/packages/benchmark/dist/bundle.js","lineNumber":1692,"columnNumber":24},"hitCount":0,"children":[139]},{"id":139,"callFrame":{"functionName":"baseFreezeAndTraverse","scriptId":"483","url":"file:///Users/muhammadahmad/Desktop/agoric-repos/endo/packages/benchmark/dist/bundle.js","lineNumber":1615,"columnNumber":38},"hitCount":41,"children":[143],"positionTicks":[{"line":1637,"ticks":1},{"line":1639,"ticks":6},{"line":1635,"ticks":34}]},{"id":143,"callFrame":{"functionName":"","scriptId":"483","url":"file:///Users/muhammadahmad/Desktop/agoric-repos/endo/packages/benchmark/dist/bundle.js","lineNumber":1638,"columnNumber":41},"hitCount":7,"children":[147],"positionTicks":[{"line":1652,"ticks":1},{"line":1643,"ticks":6}]},{"id":147,"callFrame":{"functionName":"enqueue","scriptId":"483","url":"file:///Users/muhammadahmad/Desktop/agoric-repos/endo/packages/benchmark/dist/bundle.js","lineNumber":1594,"columnNumber":24},"hitCount":2,"children":[149],"positionTicks":[{"line":1596,"ticks":2}]},{"id":149,"callFrame":{"functionName":"isObject$3","scriptId":"483","url":"file:///Users/muhammadahmad/Desktop/agoric-repos/endo/packages/benchmark/dist/bundle.js","lineNumber":272,"columnNumber":21},"hitCount":2,"positionTicks":[{"line":273,"ticks":2}]},{"id":145,"callFrame":{"functionName":"commit","scriptId":"483","url":"file:///Users/muhammadahmad/Desktop/agoric-repos/endo/packages/benchmark/dist/bundle.js","lineNumber":1702,"columnNumber":23},"hitCount":1,"children":[146],"positionTicks":[{"line":1704,"ticks":1}]},{"id":146,"callFrame":{"functionName":"markHardened","scriptId":"483","url":"file:///Users/muhammadahmad/Desktop/agoric-repos/endo/packages/benchmark/dist/bundle.js","lineNumber":1698,"columnNumber":29},"hitCount":1,"positionTicks":[{"line":1700,"ticks":1}]}],"startTime":141001792084,"endTime":141002008292,"samples":[2,2,2,5,9,10,16,20,32,41,42,48,24,55,63,65,66,68,68,69,77,82,83,83,87,89,96,98,107,112,109,83,109,112,115,115,108,116,117,83,119,109,131,136,139,141,139,139,139,136,135,142,136,139,141,136,141,139,136,139,143,143,144,139,144,83,143,136,146,142,139,139,135,136,139,139,135,141,144,108,139,147,139,137,139,139,139,139,144,135,139,139,136,148,140,139,149,136,135,136,139,145,135,139,140,136,149,136,139,143,134,139,135,141,142,140,134,147,150,136,83,139,139,139,139,136,136,136,136,136,137,139,136,144,140,141,83,142,139,135,139,136,135,136,136,139,136,139,139,139,83,136,136,143,143,139,143,141,139,135,135,140,141,139,142,140,135,139,140,135,139],"timeDeltas":[1708,1334,1250,1250,1250,1291,1250,1250,1250,1250,1250,1292,1250,1250,1292,1208,1208,1250,1250,1292,1208,1250,1209,1250,1250,1250,1291,1250,1125,1250,1292,1250,1250,1250,1250,1292,1250,1250,1250,1250,1250,1291,1292,1208,1250,1250,1250,1292,1250,1250,1250,1250,1292,1250,1291,1250,1250,1250,1250,1292,1250,1250,1250,1250,1250,1292,1250,1250,1291,1250,1292,1250,1250,1250,1250,1250,1292,1250,1291,1209,1208,1250,1250,1250,1292,1250,1250,1250,1291,1250,1250,1250,1250,1250,1292,1292,1250,1250,1250,1291,1125,1250,1250,1250,1250,1292,1250,1250,1250,1250,1250,1292,1250,1250,1250,1250,1250,1291,1250,1250,1250,1250,1292,1250,1250,1250,1250,1250,1250,1292,1166,1292,1250,1250,1250,1250,1208,1250,1292,1250,1250,1250,1292,1250,1250,1250,1250,1250,1250,1250,1250,1291,1250,1250,1250,1250,1292,1250,1250,1250,1292,1250,1250,1250,1250,1250,1291,1250,1250,1250,1292]}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file should be deleted from the PR.

We should add an ignore rule in the proper place for .cpuprofile files, so these don't accidentally get included. But I'm not sure where that is. Attn @kriskowal

@@ -0,0 +1,38 @@
const performance = { now: () => Date.now() };
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I though performance.now() was microseconds. Sorry for the confusion. Now that I understand it is nanoseconds, my corresponding suggestion would be

Suggested change
const performance = { now: () => Date.now() };
const performance = { now: () => Date.now() * 1_000_000 };

to normalize to nanoseconds. But from your comments, it sounds like you agree we should normalize to nanoseconds, and that you're doing this somewhere. Where?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for reminding.

}

function assert(condition, message = 'Assertion failed') {
if (!condition) throw new Error(message);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor

Suggested change
if (!condition) throw new Error(message);
if (!condition) throw Error(message);

@@ -0,0 +1,58 @@
import '@endo/init';
import { passStyleOf } from '@endo/pass-style';
import { test, benchmark } from '../src/benchmark.js';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, src/ is perhaps a better choice than tools/. No change suggested.

"lint:types": "tsc",
"postpack": "git clean -f '*.d.ts*'",
"prepack": "tsc --build tsconfig.build.json",
"test": "yarn rollup -c && eshost -h v8,xs dist/bundle.js",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good. I think I understand now why v8,xs is a better choice, and how your README instructions make this work. (Though I haven't tried it myself yet.) No change suggested.

"postpack": "git clean -f '*.d.ts*'",
"prepack": "tsc --build tsconfig.build.json",
"test": "yarn rollup -c && eshost -h v8,xs dist/bundle.js",
"bench": "yarn rollup -c && node --jitless --cpu-prof dist/bundle.js"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am on the fence about whether my suggested name here should be changed to emphasize this is a node-only test whose purpose is to generate a .cpuprofile to get a flamegraph. Or whether we should leave it simple in expectation of generalizing the script to be cross platform using eshost. No change suggested.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although there are no changes suggested, I am still noticing this comment and will look into when I work on follow-ups.

},
"devDependencies": {
"@endo/lockdown": "workspace:^",
"@endo/ses-ava": "workspace:^",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you using ses-ava?

@muhammadahmadasifbhatti
Copy link
Author

@erights I have addressed the comments. I think now I can tag @kriskowal to have a final look.
Nevertheless, I am done with another small feature that when you use this tool from CLI it can take filename as the input. That PR will be ready soon and you will be able to review that on Monday.

I also have Richard's idea in mind to have an executable like ava but before that I'll write a js script that'll have an entry point in the package.json.

@muhammadahmadasifbhatti muhammadahmadasifbhatti changed the title Benchmark Testing feat(bench-test): Benchmark Testing Feb 14, 2025
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

Successfully merging this pull request may close these issues.

4 participants