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

Optimize merging line coverage #1121

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

splattael
Copy link
Contributor

@splattael splattael commented Jan 7, 2025

This PR optimizes merging line coverage:

  • Integer#to_i and NilClass#to_i showed up in stack profiler which resulted to slow down merge_line_coverage a lot
  • Array#zip created a lot of intermediate objects

These changes brought down the run time from 1m28s to 1m8s on a large resultset (GitLab).

Stack profile

Before

Screenshot from 2025-01-07 11-59-26

After

Screenshot from 2025-01-07 11-59-36

Prior this change `Integer#to_i` and `NilClass#to_i` showed up in
stack profiler which resulted to slow down `merge_line_coverage` a lot.

This change brought down the run time from 1m28s to 1m18s on a large
resultset (GitLab).
Create less intermediate objects.
@splattael
Copy link
Contributor Author

👋 @amatsuda Do you mind reviewing this optimization?

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.

1 participant