Skip to content

Conversation

@Korijn
Copy link
Collaborator

@Korijn Korijn commented Dec 14, 2025

Relates to #7

Changes:

  • Avoids iterators (for loops) when it is unnecessary.
  • Removed some redundant Pointer creation.
  • Optimized the Pointer class, since it is used a lot.

Since patchdiff is typically used as a low level tool in hot codepaths, this kind of micro-optimization is worthwhile.

@berendkleinhaneveld
Copy link
Collaborator

Since you've added some extra benchmarks, it might make sense to use the same benchmarking strategy that I applied at observ where it runs the new benchmarks also on the code from master.

@Korijn
Copy link
Collaborator Author

Korijn commented Dec 14, 2025

Since you've added some extra benchmarks, it might make sense to use the same benchmarking strategy that I applied at observ where it runs the new benchmarks also on the code from master.

How's this?

@Korijn
Copy link
Collaborator Author

Korijn commented Dec 14, 2025

Pointer.evaluate got much faster which in turns helps the performance of apply and iapply.

Other changes led to marginal improvements.

@Korijn Korijn merged commit d2694fe into master Dec 14, 2025
10 checks passed
@Korijn Korijn deleted the optimization branch December 14, 2025 22:05
@Korijn Korijn mentioned this pull request Dec 14, 2025
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.

3 participants