Convert many fields on Container and TopLevelContainer to getters#3710
Merged
Conversation
These were late, final, and public, my least favorite thing. The idea, historically, behind late final fields in dartdoc is caching. If a value is expensive to calculate, like a big list of things, and we have to access that value a few times, best to calculate it once. But some late final fields are only accessed while rendering HTML, accessed from the rendered templates. And typically only accessed once. The '*Sorted' fields definitely fall into this bucket. So I made them all getters, and then benchmarked with the googleapis package, and found no significant change in time-to-document, or max RSS.
kallentu
approved these changes
Mar 9, 2024
copybara-service Bot
pushed a commit
to dart-lang/sdk
that referenced
this pull request
Mar 11, 2024
Revisions updated by `dart tools/rev_sdk_deps.dart`. async (https://github.com/dart-lang/async/compare/6cdbc41..1556660): 1556660 2024-03-07 Kevin Moore Test on wasm (dev) and JS (dart-archive/async#269) dartdoc (https://github.com/dart-lang/dartdoc/compare/0de8aff..ef990e7): ef990e79 2024-03-10 dependabot[bot] Bump actions/cache from 4.0.0 to 4.0.1 (dart-lang/dartdoc#3700) 962d68fe 2024-03-08 Sam Rawlins Convert many fields on Container and TopLevelContainer to getters (dart-lang/dartdoc#3710) 353b426c 2024-03-08 Kallen Tu Remove unresolved-export warning. (dart-lang/dartdoc#3711) cdcbf6d8 2024-03-08 Kallen Tu Change mixin implements and remove unused Extendable. (dart-lang/dartdoc#3709) da7071d5 2024-03-08 Sam Rawlins Display an extension's extended type in a few places. (dart-lang/dartdoc#3708) 3d56168d 2024-03-08 Sam Rawlins Add some help messages to tool/task.dart (dart-lang/dartdoc#3707) 4f849678 2024-03-07 Sam Rawlins Remove the TypeImplementing mixin; unnecessary (dart-lang/dartdoc#3705) 7b50ea4a 2024-03-07 Sam Rawlins Move the `filterNonDocumented` and `filterNonPublic` functions as extension getters (dart-lang/dartdoc#3699) http (https://github.com/dart-lang/http/compare/8d3c647..8da6e0e): 8da6e0e 2024-03-08 Derek Xu [package:http_profile] Store request and response bodies in the backing map as lists instead of streams (dart-lang/http#1154) markdown (https://github.com/dart-lang/markdown/compare/1ca5166..9c6b1af): 9c6b1af 2024-03-10 Jonas Finnemann Jensen Run a periodic crash-test (dart-archive/markdown#590) 1654801 2024-03-08 Zhiguang Chen Add single tilde support to `StrikethroughSyntax` (dart-archive/markdown#595) test (https://github.com/dart-lang/test/compare/7724aab..ba64bbb): ba64bbba 2024-03-07 Nate Bosch Let the IsolateChannel close the ReceivePort (dart-lang/test#2196) Change-Id: I5fad5442fe1a183707888276264eb9c47cc3c96f Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/356780 Commit-Queue: Konstantin Shcheglov <scheglov@google.com> Auto-Submit: Devon Carew <devoncarew@google.com> Reviewed-by: Konstantin Shcheglov <scheglov@google.com> Commit-Queue: Devon Carew <devoncarew@google.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
These were late, final, and public, my least favorite thing. The idea, historically, behind late final fields in dartdoc is caching. If a value is expensive to calculate, like a big list of things, and we have to access that value a few times, best to calculate it once.
But some late final fields are only accessed while rendering HTML, accessed from the rendered templates. And typically only accessed once. The '*Sorted' fields definitely fall into this bucket. So I made them all getters, and then benchmarked with the googleapis package, and found no significant change in time-to-document, or max RSS.
Contribution guidelines:
dart format.Note that many Dart repos have a weekly cadence for reviewing PRs - please allow for some latency before initial review feedback.