RFR: 8253086: Optimization of removeAll and retainAll of ObservableListWrapper [v4]
Kevin Rushforth
kcr at openjdk.java.net
Tue Oct 6 16:39:11 UTC 2020
On Tue, 22 Sep 2020 07:35:49 GMT, yosbits <github.com+7517141+yososs at openjdk.org> wrote:
>> https://bugs.openjdk.java.net/browse/JDK-8253086
>>
>> ObservableListWrapper.java
>> * public boolean removeAll(Collection<?> c)
>> * public boolean retainAll(Collection<?> c)
>>
>> These two methods use BitSet, but it doesn't make sense.
>> By rewriting to the equivalent behavior that does not use BitSet, it is possible to reduce the CPU load in a wide range
>> of use cases.
>> The test is done with the following command.
>>
>> * gradle base: test
>> * gradle controls: test
>
> yosbits has refreshed the contents of this pull request, and previous commits have been removed. The incremental views
> will show differences compared to the previous content of the PR.
As mentioned in a reply to a comment by @kleopatra , this fix will cause a regression in behavior, and cannot be
integrated in its current form.
A two-pass algorithm is still needed: the first pass collects the elements to be removed, the second pass actually
removes them. While it isn't necessary to use a BitSet to collect the indexes to be removed, that does seems a
reasonable approach. Unless there is a good reason to change it to some other two-pass algorithm, it's probably best to
leave it as-is, in which case this PR and the associated JBS issue can be withdrawn.
-------------
Changes requested by kcr (Lead).
PR: https://git.openjdk.java.net/jfx/pull/305
More information about the openjfx-dev
mailing list