Skip to content

Use better and simpler logic for "default sort order", Deprecate most usages of TypeToken trickery #139

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nvamelichev
Copy link
Collaborator

...because Entity.Id.getType() uses TypeToken which is extremely slow in tight loops when run via Bazel JUnit5 tests, which have a non-null SecurityManager installed (SecurityManager is to prevent System.exit() calls from tests, but it happens to check every reflective access made by TypeToken, of which there are plenty.)

@nvamelichev nvamelichev self-assigned this May 2, 2025
@nvamelichev nvamelichev changed the title noticket: Get rid of most calls to Entity.Id.getType() and use better and simpler logic for "default sort order" [WIP] noticket: Get rid of most calls to Entity.Id.getType() and use better and simpler logic for "default sort order" May 2, 2025
@nvamelichev nvamelichev changed the title [WIP] noticket: Get rid of most calls to Entity.Id.getType() and use better and simpler logic for "default sort order" Use better and simpler logic for "default sort order", Deprecate most usages of TypeToken trickery May 7, 2025
@nvamelichev nvamelichev requested a review from lavrukov May 7, 2025 19:31
@nvamelichev nvamelichev added refactoring Internal improvement that does not change the API or library behavior breaking Potentially breaking change in API or behavior 2.6.x labels May 7, 2025
@nvamelichev nvamelichev force-pushed the minimize-calls-to-typetoken-via-Entity-Id-getType-make-default-sort-faster-in-presence-of-SecurityManager branch 6 times, most recently from 352fe67 to 0a24410 Compare May 8, 2025 21:55
…er and simpler logic for "default sort order"

...because `Entity.Id.getType()` uses `TypeToken` which is **extremely slow** in tight loops
when run via Bazel JUnit5 tests, which have a non-null `SecurityManager` installed
(`SecurityManager` is to prevent `System.exit()` calls from tests, but it happens to check
every reflective access made by `TypeToken`, of which there are **plenty**.)
@nvamelichev nvamelichev force-pushed the minimize-calls-to-typetoken-via-Entity-Id-getType-make-default-sort-faster-in-presence-of-SecurityManager branch from 0a24410 to 7b4d8f7 Compare May 8, 2025 21:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.6.x breaking Potentially breaking change in API or behavior refactoring Internal improvement that does not change the API or library behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant