1
0
mirror of https://github.com/dart-lang/sdk synced 2024-07-01 07:14:29 +00:00
Commit Graph

196 Commits

Author SHA1 Message Date
Ömer Sinan Ağacan
01cf48f653 [benchmarks] Remove dynamic invocations in BigIntParsePrint benchmark
The dynamic invocations `sink1.codeUnits` and `sink2.isEven` can be slow
on dart2wasm.

They are done once in a few iterations, but the noise can still be
eliminated with a `if (runtimeFalse)` guard around the code that makes
sure the benchmarked code won't be optimized away.

Change-Id: Id85013fa4be1912d1c710cd119e9f6f1e77bcff4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373040
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2024-06-26 08:07:11 +00:00
Martin Kustermann
ad6122810a [dart2wasm] Use RunTimeRaw for metric printer in WasmDataTransfer benchmark
Golem config expects RunTimeRaw metric (as we want to see not runs per
second but a more meaningful benchmark, i.e. how much transferring 1KB
of data takes)

=> Golem cannot just display it in different form, we have to make the
    benchmark report it also as RunTimeRaw.
=> This CL should fix the golem benchmarks.

Change-Id: I91301930941986771eb0725fd0d85424bb07dc3a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/372640
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2024-06-21 07:55:16 +00:00
Martin Kustermann
4908814f3a [dart2wasm] Add WasmDataTransfer.* benchmark
Change-Id: I4f7c68cf075081be2643ea8e047af7f02d0c3157
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/372423
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2024-06-20 11:14:16 +00:00
Srujan Gaddam
7ec9514093 [benchmarks] Add Function.toJS benchmark
Adds a benchmark to test converting Dart functions to and
from JS as well as calling them.

Specifically, tests some combinations of the following:
- Converting vs calling functions
- JS vs Dart functions
- Calling instance methods vs static methods vs closure vs
  closures stored in fields

Change-Id: I8f5b63781201042c4068437fe84c3043d6dfb446
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/368064
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2024-06-14 19:42:10 +00:00
William Hesse
1f80809e0d Roll benchmark_harness to version 2.3.0, add new benchmark.
This relands "Add copy of ObjectHash benchmark that uses hardware performance counters"

It lands a roll of benchmark_harness to a new version without
the breaking change in the previous, reverted, roll.
It adds a copy of a benchmark that uses
the new features in benchmark_harness.

Reason for reland: The breaking change is removed from benchmark harness.

Original change's description:
> Revert "Add copy of ObjectHash benchmark that uses hardware performance counters"
>
> This reverts commit faee649175.
>
> Reason for revert: The new version of benchmark_harness breaks cbuild.
>
> Original change's description:
> > Add copy of ObjectHash benchmark that uses hardware performance counters
> >
> > Bug: b/320440992
> > Change-Id: Ia504a59861b2de32c0b82d6bb38491600a37e9ff
> > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/363703
> > Reviewed-by: Jonas Termansen <sortie@google.com>
>
> Bug: b/320440992
> Change-Id: I19bd814c1641243ab0b75f45bc55cdfe27d4bff3
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/363740
> Auto-Submit: Alexander Thomas <athom@google.com>
> Commit-Queue: Emmanuel Pellereau <emmanuelp@google.com>
> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
> Commit-Queue: Ivan Inozemtsev <iinozemtsev@google.com>
> Reviewed-by: Emmanuel Pellereau <emmanuelp@google.com>
> Reviewed-by: Ivan Inozemtsev <iinozemtsev@google.com>

Bug: b/320440992
Change-Id: I101a7ca756a5da5ddf934818325177501c370f23
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/364180
Reviewed-by: Jonas Termansen <sortie@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: William Hesse <whesse@google.com>
2024-04-23 15:19:49 +00:00
Alexander Thomas
6250303b38 Revert "Add copy of ObjectHash benchmark that uses hardware performance counters"
This reverts commit faee649175.

Reason for revert: The new version of benchmark_harness breaks cbuild.

