commit | c2bdda63f58cc76379d01475bcd8e915bb93969a | [log] [tgz] |
---|---|---|
author | Brian Quinlan <bquinlan@google.com> | Mon Mar 13 22:39:13 2023 +0000 |
committer | Commit Queue <dart-scoped@luci-project-accounts.iam.gserviceaccount.com> | Mon Mar 13 22:39:13 2023 +0000 |
tree | 5f4d2d09f10589e996189d8d1a585147be50ef45 | |
parent | dde0acbd83b5a0de1daaee8d27cc75e8ca9ceb4a [diff] |
[io] Improve the performance of the IOSink returned by `openWrite` by writing eagerly and accumulating small writes. Benchmarks (benchmarks/FileIOSink/dart/FileIOSink.dart): @before: FileIOSink.Add.ManySmall(RunTime): 2341597.0 us. FileIOSink.Add.OneLarge(RunTime): 111.06925927974774 us. FileIOSink.Add.AlternatingAddSize(RunTime): 105.65958788898234 us. @after FileIOSink.Add.ManySmall(RunTime): 5007.1125 us. FileIOSink.Add.OneLarge(RunTime): 98.23492468475541 us. FileIOSink.Add.AlternatingAddSize(RunTime): 91.77411527720551 us. So the relative performance changes are: FileIOSink.Add.ManySmall(RunTime): 0.00213x (MUCH faster) FileIOSink.Add.OneLarge(RunTime): 0.884x (slight faster - noise?) FileIOSink.Add.AlternatingAddSize(RunTime): 0.868x (slightly faster - noise?) https://golem.corp.goog/Revision?repository=dart&revision=102771&patch=17842 Change-Id: Ic73f33299a570096dd05f254982f556767559966 Bug:https://github.com/dart-lang/sdk/issues/32874 Tested: unit tests CoreLibraryReviewExempt: Performance-only fix for file writes in the VM. Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285420 Commit-Queue: Brian Quinlan <bquinlan@google.com> Reviewed-by: Alexander Aprelev <aam@google.com>
Dart is:
Optimized for UI: Develop with a programming language specialized around the needs of user interface creation.
Productive: Make changes iteratively: use hot reload to see the result instantly in your running app.
Fast on all platforms: Compile to ARM & x64 machine code for mobile, desktop, and backend. Or compile to JavaScript for the web.
Dart's flexible compiler technology lets you run Dart code in different ways, depending on your target platform and goals:
Dart Native: For programs targeting devices (mobile, desktop, server, and more), Dart Native includes both a Dart VM with JIT (just-in-time) compilation and an AOT (ahead-of-time) compiler for producing machine code.
Dart Web: For programs targeting the web, Dart Web includes both a development time compiler (dartdevc) and a production time compiler (dart2js).
Dart is free and open source.
See LICENSE and PATENT_GRANT.
Visit dart.dev to learn more about the language, tools, and to find codelabs.
Browse pub.dev for more packages and libraries contributed by the community and the Dart team.
Our API reference documentation is published at api.dart.dev, based on the stable release. (We also publish docs from our beta and dev channels, as well as from the primary development branch).
If you want to build Dart yourself, here is a guide to getting the source, preparing your machine to build the SDK, and building.
There are more documents on our wiki.
The easiest way to contribute to Dart is to file issues.
You can also contribute patches, as described in Contributing.