[analyzer] Remove regex in DartdocDirectiveInfo.extractTemplate Data from `valgrind --tool=callgrind`: Before: `DartdocDirectiveInfo.extractFromUnit` is at ~186 mio with `DartdocDirectiveInfo.extractTemplate` costing ~125 mio Now: `DartdocDirectiveInfo.extractFromUnit` is at ~106 mio with `DartdocDirectiveInfo.extractTemplate` costing ~45 mio Saving: ~80 mio Total ICs goes from 40,213,854,370 to 40,120,379,441 --- a ~93 mio saving. Probably because of 14,148,946 less instructions in `dart::Scavenger::TryAllocateNewTLAB`... Running the benchmarker (which runs `perf stat`) says: Normal GC: ``` task-clock:u: 1.5667% +/- 0.8994% (176854617.80 +/- 101524587.84) (11288053844.40 -> 11464908462.20) page-faults:u: -0.6488% +/- 0.0448% (-1258.60 +/- 86.92) (194000.80 -> 192742.20) cycles:u: 1.5262% +/- 0.7400% (726682511.40 +/- 352348644.40) (47612955361.40 -> 48339637872.80) instructions:u: 0.9768% +/- 0.0015% (559490177.40 +/- 879495.32) (57280641756.00 -> 57840131933.40) branch-misses:u: 4.2985% +/- 3.5545% (7755058.00 +/- 6412676.26) (180411259.20 -> 188166317.20) seconds time elapsed: 1.5629% +/- 0.8966% (0.18 +/- 0.10) (11.29 -> 11.47) seconds user: 1.6461% +/- 0.9382% (0.18 +/- 0.10) (10.93 -> 11.11) maxRssKbytes: 0.7869% +/- 0.0178% (4852.80 +/- 109.61) (616688.80 -> 621541.60) maxRssBytes: 0.7869% +/- 0.0178% (4969267.20 +/- 112237.34) (631489331.20 -> 636458598.40) Comparing GC data: Scavenge( new space) goes from 173 to 172 MarkSweep( old space) goes from 1 to 0 Notice combined GC time goes from 3577 ms to 3647 ms (notice only 1 run each). ``` GC disabled: ``` task-clock:u: -0.6269% +/- 0.4868% (-119642101.80 +/- 92900467.80) (19083506432.00 -> 18963864330.20) page-faults:u: -0.0239% +/- 0.0001% (-297.20 +/- 1.08) (1245278.60 -> 1244981.40) cycles:u: -0.6443% +/- 0.5443% (-474993485.80 +/- 401307649.98) (73726665028.40 -> 73251671542.60) instructions:u: -0.1969% +/- 0.0018% (-78882198.40 +/- 720592.45) (40060467059.80 -> 39981584861.40) seconds time elapsed: -0.6242% +/- 0.4824% (-0.12 +/- 0.09) (19.09 -> 18.98) maxRssKbytes: -0.0232% +/- 0.0025% (-1157.60 +/- 122.95) (4995760.80 -> 4994603.20) maxRssBytes: -0.0232% +/- 0.0025% (-1185382.40 +/- 125903.93) (5115659059.20 -> 5114473676.80) ``` So probably some shift in when GC happens causes it to look worse with normal GC, but with GC disabled to decreases the cost by ~79 mio instructions. Change-Id: Idcafb28bc09dd4b1d5249478d0a1d32a7a2d68b1 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/487900 Reviewed-by: Johnni Winther <johnniwinther@google.com> Commit-Queue: Jens Johansen <jensj@google.com>
Dart is:
Approachable: Develop with a strongly typed programming language that is consistent, concise, and offers modern language features like null safety and patterns.
Portable: Compile to ARM, x64, or RISC-V machine code for mobile, desktop, and backend. Compile to JavaScript or WebAssembly for the web.
Productive: Make changes iteratively: use hot reload to see the result instantly in your running app. Diagnose app issues using DevTools.
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 in our repo at docs.
The easiest way to contribute to Dart is to file issues.
You can also contribute patches, as described in Contributing.
Future plans for Dart are included in the combined Dart and Flutter roadmap on the Flutter wiki.