perf: Look into optimizing memory allocations within apply_diff()
#32
Labels
lvl-1-easy
Easy-ranking issue
p1-low
Priority 1: Generally no one plans to work on the task, but it would be nice if someone decides to.
t-performance
Issue relating to performance, like optimizations or benchmarks
Because
String.insert()
andString.remove()
are both O(n) (linear) operations, it'd be useful to look into reducing the number of internal calls to both of these methods. There is one way I'm thinking of at the moment, which is to look for series of length-shifting operations.We can keep track of the last diff operation, and compare it to the current one.
push
calls into a singlepush_str()
callremove
calls into a singleremove()
callThe text was updated successfully, but these errors were encountered: