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

Side by Side Diff: test/js-perf-test/RegExp/base_search.js

Issue 2521263003: [js-perf-test] Add RegExp microbenchmarks (Closed)
Patch Set: Move to own test suite Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 load("base.js");
6
7 var str;
8 var re;
9
10 function SimpleSearch() {
11 str.search(re);
12 }
13
14 function Search1Setup() {
15 re = /[Cz]/;
16 str = createHaystack();
17 }
18
19 function Search2Setup() {
20 re = /[Cz]/;
21 re.lastIndex = 42; // Force lastIndex restoration.
22 str = createHaystack();
23 }
24
25 function Search3Setup() {
26 re = /[cZ]/; // Not found.
27 str = createHaystack();
28 }
29
30 var benchmarks = [ [SimpleSearch, Search1Setup],
31 [SimpleSearch, Search2Setup],
32 [SimpleSearch, Search3Setup],
33 ];
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698