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: bump deno_core and update tests #21467

Merged
merged 14 commits into from
Dec 7, 2023
Merged

Conversation

mmastrac
Copy link
Contributor

@mmastrac mmastrac commented Dec 5, 2023

Landing changes required for denoland/deno_core#359

We need to update 99_main.js and a whole load of tests.

API changes:

  • setPromiseRejectCallback becomes setUnhandledPromiseRejectionHandler. The function is now called from eventLoopTick.
  • The promiseRejectMacrotaskCallback no longer exists, as this is automatically handled in eventLoopTick.
  • ops.op_dispatch_exception now takes a second parameter: in_promise. The preferred way to call this op is now reportUnhandledException or reportUnhandledPromiseRejection.

@mmastrac mmastrac changed the title [WIP] chore: bump deno_core and update tests chore: bump deno_core and update tests [WIP] Dec 5, 2023
Cargo.toml Outdated Show resolved Hide resolved
@@ -4,4 +4,5 @@ console.log("Starting the child worker");

setTimeout(() => {
console.log("The child worker survived the death of the parent!!!");
Deno.exit(1);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Avoids the test spinning forever if it fails

Copy link
Member

Choose a reason for hiding this comment

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

Good idea

@@ -9,25 +9,6 @@ use deno_core::error::JsError;
use deno_core::error::JsStackFrame;
use std::fmt::Write as _;

/// Compares all properties of JsError, except for JsError::cause.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved to deno_core

@@ -182,6 +182,7 @@ impl WebWorkerInternalHandle {
/// This function will set terminated to true, terminate the isolate and close the message channel
pub fn terminate(&mut self) {
self.cancel.cancel();
self.terminate_waker.wake();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Discovered this was necessary with @bartlomieju

cli/tests/testdata/run/with_config/auto_discovery_log.out Outdated Show resolved Hide resolved
cli/tests/testdata/test/no_check.out Show resolved Hide resolved
@@ -4,4 +4,5 @@ console.log("Starting the child worker");

setTimeout(() => {
console.log("The child worker survived the death of the parent!!!");
Deno.exit(1);
Copy link
Member

Choose a reason for hiding this comment

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

Good idea

Comment on lines -405 to -416
// Add a callback for "error" event - it will be dispatched
// if error is thrown during dispatch of "unhandledrejection"
// event.
globalThis_.addEventListener("error", errorEventCb);
globalThis_.dispatchEvent(rejectionEvent);
globalThis_.removeEventListener("error", errorEventCb);

// If event was not yet prevented, try handing it off to Node compat layer
// (if it was initialized)
if (
!rejectionEvent.defaultPrevented &&
typeof internals.nodeProcessUnhandledRejectionCallback !== "undefined"
Copy link
Member

Choose a reason for hiding this comment

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

Good to see so much complexity removed. Pinging @igorzi and @satyarohith that you will need to update this bit on your side as well.

runtime/js/99_main.js Show resolved Hide resolved
@mmastrac mmastrac changed the title chore: bump deno_core and update tests [WIP] chore: bump deno_core and update tests Dec 6, 2023
@mmastrac mmastrac merged commit 9314928 into denoland:main Dec 7, 2023
14 checks passed
@mmastrac
Copy link
Contributor Author

mmastrac commented Dec 8, 2023

/bench http[minimal,realistic]

@denobot
Copy link
Collaborator

denobot commented Dec 8, 2023

http[minimal]

rps latency bytes relative
node 88,593 111.48 µs σ=36.79 753,730 kB -71.5%
bun 310,721 32.34 µs σ=18.99 1,533,203 kB best
deno 171,382 56.83 µs σ=17.79 1,406,250 kB -44.8%
deno-baseline 171,276 56.95 µs σ=18.53 1,406,250 kB -44.9%

http[realistic]

rps latency bytes relative
node 85,395 115.54 µs σ=35.67 917,968 kB -56.8%
bun 197,799 58.35 µs σ=132.06 1,845,703 kB best
deno 143,276 68.26 µs σ=24.03 1,523,437 kB -27.6%
deno-baseline 144,526 67.39 µs σ=21.86 1,533,203 kB -26.9%

start: Fri, 08 Dec 2023 14:02:19 GMT

id: de4bede3-cbcc-4fd0-b714-30ef03521b16

server: 1bcf1fdd-7463-481d-ba1e-c648e04a3136

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.

None yet

3 participants