Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(50)

Issue 1690593002: Reduce memory use of GetLevenshteinDistance() by almost 50% (Closed)

Created:
4 years, 10 months ago by Nico
Modified:
4 years, 10 months ago
Reviewers:
radhikabhar, felt
CC:
chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Reduce memory use of GetLevenshteinDistance() by almost 50% Probably not measurable, but it's also a bit shorter, so probably worth it. This is a port of my change http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20150713/286948.html where I explained the idea like so: // Although the algorithm is typically described using an m x n // array, only one row plus one element are used at a time, so this // implementation just keeps one vector for the row. To update one entry, // only the entries to the left, top, and top-left are needed. The left // entry is in row[x-1], the top entry is what's in row[x] from the last // iteration, and the top-left entry is stored in previous. No intended behavior change. BUG=none Committed: https://crrev.com/4967b70a63b618a6e508db88c2fa9c5dbef206f4 Cr-Commit-Position: refs/heads/master@{#376015}

Patch Set 1 #

Patch Set 2 : . #

Patch Set 3 : test cases #

Patch Set 4 : whoops #

Patch Set 5 : compile? #

Total comments: 1

Patch Set 6 : . #

Unified diffs Side-by-side diffs Delta from patch set Stats (+12 lines, -13 lines) Patch
M components/ssl_errors/error_classification.cc View 1 2 3 4 5 2 chunks +12 lines, -13 lines 0 comments Download

Messages

Total messages: 24 (8 generated)
Nico
4 years, 10 months ago (2016-02-10 15:28:33 UTC) #2
felt
Thanks for the improvement! Can you add a test or two in error_classification_unittest? The simplest ...
4 years, 10 months ago (2016-02-10 20:24:40 UTC) #3
Nico
This is a behavior-preserving change – shouldn't this be covered by existing tests? :-P
4 years, 10 months ago (2016-02-10 20:31:21 UTC) #4
felt
On 2016/02/10 20:31:21, Nico wrote: > This is a behavior-preserving change – shouldn't this be covered ...
4 years, 10 months ago (2016-02-10 20:36:58 UTC) #5
Nico
I added a few (using a more direct approach). (I haven't tried running them locally, ...
4 years, 10 months ago (2016-02-10 20:57:00 UTC) #6
Nico
Now the diff is pretty hard to read since the code's moving around and changing ...
4 years, 10 months ago (2016-02-10 20:58:09 UTC) #7
Nico
…so if this approach looks generally alright to you, I propose I land the tests ...
4 years, 10 months ago (2016-02-10 20:59:57 UTC) #8
felt
lgtm, i'm OK with landing it in two CLs (and see the nit) https://codereview.chromium.org/1690593002/diff/80001/components/ssl_errors/error_classification.h File ...
4 years, 10 months ago (2016-02-11 00:10:42 UTC) #9
Nico
Ok, rebased, PTAL. Tests landed in a prior CL.
4 years, 10 months ago (2016-02-17 20:30:37 UTC) #10
Nico
…oh, you already lgtm'd, never mind :-)
4 years, 10 months ago (2016-02-17 20:36:06 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1690593002/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1690593002/100001
4 years, 10 months ago (2016-02-17 20:37:55 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1690593002/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1690593002/100001
4 years, 10 months ago (2016-02-17 20:46:04 UTC) #17
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_asan_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_asan_rel_ng/builds/117434)
4 years, 10 months ago (2016-02-17 22:00:19 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1690593002/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1690593002/100001
4 years, 10 months ago (2016-02-17 22:06:51 UTC) #21
commit-bot: I haz the power
Committed patchset #6 (id:100001)
4 years, 10 months ago (2016-02-17 22:49:29 UTC) #22
commit-bot: I haz the power
4 years, 10 months ago (2016-02-17 22:50:40 UTC) #24
Message was sent while issue was closed.
Patchset 6 (id:??) landed as
https://crrev.com/4967b70a63b618a6e508db88c2fa9c5dbef206f4
Cr-Commit-Position: refs/heads/master@{#376015}

Powered by Google App Engine
This is Rietveld 408576698