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

Issue 18031015: base/i18n: Class for efficiently searching the same query over many texts. (Closed)

Created:
7 years, 5 months ago by kinaba
Modified:
7 years, 5 months ago
Reviewers:
jungshik at Google
CC:
chromium-reviews, erikwright+watch_chromium.org, jshin+watch_chromium.org
Visibility:
Public.

Description

base/i18n: Class for efficiently searching the same query over many texts. StringSearchIgnoringCaseAndAccents (implemented by ICU's usearch_* family) takes significantly long time for preprocessing the query text. Thus, when we want to query over multiple different texts with the same query, it becomes much more efficient if we reuse the preprocessed query. Here's the super micro benchmark result: TEST(StringSearchTest, BenchmarkOld) { string16 query(ASCIIToUTF16("hello")); string16 text(ASCIIToUTF16("hello")); for (int i = 0; i < 1000000; ++i) StringSearchIgnoringCaseAndAccents(query, text, NULL, NULL); } TEST(StringSearchTest, BenchmarkNew) { FixedPatternStringSearchIgnoringCaseAndAccents query(ASCIIToUTF16("hello")); string16 text(ASCIIToUTF16("hello")); for (int i = 0; i < 1000000; ++i) query.Search(text, NULL, NULL); } [ RUN ] StringSearchTest.BenchmarkOld [ OK ] StringSearchTest.BenchmarkOld (68230 ms) [ RUN ] StringSearchTest.BenchmarkNew [ OK ] StringSearchTest.BenchmarkNew (1282 ms) BUG=255269 TEST=base_unittests --gtest_filter='StringSearchTest.*' Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=211052

Patch Set 1 #

Total comments: 2

Patch Set 2 : Address review comments (#5) #

Unified diffs Side-by-side diffs Delta from patch set Stats (+83 lines, -35 lines) Patch
M base/i18n/string_search.h View 2 chunks +23 lines, -0 lines 0 comments Download
M base/i18n/string_search.cc View 1 1 chunk +37 lines, -35 lines 0 comments Download
M base/i18n/string_search_unittest.cc View 1 chunk +23 lines, -0 lines 0 comments Download

Messages

Total messages: 9 (0 generated)
kinaba
jshin@, could you take a look as the owner of base/i18n? Please refer the associated ...
7 years, 5 months ago (2013-06-28 03:35:00 UTC) #1
kinaba
friendly ping.
7 years, 5 months ago (2013-07-02 16:11:14 UTC) #2
jungshik at Google
On 2013/07/02 16:11:14, kinaba wrote: > friendly ping. Sorry for the delay. I'll review this ...
7 years, 5 months ago (2013-07-09 19:12:50 UTC) #3
jungshik at Google
On 2013/07/09 19:12:50, Jungshik Shin wrote: > On 2013/07/02 16:11:14, kinaba wrote: > > friendly ...
7 years, 5 months ago (2013-07-10 21:27:27 UTC) #4
jungshik at Google
Sorry that I forgot to publish my inline comment. https://codereview.chromium.org/18031015/diff/1/base/i18n/string_search.cc File base/i18n/string_search.cc (right): https://codereview.chromium.org/18031015/diff/1/base/i18n/string_search.cc#newcode45 base/i18n/string_search.cc:45: ...
7 years, 5 months ago (2013-07-10 21:27:52 UTC) #5
kinaba
Updated. https://codereview.chromium.org/18031015/diff/1/base/i18n/string_search.cc File base/i18n/string_search.cc (right): https://codereview.chromium.org/18031015/diff/1/base/i18n/string_search.cc#newcode45 base/i18n/string_search.cc:45: usearch_setText(search_, in_this.data(), in_this.size(), &status); On 2013/07/10 21:27:52, Jungshik ...
7 years, 5 months ago (2013-07-11 03:14:22 UTC) #6
jungshik at Google
Thanks. LGTM On 2013/07/11 03:14:22, kinaba wrote: > Updated. > > https://codereview.chromium.org/18031015/diff/1/base/i18n/string_search.cc > File base/i18n/string_search.cc ...
7 years, 5 months ago (2013-07-11 06:23:01 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/kinaba@chromium.org/18031015/16001
7 years, 5 months ago (2013-07-11 06:34:32 UTC) #8
commit-bot: I haz the power
7 years, 5 months ago (2013-07-11 09:32:33 UTC) #9
Message was sent while issue was closed.
Change committed as 211052

Powered by Google App Engine
This is Rietveld 408576698