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 diff performance #15

Merged
merged 9 commits into from Mar 3, 2019
Merged

Improve diff performance #15

merged 9 commits into from Mar 3, 2019

Conversation

zenangst
Copy link
Owner

@zenangst zenangst commented Mar 3, 2019

This PR improves diff performance by using reserving capacity of the arrays before diffing.
It also simplifies the implementation by removing enum and uses concrete value types instead, this should not affect performance but in my own personal opinion, it is easier to reason about as opposed to looking "fancy".

The use of defer has also been removed to make the code more linear.

@codecov-io
Copy link

Codecov Report

Merging #15 into master will increase coverage by 0.43%.
The diff coverage is 64.7%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #15      +/-   ##
==========================================
+ Coverage   32.07%   32.51%   +0.43%     
==========================================
  Files          13       13              
  Lines         583      609      +26     
==========================================
+ Hits          187      198      +11     
- Misses        396      411      +15
Impacted Files Coverage Δ
Tests/Shared/DiffManagerTests.swift 0% <0%> (ø) ⬆️
Source/Shared/ArrayEntry.swift 100% <100%> (+100%) ⬆️
Source/Shared/TableEntry.swift 33.33% <100%> (ø) ⬆️
Source/Shared/Algorithm.swift 92.59% <86.95%> (+1.6%) ⬆️
Source/Shared/Counter.swift 0% <0%> (-75%) ⬇️

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 004616f...3a4b4a8. Read the comment docs.

@zenangst zenangst merged commit baca25f into master Mar 3, 2019
@zenangst zenangst deleted the improve/performance branch March 3, 2019 15:06
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.

None yet

2 participants