Skip to content

[ORG] RU-AXAV: Removes the purge thread in favor of standard ScheduledThreadPoolExec… #30

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

Merged
merged 2 commits into from
Jul 17, 2021

Conversation

sakibguy
Copy link
Owner

…utor APIs (ReactiveX#7293)

The RXSchedulerPurge thread is currently enabled by default and runs every second
to call purge() on each executor in the pool. This is causing significant issues
for low powered devices (e.g. mobile phones), because it needs to periodically
wake up the CPU to perform purging. The RXSchedulerPurge thread could be completely
removed in favor of using the standard setRemoveOnCancelPolicy() API on the
ScheduledThreadPoolExecutor which became available in Java 7 and offers removal
of cancelled tasks at the moment they are cancelled in O(1).

Thank you for contributing to RxJava. Before pressing the "Create Pull Request" button, please consider the following points:

  • Please give a description about what and why you are contributing, even if it's trivial.

  • Please include the issue list number(s) or other PR numbers in the description if you are contributing in response to those.

  • Please include a reasonable set of unit tests if you contribute new code or change an existing one. If you contribute an operator, (if applicable) please make sure you have tests for working with an empty, just, range of values as well as an error source, with and/or without backpressure and see if unsubscription/cancellation propagates correctly.

…utor APIs (#7293)

The RXSchedulerPurge thread is currently enabled by default and runs every second
to call purge() on each executor in the pool. This is causing significant issues
for low powered devices (e.g. mobile phones), because it needs to periodically
wake up the CPU to perform purging. The RXSchedulerPurge thread could be completely
removed in favor of using the standard setRemoveOnCancelPolicy() API on the
ScheduledThreadPoolExecutor which became available in Java 7 and offers removal
of cancelled tasks at the moment they are cancelled in O(1).
@sakibguy sakibguy added the documentation Improvements or additions to documentation label Jul 17, 2021
@sakibguy sakibguy self-assigned this Jul 17, 2021
@codecov-commenter
Copy link

Codecov Report

Merging #30 (3330943) into 3.x (91a10d4) will increase coverage by 0.04%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##                3.x      #30      +/-   ##
============================================
+ Coverage     99.51%   99.56%   +0.04%     
+ Complexity     6757     6744      -13     
============================================
  Files           747      747              
  Lines         47391    47347      -44     
  Branches       6382     6376       -6     
============================================
- Hits          47161    47139      -22     
+ Misses          105       92      -13     
+ Partials        125      116       -9     
Impacted Files Coverage Δ
.../main/java/io/reactivex/rxjava3/core/Flowable.java 100.00% <ø> (ø)
...ain/java/io/reactivex/rxjava3/core/Observable.java 100.00% <ø> (ø)
...va/io/reactivex/rxjava3/schedulers/Schedulers.java 100.00% <ø> (ø)
...ava3/internal/schedulers/SchedulerPoolFactory.java 100.00% <100.00%> (ø)
.../operators/observable/ObservableFlatMapSingle.java 94.44% <0.00%> (-3.18%) ⬇️
...vex/rxjava3/internal/operators/maybe/MaybeAmb.java 96.96% <0.00%> (-3.04%) ⬇️
...tivex/rxjava3/internal/jdk8/ParallelCollector.java 96.33% <0.00%> (-1.84%) ⬇️
...a/io/reactivex/rxjava3/subjects/ReplaySubject.java 99.37% <0.00%> (-0.21%) ⬇️
...ternal/operators/completable/CompletableMerge.java 98.64% <0.00%> (ø)
...al/operators/observable/ObservableWindowTimed.java 97.09% <0.00%> (+0.32%) ⬆️
... and 12 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c5883dc...3330943. Read the comment docs.

Copy link
Owner Author

@sakibguy sakibguy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merged few changes

@sakibguy sakibguy merged commit adf49eb into sakibguy:3.x Jul 17, 2021
@sakibguy sakibguy changed the title Removes the purge thread in favor of standard ScheduledThreadPoolExec… RU-AXAV: Removes the purge thread in favor of standard ScheduledThreadPoolExec… Jan 27, 2023
@sakibguy sakibguy changed the title RU-AXAV: Removes the purge thread in favor of standard ScheduledThreadPoolExec… [ORG] RU-AXAV: Removes the purge thread in favor of standard ScheduledThreadPoolExec… Mar 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants