Skip to content
This repository was archived by the owner on Feb 4, 2025. It is now read-only.

Add --watch to _macro_tool for analyzer. #99

Merged
merged 1 commit into from
Oct 11, 2024

Conversation

davidmorgan
Copy link
Contributor

So we get a first idea where we are w.r.t. performance #94.

I'm a little surprised the analyzer integration already works for changes to the script file, since we didn't test that :) as far as I can tell it just sends additional AugmentationRequest instances to the macro, no rebuild/relaunch of the macro.

I am not surprised that it looks fairly slow right now :) 2.7 seconds for a rerun+reanalyze of json_codable_test.dart.

dart ~/git/macros/pkgs/_macro_tool/bin/main.dart --workspace=. --packageConfig=../../.dart_tool/package_config.json --script=lib/json_codable_test.dart --host=analyzer --watch
Running json_codable_test.dart with macros on analyzer.
~~~
Package config: /usr/local/google/home/davidmorgan/git/macros/.dart_tool/package_config.json
Workspace: /usr/local/google/home/davidmorgan/git/macros/goldens/foo
Script: /usr/local/google/home/davidmorgan/git/macros/goldens/foo/lib/json_codable_test.dart
Resolved in 9734ms.
Macro output (patched to use augment library): /usr/local/google/home/davidmorgan/git/macros/goldens/foo/lib/json_codable_test.dart.macro_tool_output
Running with --watch, waiting for next change to script.
Script changed, rerunning macro.
Resolved in 2775ms.
Macro output (patched to use augment library): /usr/local/google/home/davidmorgan/git/macros/goldens/foo/lib/json_codable_test.dart.macro_tool_output
Running with --watch, waiting for next change to script.
Script changed, rerunning macro.
Resolved in 2705ms.

@davidmorgan davidmorgan requested a review from jakemac53 October 11, 2024 13:11
@davidmorgan davidmorgan merged commit a482288 into dart-archive:main Oct 11, 2024
45 checks passed
@davidmorgan davidmorgan deleted the macro-tool-watch branch October 11, 2024 14:56
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants