Skip to content

Commit 6f076f9

Browse files
nshahanCommit Queue
authored andcommitted
[benchmark] Cleanup lint violations
Fix violations of lints that I expect have no influence on the performance characteristics of this benchmark: * annotate_overrides * directives_ordering Change-Id: I49f33347aea5cfdcbac5c9195a18427bdb7c667e Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/433266 Commit-Queue: Nicholas Shahan <[email protected]> Reviewed-by: Stephen Adams <[email protected]>
1 parent 6310de0 commit 6f076f9

File tree

1 file changed

+36
-1
lines changed

1 file changed

+36
-1
lines changed

benchmarks/StaticJsInterop/dart/benchmarks1.dart

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44

5-
import 'package:benchmark_harness/benchmark_harness.dart';
65
import 'dart:js_interop';
76

7+
import 'package:benchmark_harness/benchmark_harness.dart';
8+
89
// Static js-interop benchmarks.
910
//
1011
// Type checks:
@@ -140,6 +141,7 @@ abstract class CastsBase extends Base {
140141
class Casts1 extends CastsBase {
141142
Casts1() : super('JSObject', data: allJSObjects());
142143

144+
@override
143145
void run() {
144146
for (final o in data) {
145147
sink = o as JSObject;
@@ -150,6 +152,7 @@ class Casts1 extends CastsBase {
150152
class Casts2 extends CastsBase {
151153
Casts2() : super('JSAny', data: allJSAnys());
152154

155+
@override
153156
void run() {
154157
for (final o in data) {
155158
sink = o as JSAny;
@@ -160,6 +163,7 @@ class Casts2 extends CastsBase {
160163
class Casts3 extends CastsBase {
161164
Casts3() : super('JSAnyQ', data: allJSAnyQs());
162165

166+
@override
163167
void run() {
164168
for (final o in data) {
165169
sink = o as JSAny?;
@@ -170,6 +174,7 @@ class Casts3 extends CastsBase {
170174
class Casts4 extends CastsBase {
171175
Casts4() : super('JSNumber', data: allJSNumbers);
172176

177+
@override
173178
void run() {
174179
for (final o in data) {
175180
sink = o as JSNumber;
@@ -180,6 +185,7 @@ class Casts4 extends CastsBase {
180185
class Casts5 extends CastsBase {
181186
Casts5() : super('JSString', data: allJSStrings);
182187

188+
@override
183189
void run() {
184190
for (final o in data) {
185191
sink = o as JSString;
@@ -190,6 +196,7 @@ class Casts5 extends CastsBase {
190196
class Casts6 extends CastsBase {
191197
Casts6() : super('JSUint8Array', data: allJSUint8Array);
192198

199+
@override
193200
void run() {
194201
for (final o in data) {
195202
sink = o as JSUint8Array;
@@ -200,6 +207,7 @@ class Casts6 extends CastsBase {
200207
class CastsT<T> extends CastsBase {
201208
CastsT(String name, {required super.data}) : super('T.$name');
202209

210+
@override
203211
void run() {
204212
for (final o in data) {
205213
sink = o as T;
@@ -210,6 +218,7 @@ class CastsT<T> extends CastsBase {
210218
class Calls1SSS extends Base {
211219
Calls1SSS() : super('JSInterop.calls.inline3ArgsSSS');
212220

221+
@override
213222
void run() {
214223
String s = 'hello';
215224
for (int i = 0; i < N; i++) {
@@ -225,6 +234,7 @@ class Calls1SSS extends Base {
225234
class Calls1NNN extends Base {
226235
Calls1NNN() : super('JSInterop.calls.inline3ArgsIII');
227236

237+
@override
228238
void run() {
229239
String s = 'hello';
230240
for (int i = 0; i < N; i++) {
@@ -244,6 +254,7 @@ class Calls2SSS extends Base {
244254
static final _b = 'b'.toJS;
245255
static final _c = 'c'.toJS;
246256

257+
@override
247258
void run() {
248259
String s = 'hello';
249260
for (int i = 0; i < N; i++) {
@@ -262,6 +273,7 @@ class Calls2NNN extends Base {
262273
static final _b = 2.toJS;
263274
static final _c = 3.toJS;
264275

276+
@override
265277
void run() {
266278
String s = 'hello';
267279
for (int i = 0; i < N; i++) {
@@ -276,6 +288,7 @@ class Calls2NNN extends Base {
276288
class Calls3SSS extends Base {
277289
Calls3SSS() : super('JSInterop.calls.implicit3ArgsSSS');
278290

291+
@override
279292
void run() {
280293
String s = 'hello';
281294
for (int i = 0; i < N; i++) {
@@ -289,6 +302,7 @@ class Calls3SSS extends Base {
289302
class Calls3NNN extends Base {
290303
Calls3NNN() : super('JSInterop.calls.implicit3ArgsIII');
291304

305+
@override
292306
void run() {
293307
String s = 'hello';
294308
for (int i = 0; i < N; i++) {
@@ -302,6 +316,7 @@ class Calls3NNN extends Base {
302316
class Calls4 extends Base {
303317
Calls4() : super('JSInterop.calls.inline7Args');
304318

319+
@override
305320
void run() {
306321
String s = 'hello';
307322
for (int i = 0; i < N; i++) {
@@ -324,6 +339,8 @@ class Calls5 extends Base {
324339
Calls5() : super('JSInterop.calls.moveJSObject');
325340

326341
static final _o = JSObject();
342+
343+
@override
327344
void run() {
328345
JSObject o = _o;
329346
for (int i = 0; i < N; i++) {
@@ -337,6 +354,8 @@ class Calls6 extends Base {
337354
Calls6() : super('JSInterop.calls.moveJSArray');
338355

339356
static final _o = JSArray.withLength(2);
357+
358+
@override
340359
void run() {
341360
JSArray o = _o;
342361
for (int i = 0; i < N; i++) {
@@ -350,6 +369,8 @@ class Calls7 extends Base {
350369
Calls7() : super('JSInterop.calls.moveJSUint8Array');
351370

352371
static final _o = JSUint8Array.withLength(2);
372+
373+
@override
353374
void run() {
354375
JSUint8Array o = _o;
355376
for (int i = 0; i < N; i++) {
@@ -382,6 +403,8 @@ abstract class IsABase extends Base {
382403

383404
class IsA1 extends IsABase {
384405
IsA1() : super('JSObject');
406+
407+
@override
385408
void run() {
386409
for (final o in objects) {
387410
sink = o.isA<JSObject>();
@@ -391,6 +414,8 @@ class IsA1 extends IsABase {
391414

392415
class IsA2 extends IsABase {
393416
IsA2() : super('JSAny');
417+
418+
@override
394419
void run() {
395420
for (final o in objects) {
396421
sink = o.isA<JSAny>();
@@ -400,6 +425,8 @@ class IsA2 extends IsABase {
400425

401426
class IsA3 extends IsABase {
402427
IsA3() : super('JSString');
428+
429+
@override
403430
void run() {
404431
for (final o in objects) {
405432
sink = o.isA<JSString>();
@@ -409,6 +436,8 @@ class IsA3 extends IsABase {
409436

410437
class IsA4 extends IsABase {
411438
IsA4() : super('JSArray');
439+
440+
@override
412441
void run() {
413442
for (final o in objects) {
414443
sink = o.isA<JSArray>();
@@ -418,6 +447,8 @@ class IsA4 extends IsABase {
418447

419448
class IsA5 extends IsABase {
420449
IsA5() : super('Date');
450+
451+
@override
421452
void run() {
422453
for (final o in objects) {
423454
sink = o.isA<Date>();
@@ -427,6 +458,8 @@ class IsA5 extends IsABase {
427458

428459
class IsA6 extends IsABase {
429460
IsA6() : super('DateQ');
461+
462+
@override
430463
void run() {
431464
for (final o in objects) {
432465
sink = o.isA<Date?>();
@@ -436,6 +469,8 @@ class IsA6 extends IsABase {
436469

437470
class IsA7 extends IsABase {
438471
IsA7() : super('JSUint8Array');
472+
473+
@override
439474
void run() {
440475
for (final o in objects) {
441476
sink = o.isA<JSUint8Array>();

0 commit comments

Comments
 (0)