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

chore: migrate to new deno_core and metrics #21057

Merged
merged 4 commits into from
Nov 5, 2023

Conversation

mmastrac
Copy link
Contributor

@mmastrac mmastrac commented Nov 2, 2023

@mmastrac mmastrac added the ci-bench put this on a PR to run the benchmarks label Nov 2, 2023
@mmastrac
Copy link
Contributor Author

mmastrac commented Nov 2, 2023

/bench http[minimal,realistic]

@denobot
Copy link
Collaborator

denobot commented Nov 2, 2023

Benchmark failed! 😵


start: Thu, 02 Nov 2023 22:21:16 GMT

id: d84e0116-7b3a-4d69-8ab0-5e5ec47b40e3

server: 836b1370-7d44-4d68-ab86-c64fb34662c6

@mmastrac
Copy link
Contributor Author

mmastrac commented Nov 2, 2023

/bench http[minimal,realistic]

@denobot
Copy link
Collaborator

denobot commented Nov 2, 2023

http[minimal]

rps latency bytes relative
node 91,189 108.92 µs σ=32.8 775,820 kB -71.1%
bun 315,052 31.37 µs σ=19.82 1,552,734 kB best
deno 181,849 54.11 µs σ=12.87 1,494,140 kB -42.3%
deno-baseline 178,609 55.04 µs σ=13.08 1,464,843 kB -43.3%

http[realistic]

rps latency bytes relative
node 87,293 113.65 µs σ=32.04 937,500 kB -56.9%
bun 202,553 55.87 µs σ=119.23 1,894,531 kB best
deno 152,923 64.54 µs σ=18.48 1,621,093 kB -24.5%
deno-baseline 150,223 65.7 µs σ=18.43 1,591,796 kB -25.8%

start: Thu, 02 Nov 2023 22:30:17 GMT

id: a76375f2-629f-473f-aefb-4ed324fa27a7

server: cf475088-659b-4546-9c32-7370c19419fb

// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
import { assert, assertEquals } from "./test_util.ts";

Deno.test(async function metrics() {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is tested in deno_core now.

Copy link
Member

Choose a reason for hiding this comment

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

Let's still keep it?

@@ -412,19 +412,6 @@ Deno.test(function clearTimeoutAndClearIntervalNotBeEquals() {
assertNotEquals(clearTimeout, clearInterval);
});

Deno.test(async function timerMaxCpuBug() {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I couldn't think of a good way to replicate this test without using metrics... thoughts?

@@ -3425,11 +3425,6 @@ itest!(unstable_ffi_19 {
exit_code: 70,
});

itest!(future_check2 {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Was effectively doing and testing nothing.

@@ -398,6 +398,7 @@ pub struct Flags {
pub config_flag: ConfigFlag,
pub node_modules_dir: Option<bool>,
pub vendor: Option<bool>,
pub enable_op_summary_metrics: bool,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a flag but isn't currently exposed on the CLI args yet.

cli/tsc/dts/lib.deno.ns.d.ts Outdated Show resolved Hide resolved
Comment on lines 212 to 220
let op_summary_metrics = Rc::new(OpMetricsSummaryTracker::default());
deno_core::extension!(deno_op_metrics,
options = {
op_summary_metrics: Rc<OpMetricsSummaryTracker>
},
state = |state, options| {
state.put(options.op_summary_metrics)
}
);
Copy link
Member

Choose a reason for hiding this comment

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

Is it only for MainWorker? What about WebWorker?

Also seems strange to define an extension to put a default object in the state. Maybe do it directly after creating JsRuntime?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added code for WebWorker as well -- the metrics there are never fetched (AFAICT) but I suppose it's good for consistency.

I switched it up to manually add it to the JsRuntime after as suggested but deno_permissions_worker is also doing something similar. I'm OK either way.

Copy link
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

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

LGTM once CI passes

@mmastrac mmastrac merged commit 485fade into denoland:main Nov 5, 2023
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci-bench put this on a PR to run the benchmarks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants