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

Make the URLStreamHandler as lazy as possible #290

Merged

Conversation

laeubi
Copy link
Member

@laeubi laeubi commented Jul 4, 2023

URLStreamHandlerFactoryImpl currently opens a service tracker unconditionally for URLStreamHandlerService to discover registered handlers. This leads to any handler being fetched eagerly instead of when it is required.

This changes the handling in a way where it is as lazy as possible by

  • not open a tracker until a protocol is requested
  • use a service tracker with a specific protocol filter in proxy
  • only fetch the service when it is first used

URLStreamHandlerFactoryImpl currently opens a service tracker
unconditionally for URLStreamHandlerService to discover registered
handlers. This leads to any handler being fetched eagerly instead of
when it is required.

This changes the handling in a way where it is as lazy as possible by

- not open a tracker until a protocol is requested
- use a service tracker with a specific protocol filter in proxy
- only fetch the service when it is first used
@laeubi laeubi requested a review from tjwatson July 4, 2023 05:39
@laeubi
Copy link
Member Author

laeubi commented Jul 4, 2023

@tjwatson if we can agree on the change I'd like to include this in 2023-09-M2

@github-actions
Copy link

github-actions bot commented Jul 4, 2023

Test Results

     24 files  ±0       24 suites  ±0   12m 31s ⏱️ +52s
2 150 tests ±0  2 106 ✔️ +1  44 💤 ±0  0  - 1 
2 194 runs  ±0  2 150 ✔️ +1  44 💤 ±0  0  - 1 

Results for commit 786f008. ± Comparison against base commit 513274d.

@laeubi laeubi merged commit deb67c2 into eclipse-equinox:master Jul 9, 2023
22 of 25 checks passed
@laeubi
Copy link
Member Author

laeubi commented Jul 9, 2023

Then lets see how this works out 👍

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.

None yet

2 participants