This makes https://dart-review.googlesource.com/c/sdk/+/361160/1 about 30% faster. Before: [time: 9800 ms] (name: <scheduler>, count: 0, elapsed: 0:00:00.000000, elapsedSelf: -0:00:09.676162) (name: analyzeFile, count: 104, elapsed: 0:00:09.676162, elapsedSelf: 0:00:01.122336) (name: libraryContext, count: 104, elapsed: 0:00:08.553826, elapsedSelf: 0:00:00.370620)(bytesPut: 5378632, cycleCount: 9, libraryCount: 115) (name: link, count: 9, elapsed: 0:00:08.183206, elapsedSelf: 0:00:00.273932) (name: computeLibraryScopes, count: 9, elapsed: 0:00:00.137679, elapsedSelf: 0:00:00.073448) (name: buildMacroApplier, count: 9, elapsed: 0:00:00.064103, elapsedSelf: 0:00:00.064103) (name: executeMacroTypesPhase, count: 9, elapsed: 0:00:00.000128, elapsedSelf: 0:00:00.000128) (name: executeMacroDeclarationsPhase, count: 9, elapsed: 0:00:00.211514, elapsedSelf: 0:00:00.211514)(constructorsOf: 100, methodsOf: 100) (name: executeMacroDefinitionsPhase, count: 9, elapsed: 0:00:07.163251, elapsedSelf: 0:00:00.001486) (name: macroApplier.executeDefinitionsPhase, count: 315, elapsed: 0:00:06.532745, elapsedSelf: 0:00:00.008799)(constructorsOf: 20300, methodsOf: 20300, resolve: 42000, typeDeclarationOf: 41200) (name: macroExecutor.executeDefinitionsPhase, count: 200, elapsed: 0:00:06.523946, elapsedSelf: 0:00:06.523946) (name: addMacroResults, count: 200, elapsed: 0:00:00.629020, elapsedSelf: 0:00:00.629020) (name: mergeMacroAugmentations, count: 9, elapsed: 0:00:00.396830, elapsedSelf: 0:00:00.396830) After: [time: 6871 ms] (name: <scheduler>, count: 0, elapsed: 0:00:00.000000, elapsedSelf: -0:00:06.742687) (name: analyzeFile, count: 104, elapsed: 0:00:06.742687, elapsedSelf: 0:00:01.014164) (name: libraryContext, count: 104, elapsed: 0:00:05.728523, elapsedSelf: 0:00:00.195590)(bytesPut: 5378632, cycleCount: 9, libraryCount: 115) (name: link, count: 9, elapsed: 0:00:05.316310, elapsedSelf: 0:00:00.278338) (name: computeLibraryScopes, count: 9, elapsed: 0:00:00.128982, elapsedSelf: 0:00:00.056258) (name: buildMacroApplier, count: 9, elapsed: 0:00:00.072625, elapsedSelf: 0:00:00.072625) (name: executeMacroTypesPhase, count: 9, elapsed: 0:00:00.000099, elapsedSelf: 0:00:00.000099) (name: executeMacroDeclarationsPhase, count: 9, elapsed: 0:00:00.223973, elapsedSelf: 0:00:00.223973)(constructorsOf: 100, methodsOf: 100) (name: executeMacroDefinitionsPhase, count: 9, elapsed: 0:00:04.264144, elapsedSelf: 0:00:00.001345) (name: executeDefinitionsPhase, count: 315, elapsed: 0:00:03.622893, elapsedSelf: 0:00:03.622893)(constructorsOf: 300, methodsOf: 300, resolve: 42000, typeDeclarationOf: 41200) (name: addMacroResults, count: 200, elapsed: 0:00:00.639906, elapsedSelf: 0:00:00.639906) (name: mergeMacroAugmentations, count: 9, elapsed: 0:00:00.420873, elapsedSelf: 0:00:00.420873) (name: macroCompileKernel, count: 1, elapsed: 0:00:00.216623, elapsedSelf: 0:00:00.216623) Change-Id: Ica435904e9a0f686c91e7703262687c110600983 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/361622 Commit-Queue: Konstantin Shcheglov <scheglov@google.com> Reviewed-by: Jake Macdonald <jakemac@google.com>
☠☠ Warning: This package is experimental and may not be available in a future version of Dart. ☠☠
This package is for macro authors, and exposes the APIs necessary to write
a macro. Specifically, it exports the private _macros SDK vendored package.
Macro authors
Macro authors can use normal constraints on this package, and should only import
the package:macros/macros.dart file.
Note that the versions of this package are tied directly to your SDK version, so you won't be able to get new feature releases without updating your SDK.
Compilers and tools
This package also exposes some "private" sources (under lib/src), intended only for use by compilers and tools, in order to bootstrap and execute macros.
When depending on these "private" sources, a more narrow constraint should be
used, which constraints to feature releases (which means patch versions until
such time as this package goes to 1.0.0). For example,
macros: ">=0.1.1 <0.1.2".