Original change's description:
> Add copy of ObjectHash benchmark that uses hardware performance counters
>
> Bug: b/320440992
> Change-Id: Ia504a59861b2de32c0b82d6bb38491600a37e9ff
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/363703
> Reviewed-by: Jonas Termansen <sortie@google.com>

Bug: b/320440992
Change-Id: I19bd814c1641243ab0b75f45bc55cdfe27d4bff3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/363740
Auto-Submit: Alexander Thomas <athom@google.com>
Commit-Queue: Emmanuel Pellereau <emmanuelp@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Ivan Inozemtsev <iinozemtsev@google.com>
Reviewed-by: Emmanuel Pellereau <emmanuelp@google.com>
Reviewed-by: Ivan Inozemtsev <iinozemtsev@google.com>
2024-04-19 14:37:38 +00:00
William Hesse
faee649175 Add copy of ObjectHash benchmark that uses hardware performance counters
Bug: b/320440992
Change-Id: Ia504a59861b2de32c0b82d6bb38491600a37e9ff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/363703
Reviewed-by: Jonas Termansen <sortie@google.com>
2024-04-19 13:02:55 +00:00
William Hesse
36be5e7318 Avoid lint warning in TearOff benchmark
The throw_in_finally lint rule, which prohibits use of throw
in finally blocks, is enabled in benchmarks/analysis_options.yaml.

This change removes violations of this lint, so IDEs don't show
problems with this file when analyzing the SDK.

Bug: https://github.com/dart-lang/sdk/issues/54808
Change-Id: Idace8fb88ac26b86c2abd73787aafdee6f188af1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/360720
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: William Hesse <whesse@google.com>
2024-04-09 14:40:23 +00:00
Jonas Termansen
b6aa2976dc [benchmarks] Fix benchmarks warming up incorrectly.
The benchmarks were using a range of antipatterns that did not do what
the authors thought they did. It seems that the authors thought the
warmup method has to run for a while and do the full warmup, but the
truth is that the harness will do that for you by running the warmup
function in a timed loop. Instead these patterns just wasted time by
making the warmup more expensive and complex than needed.

This change just removes the warmup overrides since none of them do
anything positive. This change prepares us for future improvements to
the benchmark harness.

Fixes: b/324874055
Change-Id: Ib7c282123a2151614bc95a105a30e67221f11315
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352022
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Jonas Termansen <sortie@google.com>
2024-02-22 14:38:19 +00:00
Martin Kustermann
af1b5b8044 [dart2wasm] Switch binaryen optimization levels from -O3 to -Os
We want dart2wasm be comparable to dart2js / dart2aot, the ladder two
are much more conservative with inlining compared to current dart2wasm.

The -O3 is described in the binaryen sources as agressive for
performance and therefore willing to compromise code size.

The -Os is more nuanced: It will perform many optimizations that are
done in -O3 (and e.g. not in -O2) but it will make inlining less
agressive.

This reduces flute compile-time by 10% and code size by 10%
This benchmark results are mixed (some things get faster, some things
slower). Naturally there'll be specialized micro benchmarks that
get hit hard by this.

Where performance matters we should rather make dart2wasm use better
inlining heuristics and annotate code with
`@pragma('wasm:prefer-inline')`

Change-Id: Idf7e75e4e385629c9cec66359efe0afe50db3e72
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352523
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2024-02-14 13:45:13 +00:00
Alexander Markov
e7eb0aaa20 [benchmarks] Add benchmark for taking tear-offs repeatedly
Issue: https://github.com/dart-lang/sdk/issues/54808
Change-Id: Ice28033bab71e30f9a586564d7e55d9c4f5ce770
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350640
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2024-02-07 15:16:19 +00:00
Oleh Prypin
5a1ef6089c Revert "[ffi]: Remove pointer elementAt method."
This reverts commit f706ff4ee2.

Reason for revert: b/321667799 - package:win32 uses this method - a78ff108fb/lib/src/com/iapplicationactivationmanager.dart (L46)

