On Tue, 16 Nov 2021 20:53:26 GMT, kabutz wrote:
>> This is a draft proposal for how we could improve stream performance for the
>> case where the streams are empty. Empty collections are common-place. If we
>> iterate over them with an Iterator, we would have to create one small
>> Iterator ob
On Tue, 16 Nov 2021 20:53:26 GMT, kabutz wrote:
>> This is a draft proposal for how we could improve stream performance for the
>> case where the streams are empty. Empty collections are common-place. If we
>> iterate over them with an Iterator, we would have to create one small
>> Iterator ob
On Tue, 16 Nov 2021 20:53:26 GMT, kabutz wrote:
>> This is a draft proposal for how we could improve stream performance for the
>> case where the streams are empty. Empty collections are common-place. If we
>> iterate over them with an Iterator, we would have to create one small
>> Iterator ob
On Tue, 16 Nov 2021 20:53:26 GMT, kabutz wrote:
>> This is a draft proposal for how we could improve stream performance for the
>> case where the streams are empty. Empty collections are common-place. If we
>> iterate over them with an Iterator, we would have to create one small
>> Iterator ob
> This is a draft proposal for how we could improve stream performance for the
> case where the streams are empty. Empty collections are common-place. If we
> iterate over them with an Iterator, we would have to create one small
> Iterator object (which could often be eliminated) and if it is em
On Fri, 5 Nov 2021 12:53:46 GMT, kabutz wrote:
> This is a draft proposal for how we could improve stream performance for the
> case where the streams are empty. Empty collections are common-place. If we
> iterate over them with an Iterator, we would have to create one small
> Iterator object
On Mon, 15 Nov 2021 18:23:16 GMT, Philippe Marschall
wrote:
> > ```
> > 3. I made many methods just return `this` after checking for operated on
> > and closed:
> > ```
>
> Reading the Javadoc again I'm not sure this is allowed. The method Javadoc
> doesn't clearly say it but the package Java
On Mon, 15 Nov 2021 18:08:22 GMT, Philippe Marschall
wrote:
> I have a similar project at
> [empty-streams](https://github.com/marschall/empty-streams). A couple of
> notes:
>
> 1. I found the need for streams to be stateful. I had need for the following
> state:
>
>1. closed
>2.
On Mon, 15 Nov 2021 18:08:22 GMT, Philippe Marschall
wrote:
> 3. I made many methods just return `this` after checking for operated on
> and closed:
Reading the Javadoc again I'm not sure this is allowed. The method Javadoc
doesn't clearly say it but the package Javadoc for intermediate o
On Fri, 5 Nov 2021 12:53:46 GMT, kabutz wrote:
> This is a draft proposal for how we could improve stream performance for the
> case where the streams are empty. Empty collections are common-place. If we
> iterate over them with an Iterator, we would have to create one small
> Iterator object
On Sun, 7 Nov 2021 06:53:12 GMT, kabutz wrote:
>>> The net effect of this change might depend on your workload. If you call
>>> stream() on empty collections that have cheap isEmpty(), this change will
>>> likely improve performance and reduce waste. However, this same change
>>> might do the
On Wed, 10 Nov 2021 07:45:27 GMT, Anthony Vanelverdinghe
wrote:
>> @kabutz I agree that i wouldn't consider it clean code to use a stream like
>> i put into the example. I only brought it up because it might break existing
>> code, since i think streams are expected to be lazy. Interesting to
On Sun, 7 Nov 2021 07:51:06 GMT, Michael Bien wrote:
>>> wouldn't this make streams no longer lazy if the collection is empty?
>>>
>>> ```java
>>> List list = new ArrayList<>();
>>> Stream stream = list.stream();
>>>
>>> list.addAll(List.of("one", "two", "three"));
>>>
On Sun, 7 Nov 2021 06:26:22 GMT, kabutz wrote:
>> (immutable collections could override stream() instead, since they don't
>> have that problem)
>
>> The net effect of this change might depend on your workload. If you call
>> stream() on empty collections that have cheap isEmpty(), this change
On Sun, 7 Nov 2021 04:26:13 GMT, Michael Bien wrote:
>> wouldn't this make streams no longer lazy if the collection is empty?
>>
>> List list = new ArrayList<>();
>> Stream stream = list.stream();
>>
>> list.addAll(List.of("one", "two", "three"));
>>
>> stream.f
On Sat, 6 Nov 2021 22:03:26 GMT, Pavel Rappo wrote:
>> This is a draft proposal for how we could improve stream performance for the
>> case where the streams are empty. Empty collections are common-place. If we
>> iterate over them with an Iterator, we would have to create one small
>> Iterato
On Sun, 7 Nov 2021 03:53:29 GMT, Michael Bien wrote:
>> src/java.base/share/classes/java/util/Collection.java line 743:
>>
>>> 741: */
>>> 742: default Stream stream() {
>>> 743: if (isEmpty()) return Stream.empty();
>>
>> The net effect of this change might depend on your work
On Sat, 13 Nov 2021 16:59:10 GMT, liach wrote:
>> This is a draft proposal for how we could improve stream performance for the
>> case where the streams are empty. Empty collections are common-place. If we
>> iterate over them with an Iterator, we would have to create one small
>> Iterator obj
On Fri, 5 Nov 2021 12:53:46 GMT, kabutz wrote:
> This is a draft proposal for how we could improve stream performance for the
> case where the streams are empty. Empty collections are common-place. If we
> iterate over them with an Iterator, we would have to create one small
> Iterator object
On Fri, 5 Nov 2021 12:53:46 GMT, kabutz wrote:
> This is a draft proposal for how we could improve stream performance for the
> case where the streams are empty. Empty collections are common-place. If we
> iterate over them with an Iterator, we would have to create one small
> Iterator object
On Fri, 5 Nov 2021 12:53:46 GMT, kabutz wrote:
> This is a draft proposal for how we could improve stream performance for the
> case where the streams are empty. Empty collections are common-place. If we
> iterate over them with an Iterator, we would have to create one small
> Iterator object
On Sat, 6 Nov 2021 17:23:34 GMT, Pavel Rappo wrote:
> Streams are closeable, and a terminal operation may be invoked on a given
> stream only once. Thus, shouldn't the third line in both of the examples
> below throw `IllegalStateException`?
>
> ```
> Stream empty = Stream.empty();
> S
On Fri, 5 Nov 2021 12:53:46 GMT, kabutz wrote:
> This is a draft proposal for how we could improve stream performance for the
> case where the streams are empty. Empty collections are common-place. If we
> iterate over them with an Iterator, we would have to create one small
> Iterator object
23 matches
Mail list logo