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

Ref: using node:assert/strict instead of if + throw #1371

Merged
merged 27 commits into from
Dec 11, 2023
Merged

Conversation

RobinTail
Copy link
Owner

Reducing branch complexity that way.
⚠️ Requires to get rid of Jest: #1369

@RobinTail RobinTail added the refactoring The better way to achieve the same result label Dec 10, 2023
@RobinTail RobinTail marked this pull request as ready for review December 10, 2023 23:15
Base automatically changed from switch-to-vitest to master December 11, 2023 14:26
@coveralls
Copy link

coveralls commented Dec 11, 2023

Coverage Status

coverage: 100.0%. remained the same
when pulling 19febb2 on use-assert
into db622e3 on master.

Copy link
Owner Author

@RobinTail RobinTail left a comment

Choose a reason for hiding this comment

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

ready

@RobinTail RobinTail merged commit 1aaa26a into master Dec 11, 2023
@RobinTail RobinTail deleted the use-assert branch December 11, 2023 18:08
RobinTail added a commit that referenced this pull request Nov 15, 2024
partially reverts #1371
for performance reasons found in #2168
RobinTail added a commit that referenced this pull request Nov 15, 2024
Avoiding recursion should decrease memory consumption by replacing the
utilization of call stack to a stack of entities to process

https://www.nearform.com/insights/tracking-memory-allocation-node-js/

```
   ✓ Experiment for routing walker (2) 1247ms
     name             hz     min     max    mean     p75     p99    p995    p999     rme  samples
   · current    3,691.20  0.2053  2.7257  0.2709  0.2885  0.3817  0.4519  2.1826  ±1.49%     1846
   · featured  50,253.26  0.0123  5.8032  0.0199  0.0165  0.0423  0.1116  2.7895  ±7.10%    25127   fastest
```

Turned out that the performance is mostly affected by `assert(..., new
Error())` pattern, partially introduced by
#1371
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactoring The better way to achieve the same result
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants