curran / curran/google-diff-match-patch

Replacing String with StringBuffer instances in patch_apply

Open
#55 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

auto-migrated Performance Type-Patch
Dominant language
Python
Stars
17
Forks
2
PR merge metrics
No merged PRs in 30d

Description

We used this DiffMatchPatch code extensively for tracking differences between 
versions of database objects.  Some of our calls can generate more than 25k 
patch strings that need to be applied to large chunks of text. In this instance 
we where seeing severe performance issues and inefficient memory management 
(even on Java 6).
This patch replaces Strings with StringBuffer and implements more efficient 
INSERT & DELETE operations which drastically reduces memory usage for large 
text strings.

Original issue reported on code.google.com by chris.p....@gmail.com on 4 Oct 2011 at 4:37

Attachments:

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review the attached diff_match_patch.java.patch against the Java implementation and inspect the patch_apply entry point first. Confirm that the proposed StringBuffer and INSERT/DELETE changes preserve patch application behavior while addressing the large-input memory and performance problems described in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
performance
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.