Original change's description:
> [ffi]: Remove pointer elementAt method.
>
> Closes #54250
>
> TEST=test/ffi
>
> R=dacoharkes@google.com
> Change-Id: I0e88adfcfe3caef0ad3bb6814ad8f27dce5dc7f4
> CoreLibraryReviewExempt: FFI only
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/346380
> Reviewed-by: Daco Harkes <dacoharkes@google.com>
> Commit-Queue: Martin Kustermann <kustermann@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>
> Auto-Submit: Shikhar <shikharish05@gmail.com>

Change-Id: I1b7a48d14e9b85676a27f76a926e21cac9c76c85
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/347600
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2024-01-22 12:20:48 +00:00
Shikhar Soni
f706ff4ee2 [ffi]: Remove pointer elementAt method.
Closes #54250

TEST=test/ffi

R=dacoharkes@google.com
Change-Id: I0e88adfcfe3caef0ad3bb6814ad8f27dce5dc7f4
CoreLibraryReviewExempt: FFI only
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/346380
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Auto-Submit: Shikhar <shikharish05@gmail.com>
2024-01-22 11:34:18 +00:00
Stephen Adams
4a25eae660 [benchmark] Utf8Decode chunked and polymorphic benchmark
This benckmark complements the existing `Utf8Decode` benchmarks by exploring different scenarios. There are three axes of variation - input complexity, conversion type, and polymorphism.


Change-Id: I06706e8efd1b254d65c7abee9f29e6d0b10923ed
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/335504
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2023-11-15 18:21:23 +00:00
Sam Rawlins
93541c708c linter: Remove two deprecated linter rules
Fixes https://github.com/dart-lang/linter/issues/4800

Change-Id: I4eef17ca19ea7469fba372c28eef7618249c48dd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/334080
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2023-11-09 17:03:15 +00:00
Jacob Richman
933537b66b Trivial cleanup to make VSCode workspace for the SDK
free of diagnostics as long as you filter with "!TODO"

R=athom@google.com, jensj@google.com, natebiggs@google.com

Change-Id: I73cf3c5ef6dab81808330c4eb5f44cb62e753c81
Tested: manually verified that VSCode is warning free. No changes in functionality.
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/333903
Auto-Submit: Jacob Richman <jacobr@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
Commit-Queue: Jacob Richman <jacobr@google.com>
2023-11-07 17:49:53 +00:00
Stephen Adams
5239a7836e [benchmarks] Update TypedDataPoly benchmark
Update TypedDataPoly benchmark to use `asUnmodifiableView()` instead
of the deprecated typed data view constructors.

Bug: #53785
Change-Id: I02381e3db37f44b01da25d7cbd728b525ff4899e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332161
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2023-10-27 16:56:03 +00:00
Jonas Termansen
c349f992a6 [benchmark] Rename dds to dds_aot in SDKArtifactSizes.
Bug: b/298173463
Change-Id: Ia9d1672e2561e6b35ed5d3c88f8704628857ce7b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/328480
Commit-Queue: William Hesse <whesse@google.com>
Auto-Submit: Jonas Termansen <sortie@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2023-10-27 12:23:23 +00:00
Alexander Aprelev
05274b2592 [benchmark] Add benchmark prefix to UiMatrix benchmark.
Change-Id: I208a06355a233ff1c07c9be494cc2676d8d485ea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/326685
Reviewed-by: Jonas Termansen <sortie@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2023-09-18 22:41:23 +00:00
Alexander Aprelev
bc5008a023 [benchmark] Add uimatrix benchmark.
https://github.com/yjbanov/uimatrix is WIP, but already proved useful to highlight areas for some performance improvement.

Change-Id: I8f86163e91e276ee4195b7d5c635ffbf3dbaa075
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325320
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
2023-09-13 15:27:37 +00:00
William Hesse
69d5249e7f [benchmarks] Publish some more Dart benchmarks
Publish some TypedData and ForLoop benchmarks to the Dart sdk repo.
The benchmarks, authored by the Dart project, were previously
in the benchmark-internal repository.

Bug: b/298617448
Change-Id: I3327553ac5feca51a2f978e7d9b9c96fac2af121
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/323840
Commit-Queue: William Hesse <whesse@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
2023-09-04 15:57:53 +00:00
Martin Kustermann
4d4a922638 [benchmarks] Remove unnecessary utf8.encode() as Uint8List downcast
The return type of `utf8.encode()` was made more precise in [0] (from
`List<int>` to `Uint8List`)

[0] https://dart-review.googlesource.com/c/sdk/+/254903

TEST=ci

Change-Id: I3e578ac8dc5f3f66396cb374e3dcadd989919518
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/321860
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2023-08-21 08:21:37 +00:00
Tess Strickland
4af0a59e8c [benchmarks] Change the MemoryCopy memcpy benchmarks to use memmove.
While our benchmarks don't involve overlapping memory between source
and destination, general methods for copying between TypedData must.
Thus, our benchmark for using the C interface via FFI must use memmove
instead of memcpy.

To avoid having to update our benchmark configurations, the name of
that benchmark is unchanged.

In addition, this CL adds filtering for benchmark names and turning on
and off specific outputs for quick comparisons when running manually.

Change-Id: I20616549d8bc9ab481884846d3f13df20a3c854e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/319981
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2023-08-11 13:17:17 +00:00
Tess Strickland
7f943ea210 [benchmarks] Fix MemoryCopy when elapsed time is too small.
Otherwise, we might get +Inf which will then fail on the conversion
to an integer in ceil().

Change-Id: Ibba49257e6801894f1e7724aa7a998ba579f7be3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/319520
Auto-Submit: Tess Strickland <sstrickl@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2023-08-09 15:28:55 +00:00
Tess Strickland
d984fd77f6 [benchmarks] Add MemoryCopy benchmark suite.
The MemoryCopy benchmark suite measures the overhead of copying
data between compatible TypedData or Pointer values.

Change-Id: Iaf5ea27b7f9177f4800880da36234afd2b908db2
Bug: https://github.com/dart-lang/sdk/issues/42072
Bug: b/294114694
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/318661
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2023-08-09 13:28:44 +00:00
Tess Strickland
51ae7c7b9d [benchmarks] Add verbose flag to FfiStructCopy benchmark suite.
Change-Id: I28ab6c85db3705224a59f80ea3c13a78a141c851
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/318923
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2023-08-08 11:59:29 +00:00
William Hesse
ea5840c2c5 [benchmarks] Update legacy benchmarks to use the List.filled constructor
The legacy Dart 2.9 benchmarks that used the default List(int size)
constructor are changed to use the equivalent List.filled(size, null)
constructor, because the default List constructor is removed.

Bug: b/280275041
Change-Id: I2813537ae22e19d473abde70d677368940585423
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/304700
Reviewed-by: Jonas Termansen <sortie@google.com>
Commit-Queue: William Hesse <whesse@google.com>
2023-05-22 14:14:42 +00:00
Eric Seidel
4c20cedd30 Fix analysis issues in benchmarks/ directory
Now that I'm able to open the entire SDK in VSC, I'm fixing some
of the analysis issues in various files (carefully) without changing
their meaning.

In this case, I removed unnecessary imports from benchmarks.
In regexp_benchmark I ignored one warning which likely would
have changed the behavior of the code.

BUG=https://github.com/dart-lang/sdk/issues/52419

Change-Id: I9a195a4e45121313bd9f065f2579a165c3fec05b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/303901
Auto-Submit: Eric Seidel <eric@shorebird.dev>
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: William Hesse <whesse@google.com>
2023-05-17 09:14:50 +00:00
Daco Harkes
4af8469493 [benchmarks/ffi] Cleanup benchmarks
* Added a name-filter to every benchmark.
* Addressed lints.
* We don't run the legacy copies anymore, so deleted dart2 dirs.

