[patch] Reduce memory usage of ComputeEditDistance() by (almost) 50%

Douglas Gregor dgregor at apple.com
Mon Jul 13 13:42:36 PDT 2015


> On Jul 13, 2015, at 12:39 PM, Nico Weber <thakis at chromium.org> wrote:
> 
> Hi,
> 
> ComputeEditDistance() currently keeps two rows of the edit distance matrix in memory. That's unnecessary, one row plus one additional element are sufficient. With this patch, strings up to 64 chars can be processed without going to the heap, compared to 32 chars previously. (But the main motivation is that the code gets a bit simpler.)

Ah, good call. LGTM

	- Doug






More information about the llvm-commits mailing list