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

DefaultJavaScriptExecutor running even if WebClient has javascript disabled #65

Closed
cdalexndr opened this issue Jul 31, 2019 · 1 comment

Comments

@cdalexndr
Copy link
Contributor

cdalexndr commented Jul 31, 2019

On WebClient I set the following option, but the executor still starts:
webClient.getOptions().setJavaScriptEnabled( false )
The DefaultJavaScriptExecutor runs a loop with Thread.sleep(10ms) that has impact on performance.
The executor should use other mechanisms instead of the costly loop with Thread.sleep to wake when there are jobs pending.

Note that this executor has top usage in my java profiler's hot spots.

htmlunit-2.36.0-SNAPSHOT

@rbri
Copy link
Member

rbri commented Jul 31, 2019

Valid point, something that seems to be there since ages.

Regarding the Thread.sleep loop - you are right, but this was implemented so long ago and it is really hard to change the impl at this point. I fear there will be no time in the near future to make some major changes here.
But contributions are welcome.

As always will inform via twitter if a new Snapshot build is available.

@rbri rbri closed this as completed in a462f0e Jul 31, 2019
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

No branches or pull requests

2 participants