-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improve performance of the annotation overlay
There's several improvements in this commit: 1. Transformed annotations are always cached, even if no transformation applied. This makes it much faster in the most common case, while adding no significant memory overhead, because vast majority of objects already existed. 2. The transformation context implementation creates a copy of annotations lazily, on the first need. Again, this makes it much faster in the most common case (which is no annotation transformations applied). 3. Several copies were eliminated because they were just unnecessary overhead. For example, `AnnotationTarget.annotations()` or `declaredAnnotations()` already return unmodifiable collections, so there's no need to rewrap them again. 4. The [potentially transformed] annotations are no longer stored as a `Set` but as a `Collection`. This saves several copies and doesn't affect public API, which has always been defined in terms of `Collection`s. 5. Lambdas in `AnnotationOverlayImpl` were replaced by annonymous classes. The [modest] usage of streams was eliminated completely.
- Loading branch information
Showing
2 changed files
with
115 additions
and
47 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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