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

Improve performance of commented string #635

Merged
merged 3 commits into from
Sep 13, 2021
Merged

Conversation

adellibovi
Copy link
Collaborator

Short description 📝

This PR improves the performance of commented string.

Solution 📦

Most of the case we do not need to escape, having an early exit saves a lot of copies and allocation, in my case I got the time spent on validString from 9s to 1.6s

@codecov-commenter
Copy link

codecov-commenter commented Sep 12, 2021

Codecov Report

Merging #635 (f0f5905) into main (e4f1ee6) will decrease coverage by 0.31%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #635      +/-   ##
==========================================
- Coverage   84.34%   84.03%   -0.32%     
==========================================
  Files         154      154              
  Lines        8758     8774      +16     
==========================================
- Hits         7387     7373      -14     
- Misses       1371     1401      +30     
Impacted Files Coverage Δ
Sources/XcodeProj/Utils/CommentedString.swift 91.48% <100.00%> (-1.67%) ⬇️
Sources/XcodeProj/Project/XcodeProj.swift 38.93% <0.00%> (-6.02%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e4f1ee6...f0f5905. Read the comment docs.

Copy link
Member

@fortmarek fortmarek left a comment

Choose a reason for hiding this comment

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

🚀 Just to double-check - have you made sure there are tests in place that would have caught possible regression?

Sources/XcodeProj/Utils/CommentedString.swift Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
@adellibovi
Copy link
Collaborator Author

🚀 Just to double-check - have you made sure there are tests in place that would have caught possible regression?

Yep, there were already a good collection of cases under CommentedStringTests ☺️
Also tested the generation with a Tuist integration

@pepicrft pepicrft merged commit b1bcbfd into main Sep 13, 2021
@pepicrft pepicrft deleted the improve-commented-string branch September 13, 2021 09:15
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.

4 participants