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

[perf] Use Set instead of arrays for metrics aggregation #112

Merged
merged 1 commit into from
Nov 27, 2024

Conversation

yoannmoinet
Copy link
Member

What and why?

This is slow and even crashes on very large lists.

How?

Optimise the process using more Sets.

@yoannmoinet yoannmoinet force-pushed the yoann/optimize-metrics-aggregation branch from 3c2c42c to fe37d18 Compare November 26, 2024 15:56
@yoannmoinet yoannmoinet changed the base branch from master to yoann/rspack November 26, 2024 15:56
@yoannmoinet yoannmoinet changed the title Use Set instead of arrays for metrics aggregation [perf] Use Set instead of arrays for metrics aggregation Nov 27, 2024
@yoannmoinet yoannmoinet marked this pull request as ready for review November 27, 2024 10:50
@yoannmoinet yoannmoinet requested a review from a team as a code owner November 27, 2024 10:50
@yoannmoinet yoannmoinet requested review from arcanis, a team, egeriis and elbywan and removed request for a team, arcanis and egeriis November 27, 2024 10:50
metrics.push(
{
metrics
.add({
Copy link
Collaborator

Choose a reason for hiding this comment

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

TIL set#add can be chained!

Copy link
Member Author

Choose a reason for hiding this comment

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

ME TOO, I didn't know that either.

Base automatically changed from yoann/rspack to master November 27, 2024 13:25
@yoannmoinet yoannmoinet merged commit 811f453 into master Nov 27, 2024
4 checks passed
@yoannmoinet yoannmoinet deleted the yoann/optimize-metrics-aggregation branch November 27, 2024 13:25
@yoannmoinet yoannmoinet mentioned this pull request Nov 27, 2024
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.

2 participants