Change-Id: I65705749c5c90aad77d1fb93ea4a0d4e8b656cd4
Cq-Include-Trybots: luci.dart.try:benchmark-linux-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/301522
Reviewed-by: Jonas Termansen <sortie@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2023-05-09 09:50:24 +00:00
Tess Strickland
33cffa0b47 [benchmarks] Add new benchmarks for subtype test cache stubs.
Change-Id: I7a169b8c865d88c70e25b8ea5349332968cd9c81
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/300241
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2023-05-02 13:25:08 +00:00
Jake Macdonald
08e73523f6 - migrate sound_splay_tree.dart to null safety
- exclude from analysis all dart 2 benchmarks

This reduces the analysis errors when opening up the SDK significantly.

Change-Id: I9e1c4f7e4b790e4962ea2112a293bf0ef5402b10
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/292440
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Kallen Tu <kallentu@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
2023-04-05 15:57:33 +00:00
Stephen Adams
c0c6ff4754 [benchmark] Add RecordCollections and Iterators to Omnibus{Deferred}
Change-Id: Ib07b1faadb19b6656813cb92ef65243cc4f0c91e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/293385
Commit-Queue: Stephen Adams <sra@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Auto-Submit: Stephen Adams <sra@google.com>
2023-04-05 01:05:32 +00:00
Daco Harkes
92e5746494 Reland "[vm/ffi] Add class modifiers"
This is a reland of commit 1755f89092

Can land after (or with) the Flutter PR:
https://github.com/flutter/engine/pull/40434

Original change's description:
> [vm/ffi] Add class modifiers
>
> Adds class modifiers to `dart:ffi`.
>
> Migrates all user-defined subclasses of `Struct`, `Union`, `Opaque`,
> and `AbiSpecificInteger` to be `final class`es.
>
> Does not remove the manual error checking, so some errors will show up
> twice now in language version 3.0. In language version <3.0, only the
> FFI-specific error will show up.
>
> In a follow-up CL, we will try to make the language-errors to show up
> also <3.0 so that we can remove the FFI-specific errors.
>
> Examples of duplicated errors:
> pkg/analyzer/test/src/diagnostics/subtype_of_ffi_class_test.dart
>
> TEST=pkg/analyzer/test/ (for the analyzer)
> TEST=pkg/front_end/testcases/ (for the CFE)
> TEST=test/ffi/ (for the VM)
>
> CoreLibraryReviewExempt: No need for dart2js to review.
> Bug: https://github.com/dart-lang/sdk/issues/51683
> Change-Id: I2964ceccb7db59fbdaf6be5319f5e4ec2dabe0f3
> Cq-Include-Trybots: luci.dart.try:pkg-linux-debug-try,pkg-win-release-try,pkg-mac-release-try,vm-precomp-ffi-qemu-linux-release-riscv64-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-ffi-android-debug-arm64c-try,vm-ffi-android-debug-arm-try,vm-reload-rollback-linux-debug-x64-try,analyzer-analysis-server-linux-try,analyzer-linux-release-try
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289223
> Reviewed-by: Johnni Winther <johnniwinther@google.com>
> Reviewed-by: Devon Carew <devoncarew@google.com>
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
> Reviewed-by: Jackson Gardner <jacksongardner@google.com>
> Reviewed-by: Lasse Nielsen <lrn@google.com>
> Commit-Queue: Daco Harkes <dacoharkes@google.com>

TEST=pkg/analyzer/test/ (for the analyzer)
TEST=pkg/front_end/testcases/ (for the CFE)
TEST=test/ffi/ (for the VM)
CoreLibraryReviewExempt: No need for dart2js to review.
Bug: https://github.com/dart-lang/sdk/issues/51683
Change-Id: I2ee3f0ac31d4162068a2346a06320029b2263ee2
Cq-Include-Trybots: luci.dart.try:pkg-linux-debug-try,pkg-win-release-try,pkg-mac-release-try,vm-precomp-ffi-qemu-linux-release-riscv64-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-ffi-android-debug-arm64c-try,vm-ffi-android-debug-arm-try,vm-reload-rollback-linux-debug-x64-try,analyzer-analysis-server-linux-try,analyzer-linux-release-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289781
Reviewed-by: Devon Carew <devoncarew@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-03-21 15:25:10 +00:00
Zach Anderson
7471994270 Revert "[vm/ffi] Add class modifiers"
This reverts commit 1755f89092.

