Skip to content

Conversation

milomg
Copy link
Member

@milomg milomg commented Jul 4, 2025

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • angular.dev application / infrastructure changes
  • Other... Please describe:

What is the current behavior?

Issue Number: N/A

What is the new behavior?

This saves a field for effect and watch nodes. Additionally, it should make effect nodes flash in the devtools when they rerun.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

@angular-robot angular-robot bot added the area: core Issues related to the framework runtime label Jul 4, 2025
@ngbot ngbot bot added this to the Backlog milestone Jul 4, 2025
return;
}
this.hasRun = true;
this.version++;
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess setting a value to true will be cheaper memory wise, as there would be no need to allocate memory for each new value that ++ generates, while the boolean flag only allocates memory once, and uses that memory location.

Copy link
Member

Choose a reason for hiding this comment

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

It's just a number though (fixed 64 bit), It shouldn't really matter ?

Copy link
Contributor

Choose a reason for hiding this comment

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

This has to go through the perf benchmarks I guess.

Copy link
Contributor

Choose a reason for hiding this comment

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

In fact, in V8 this is going to be stored as an SMI (so a 32 bit integer). So unless there will be 2 billion increments, the impact is pretty minimal.

this saves a field for effect and watch nodes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: core Issues related to the framework runtime
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants