Skip to content
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

Improving performance, using caching when testing for primitives (#6252) #6253

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

Conversation

Boereck
Copy link
Contributor

@Boereck Boereck commented Aug 28, 2024

Caching primitive type names for faster lookup if a type is primitive.
Fixes #6252

@Boereck Boereck force-pushed the feature/is_primitive_performance branch 2 times, most recently from 07e8f37 to 074fbd2 Compare September 2, 2024 14:50
@Boereck Boereck force-pushed the feature/is_primitive_performance branch 2 times, most recently from aaf9ef7 to 841eeef Compare September 12, 2024 10:28
@Boereck Boereck changed the title Improving performance, using caching when testing for primitives (#6091) Improving performance, using caching when testing for primitives (#6252) Sep 12, 2024
@jamesagnew
Copy link
Collaborator

@Boereck This is failing CI because of an android signature issue - We need to support android 26's specific weird hybrid of Java 11 and 17, which is annoying but usually not too hard.

In this case the failure appears to be Collectors.toUnmodifiableSet() which doesn't exist in A26 so you'll need to find another way of accomplishing that.

…ifhir#6252)

Caching primitive type names for faster lookup if a type is primitive.
@Boereck Boereck force-pushed the feature/is_primitive_performance branch from 841eeef to d29773a Compare September 12, 2024 13:47
@Boereck
Copy link
Contributor Author

Boereck commented Sep 12, 2024

Thanks for the Info! I had a look at the Android API docs and updated the solution so to something that should (hopefully) work with API level 26. I also removed a call to distinct(), because I confused the API contracts of Collectors.toMap() and Collectors.toSet() before. Duplicate entries are not a problem for Collectors.toSet().

Copy link

codecov bot commented Sep 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.58%. Comparing base (406db33) to head (d29773a).
Report is 36 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #6253      +/-   ##
============================================
+ Coverage     83.54%   83.58%   +0.04%     
- Complexity    27432    27564     +132     
============================================
  Files          1707     1715       +8     
  Lines        106185   106680     +495     
  Branches      13397    13435      +38     
============================================
+ Hits          88710    89171     +461     
  Misses        11750    11750              
- Partials       5725     5759      +34     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Extreme validation slowdown due to changed primitive type check implementation
2 participants