Reason for revert: This is a breaking change and is blocking the Dart -> Flutter roll. See https://ci.chromium.org/ui/p/flutter/builders/try/Mac%20Unopt/26896/overview.

Original change's description:
> [vm/ffi] Add class modifiers
>
> Adds class modifiers to `dart:ffi`.
>
> Migrates all user-defined subclasses of `Struct`, `Union`, `Opaque`,
> and `AbiSpecificInteger` to be `final class`es.
>
> Does not remove the manual error checking, so some errors will show up
> twice now in language version 3.0. In language version <3.0, only the
> FFI-specific error will show up.
>
> In a follow-up CL, we will try to make the language-errors to show up
> also <3.0 so that we can remove the FFI-specific errors.
>
> Examples of duplicated errors:
> pkg/analyzer/test/src/diagnostics/subtype_of_ffi_class_test.dart
>
> TEST=pkg/analyzer/test/ (for the analyzer)
> TEST=pkg/front_end/testcases/ (for the CFE)
> TEST=test/ffi/ (for the VM)
>
> CoreLibraryReviewExempt: No need for dart2js to review.
> Bug: https://github.com/dart-lang/sdk/issues/51683
> Change-Id: I2964ceccb7db59fbdaf6be5319f5e4ec2dabe0f3
> Cq-Include-Trybots: luci.dart.try:pkg-linux-debug-try,pkg-win-release-try,pkg-mac-release-try,vm-precomp-ffi-qemu-linux-release-riscv64-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-ffi-android-debug-arm64c-try,vm-ffi-android-debug-arm-try,vm-reload-rollback-linux-debug-x64-try,analyzer-analysis-server-linux-try,analyzer-linux-release-try
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289223
> Reviewed-by: Johnni Winther <johnniwinther@google.com>
> Reviewed-by: Devon Carew <devoncarew@google.com>
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
> Reviewed-by: Jackson Gardner <jacksongardner@google.com>
> Reviewed-by: Lasse Nielsen <lrn@google.com>
> Commit-Queue: Daco Harkes <dacoharkes@google.com>

Bug: https://github.com/dart-lang/sdk/issues/51683
Change-Id: Ie5b8a08aea6d64b1991ace4814322b21ffb670c7
Cq-Include-Trybots: luci.dart.try:pkg-linux-debug-try,pkg-win-release-try,pkg-mac-release-try,vm-precomp-ffi-qemu-linux-release-riscv64-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-ffi-android-debug-arm64c-try,vm-ffi-android-debug-arm-try,vm-reload-rollback-linux-debug-x64-try,analyzer-analysis-server-linux-try,analyzer-linux-release-try
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289640
Commit-Queue: Slava Egorov <vegorov@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2023-03-20 11:15:59 +00:00
Daco Harkes
1755f89092 [vm/ffi] Add class modifiers
Adds class modifiers to `dart:ffi`.

Migrates all user-defined subclasses of `Struct`, `Union`, `Opaque`,
and `AbiSpecificInteger` to be `final class`es.

Does not remove the manual error checking, so some errors will show up
twice now in language version 3.0. In language version <3.0, only the
FFI-specific error will show up.

In a follow-up CL, we will try to make the language-errors to show up
also <3.0 so that we can remove the FFI-specific errors.

Examples of duplicated errors:
pkg/analyzer/test/src/diagnostics/subtype_of_ffi_class_test.dart

TEST=pkg/analyzer/test/ (for the analyzer)
TEST=pkg/front_end/testcases/ (for the CFE)
TEST=test/ffi/ (for the VM)

CoreLibraryReviewExempt: No need for dart2js to review.
Bug: https://github.com/dart-lang/sdk/issues/51683
Change-Id: I2964ceccb7db59fbdaf6be5319f5e4ec2dabe0f3
Cq-Include-Trybots: luci.dart.try:pkg-linux-debug-try,pkg-win-release-try,pkg-mac-release-try,vm-precomp-ffi-qemu-linux-release-riscv64-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-ffi-android-debug-arm64c-try,vm-ffi-android-debug-arm-try,vm-reload-rollback-linux-debug-x64-try,analyzer-analysis-server-linux-try,analyzer-linux-release-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289223
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Jackson Gardner <jacksongardner@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2023-03-17 19:29:41 +00:00
Ben Konyi
dcd65d0122 [ Benchmarks ] Update SDKArtifactSizes benchmarks to include dart2wasm and DevTools
TEST=N/A

Change-Id: I8633762410c9df753f147b3010294ed56e82e6ee
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289520
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Sigurd Meldgaard <sigurdm@google.com>
2023-03-17 16:08:02 +00:00
Daco Harkes
c1aa671a4d [benchmarks/ffi] FfiCall macos_arm64 support
We're not running benchmarks on M1s, but it's useful to be able to.

TEST=manually tested locally

Change-Id: Ic42ed8e4e61e7590ea03734f46fbec8b955be2ff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/288203
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
2023-03-13 14:07:16 +00:00
Stephen Adams
6ca7571e2b [benchmark] Benchmark for switch on various constant types
AOT:
SwitchFSM.enum(RunTime): 29.549523327947906 us.
SwitchFSM.int(RunTime): 37.73789702628717 us.
SwitchFSM.class(RunTime): 138.6418530572675 us.
SwitchFSM.string(RunTime): 797.54075 us.

dart2js+V8:
SwitchFSM.enum(RunTime): 31.484299349840917 us.
SwitchFSM.int(RunTime): 26.022895908416366 us.
SwitchFSM.class(RunTime): 91.67433302667894 us.
SwitchFSM.string(RunTime): 92.31338451577098 us.

Both AOT and dart2js are 'good at' switches on enum values.

When compiled with --enable-experiment=records,patterns:

AOT:
SwitchFSM.enum(RunTime): 141.75470079359405 us.
SwitchFSM.int(RunTime): 145.25322604030737 us.
SwitchFSM.class(RunTime): 138.45460840662005 us.
SwitchFSM.string(RunTime): 797.226 us.

dart2js+V8:
SwitchFSM.enum(RunTime): 98.93787283573403 us.
SwitchFSM.int(RunTime): 29.459852700736498 us.
SwitchFSM.class(RunTime): 98.62184338405162 us.
SwitchFSM.string(RunTime): 92.035889371936 us.

There is work to be done to recover the performance.

Change-Id: I1197129cb32615a06a63a05d7ba300b46c68b4d2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287246
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2023-03-10 04:21:13 +00:00
Brian Quinlan
b04cb92b73 Await the benchmark reports
Change-Id: I9de7fdbadcf454b1d2069580a0e5c96722b3c7ca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287620
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
2023-03-08 22:38:21 +00:00
Daco Harkes
1c08a41f16 [benchmarks/ffi] Add @Native calls to FfiCall benchmark
The benchmarks contain some duplicated code, but we want to avoid
starting to measure indirection and the compiler not inlining in
these benchmarks, so it's better to keep them as plain as possible.

Bug: https://github.com/dart-lang/sdk/issues/47625
Change-Id: I7fedd31ce6df83bde3931835ae4e493a252d25b6
Cq-Include-Trybots: luci.dart.try:benchmark-linux-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284340
Auto-Submit: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2023-03-02 15:23:16 +00:00
Alexander Markov
8627463c23 [tests, benchmarks] Reformat using new Dart formatter
Certain tests and benchmarks are reformatted using the new version of
"dart format" which supports records.

TEST=ci

Change-Id: I6132e8000317bfcc56c8d96682dc9771c728076d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286201
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2023-03-01 18:15:09 +00:00
Brian Quinlan
987a45da4a [io] Add a benchmark for the IOSink returned by File.openWrite
Change-Id: Ic27d24633a305d0567c19f3694b1a477b3a1eef2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285706
Commit-Queue: Brian Quinlan <bquinlan@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2023-02-28 20:40:40 +00:00
Daco Harkes
675d0dc6fc [benchmarks/ffi] Generate repetitive FfiCall benchmark
This makes it easier to maintain and extend this benchmark.
Benchmark results should not change by this CL.

Deletes the legacy version of this benchmark.

Satisfies lints in this benchmark.

Closes: https://github.com/dart-lang/sdk/issues/37581
Change-Id: Icf03d0f4f0e668f9d4a843b11d8ef1565b404ca4
Cq-Include-Trybots: luci.dart.try:benchmark-linux-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284142
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2023-02-23 20:50:09 +00:00
Lasse R.H. Nielsen
bee7ab2b32 Make record positional field getters start at $1.
An update for co19 is available at https://github.com/dart-lang/co19/pull/1759

TEST=Existing tests run after change, two new tests for edge cases.

Change-Id: I408e398d532ba2c2e8e60777bb4f7bd0057e27fe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278912
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2023-01-30 08:14:28 +00:00
Alexander Thomas
b9b6511ca6 Spelling sdk
Closes https://github.com/dart-lang/sdk/pull/50918

Co-authored-by: Josh Soref <jsoref@gmail.com>
GitOrigin-RevId: 1fd275051c561b63d374fb47e76a22424c4a12a9
Change-Id: I97790d9c79ff659f2c1fa2d2d46d041fe67957cb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278530
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
2023-01-20 12:37:49 +00:00
Josh Soref
9e4dc755cb Spelling pkg
Closes https://github.com/dart-lang/sdk/pull/50921

GitOrigin-RevId: 6b1ca502b6722b0a987f33ace66f65cbd2c24e23
Change-Id: I74e4ff3c8e759c576036d6b791bd7734ebd215d8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278536
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2023-01-19 10:06:29 +00:00
Josh Soref
1ab011a2a7 Spelling tests web
Closes https://github.com/dart-lang/sdk/pull/50879

TEST=only changes to spelling to comments and internal string messages
GitOrigin-RevId: 3fa4104fa17054ea2247118a1b6213c62f2749e0
Change-Id: I776120bb2492c662dd32612dd2f6a670b5891e42
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278060
Reviewed-by: Michael Thomsen <mit@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2023-01-05 01:26:52 +00:00
Martin Kustermann
150635653e Revert accidental change in ObjectHash benchmark
The change in [0] made ObjectHash.hash.5 benchmark accidentally hash one
more value (i.e. 6 instead of 5). This CL reverts that change.

[0] https://dart-review.googlesource.com/c/sdk/+/276161

TEST=ci

Change-Id: Idee8cd445683b89d1a4013beae3ea544a5e3a8e5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277988
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
2023-01-03 09:50:38 +00:00
Lasse R.H. Nielsen
ece7da8009 Make final parameter of SystemHash.hashX not be optional.
Issue https://github.com/dart-lang/sdk/issues/50693

Change-Id: Ib587b70bcb57cbd2d16319b7814e2569c7e41213
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276161
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2023-01-02 12:44:23 +00:00
Daco Harkes
a7163dba81 [benchmarks/ffi] Add FfiStructCopy benchmark
`_memCopy` inside `dart:ffi` is currently doing a per-byte copy in
Dart. This is rather slow, we should optimize this with the
`MemoryCopyInstr` in the VM.

This CL adds benchmarks to report the number of bytes copied per
second.

Adds only benchmarks with copies of 32^(0..3), as non-power-of-two
benchmarks did not seem to behave differently.

Since legacy mode is no longer benchmarked, the dart2 version of this
benchmark is omitted.

Benchmarks set up according to
https://dart-review.googlesource.com/c/sdk/+/200188

Bug: https://github.com/dart-lang/sdk/issues/43967
Change-Id: I3d9be8de725820fd3365a7dc85d15174bddc1ae6
Cq-Include-Trybots: luci.dart.try:benchmark-linux-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277522
Reviewed-by: Jonas Termansen <sortie@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2022-12-29 10:21:19 +00:00