SlideShare uma empresa Scribd logo
1 de 93
Странности Stream API
Тагир Валеев
Институт систем информатики СО РАН
1
Что это за чувак на сцене?
https://github.com/amaembo/streamex
2
Что это за чувак на сцене?
• JDK-8072727 Add variation of Stream.iterate() that's finite
• JDK-8136686 Collectors.counting can use Collectors.summingLong to reduce boxing
• JDK-8141630 Specification of Collections.synchronized* need to state traversal constraints
• JDK-8145007 Pattern splitAsStream is not late binding as required by the specification
• JDK-8146218 Add LocalDate.datesUntil method producing Stream<LocalDate>
• JDK-8147505 BaseStream.onClose() should not allow registering new handlers after stream is
consumed
• JDK-8148115 Stream.findFirst for unordered source optimization
• JDK-8148250 Stream.limit() parallel tasks with ordered non-SUBSIZED source should short-circuit
• JDK-8148838 Stream.flatMap(...).spliterator() cannot properly split after tryAdvance()
• JDK-8148748 ArrayList.subList().spliterator() is not late-binding
• JDK-8151123 Collectors.summingDouble/averagingDouble unnecessarily call mapper twice
3
Что это за чувак на сцене?
4
LongStream.range(1, 100)
.count();
5
LongStream.range(1, 100)
.count();
>> 99
6
LongStream.range(0, 1_000_000_000_000_000_000L)
.count();
7
LongStream.range(0, 1_000_000_000_000_000_000L)
.count();
8
LongStream.range(0, 1_000_000_000_000_000_000L)
.count();
>> 1000000000000000000
Java 9:
JDK-8067969 Optimize Stream.count for SIZED Streams
9
Характеристики
SIZED
SUBSIZED
SORTED
ORDERED
DISTINCT
NONNULL
IMMUTABLE
CONCURRENT
10
toArray()
IntStream.range(0, 100_000_000)
.toArray();
IntStream.range(0, 100_000_000)
.filter(x -> true)
.toArray();
11
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
at java.util.stream.SpinedBuffer$OfInt.newArray
at java.util.stream.SpinedBuffer$OfInt.newArray
at java.util.stream.SpinedBuffer$OfPrimitive.asPrimitiveArray
at java.util.stream.Nodes$IntSpinedNodeBuilder.asPrimitiveArray
at java.util.stream.Nodes$IntSpinedNodeBuilder.asPrimitiveArray
at java.util.stream.IntPipeline.toArray
at ru.javapoint.streamsamples.ToArray.main
12
toArray()
IntStream.range(0, 100_000_000) -Xmx560M 269ms
.toArray();
IntStream.range(0, 100_000_000) -Xmx1330M 795ms
.filter(x -> true)
.toArray();
13
.collect(toList())?
JDK-8072840 Add a method to Collector that returns a sized supplying
mutable result container
IntStream.range(0, 10_000_000) -Xmx320M 2.64±0.5s
.boxed().collect(toList());
IntStream.range(0, 10_000_000) -Xmx320M 2.63±0.5s
.boxed().filter(x -> true)
.collect(toList());
14
sorted()
full-barrier operation
IntStream.range(0, 100_000_000) -Xmx560M
.toArray();
IntStream.range(0, 100_000_000) -Xmx1330M
.filter(x -> true)
.toArray();
IntStream.range(0, 100_000_000) ?
.sorted().sum();
IntStream.range(0, 100_000_000) ?
.filter(x -> true)
.sorted().sum();
15
sorted()
full-barrier operation
IntStream.range(0, 100_000_000) -Xmx560M
.toArray();
IntStream.range(0, 100_000_000) -Xmx1330M
.filter(x -> true)
.toArray();
IntStream.range(0, 100_000_000) -Xmx1M
.sorted().sum();
IntStream.range(0, 100_000_000) -Xmx1M
.filter(x -> true)
.sorted().sum();
16
sorted()
full-barrier operation
IntStream.range(0, 100_000_000) -Xmx580M
.map(x -> x).sorted().sum();
IntStream.range(0, 100_000_000) -Xmx1330M
.filter(x -> true)
.map(x -> x).sorted().sum();
IntStream.range(0, 100_000_000) -Xmx560M
.toArray();
IntStream.range(0, 100_000_000) -Xmx1330M
.filter(x -> true)
.toArray();
17
skip()
IntStream.range(0, 100_000_000)
.toArray();
IntStream.range(0, 100_000_000)
.skip(1)
.toArray();
18
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
at java.util.stream.SpinedBuffer$OfInt.newArray
at java.util.stream.SpinedBuffer$OfInt.newArray
at java.util.stream.SpinedBuffer$OfPrimitive.asPrimitiveArray
at java.util.stream.Nodes$IntSpinedNodeBuilder.asPrimitiveArray
at java.util.stream.Nodes$IntSpinedNodeBuilder.asPrimitiveArray
at java.util.stream.IntPipeline.toArray
at ru.javapoint.streamsamples.ToArraySkip.main
19
skip() и limit()
IntStream.range(0, 100_000_000)
.toArray();
IntStream.range(0, 100_000_000)
.skip(1)
.toArray();
IntStream.range(0, 100_000_000)
.limit(99_999_999)
.toArray();
20
skip() и limit()
new Random().ints()
.limit(100_000_000)
.toArray();
new Random().ints(100_000_000)
.toArray();
21
skip() и limit()
list.stream()
.limit(2000)
.skip(1000)
.forEach(System.out::println);
list.subList(1000, 2000)
.stream()
.forEach(System.out::println);
22
parallel().skip()
IntStream.range(0, 100_000_000) 104.5±4.4 ms
.skip(99_000_000)
.sum();
IntStream.range(0, 100_000_000) ?
.parallel()
.skip(99_000_000)
.sum();
23
24
parallel().skip()
API Note:
While skip() is generally a cheap operation on sequential
stream pipelines, it can be quite expensive on ordered
parallel pipelines, especially for large values of n,
since skip(n) is constrained to skip not just any n elements, but
the first n elements in the encounter order.
25
parallel().skip()
IntStream.range(0, 100_000_000) 104.5±4.4 ms
.skip(99_000_000)
.sum();
IntStream.range(0, 100_000_000) 1.4±0.2 ms
.parallel() (74.6×)
.skip(99_000_000)
.sum();
26
parallel(): trySplit()
(SIZED+SUBSIZED)
0..99_999_999
0..49_999_999 50_000_000..99_999_999
75_000_000..
99_999_999
50_000_000..
74_999_999
…………
25_000_000..
49_999_999
……
0..24_999_999
…… 27
parallel().skip()
(SIZED+SUBSIZED)
0..99_999_999
0..49_999_999 50_000_000..99_999_999
75_000_000..99_999_99950_000_000..74_999_999
…… 28
Характеристики
SIZED
SUBSIZED
SORTED
ORDERED
DISTINCT
NONNULL
IMMUTABLE
CONCURRENT
29
distinct() и ordering
List<Integer> input = new Random(1)
.ints(10_000_000, 0, 10)
.boxed().collect(Collectors.toList());
input.stream()
.distinct()
.collect(Collectors.toList());
85.4 ± 0.7 ms
30
distinct() и ordering
input.stream()
.parallel()
.distinct()
.collect(Collectors.toList());
30.5 ± 1.7 ms (2.8×)
31
parallel().distinct()
API Note:
Preserving stability for distinct() in parallel pipelines is
relatively expensive (requires that the operation act as a full
barrier, with substantial buffering overhead), and stability is
often not needed. Using an unordered stream source (such as
generate(Supplier)) or removing the ordering constraint with
BaseStream.unordered() may result in significantly more
efficient execution for distinct() in parallel pipelines, if the
semantics of your situation permit.
32
distinct() и ordering
input.stream()
.parallel()
.unordered()
.distinct()
.collect(Collectors.toList());
33
distinct() и ordering
Sequential 85.4 ± 0.7 ms
Parallel 30.5 ± 1.7 ms (2.8×)
Parallel unordered 249.0 ± 1.5 ms (0.34×)
34
LinkedHashSet
LinkedHashSet LinkedHashSet
distinct() ordered parallel
LinkedHashSet LinkedHashSet LinkedHashSet LinkedHashSet
35
ConcurrentHashMap.newKeySet()
distinct() unordered parallel
36
Характеристики
SIZED
SUBSIZED
SORTED
ORDERED
DISTINCT
NONNULL
IMMUTABLE
CONCURRENT
37
Stream.concat()
IntStream s1 = IntStream.range(0, 50_000_000);
IntStream s2 = IntStream.range(50_000_000, 100_000_000);
IntStream.concat(s1, s2).toArray(); -Xmx580M
38
Промежуточные операции
(красивые)
map(), filter(), flatMap(), …
Терминальные операции
(умные)
forEach(), reduce(), count(), …
А мне что, разорваться?
Stream.concat()
39
concat() и parallel()
Integer[] aIntegers = { 101, 102, ..., 200 };
Integer[] bIntegers = { 201, 202, ..., 300 };
Stream<Integer> a = Arrays.stream(aIntegers);
Stream<Integer> b = Arrays.stream(bIntegers);
List<String> list = Stream.concat(a, b)
.map(num -> String.valueOf(num).replaceAll("((((.*)*)*)*)*!", ""))
.collect(Collectors.toList());
868.9 ± 10.6 ms
40
concat() и parallel()
Integer[] aIntegers = { 101, 102, ..., 200 };
Integer[] bIntegers = { 201, 202, ..., 300 };
Stream<Integer> a = Arrays.stream(aIntegers);
Stream<Integer> b = Arrays.stream(bIntegers);
List<String> list = Stream.concat(a, b)
.parallel()
.map(num -> String.valueOf(num).replaceAll("((((.*)*)*)*)*!", ""))
.collect(Collectors.toList());
227.9 ± 3.5 ms (3.8×)
41
concat() и parallel()
Stream<Integer> a = Arrays.stream(aIntegers);
Stream<Integer> b = Arrays.stream(bIntegers);
List<String> list = Stream.concat(a, b)
.parallel() 227.9
.map(num -> String.valueOf(num).replaceAll(...)) ± 3.5 ms
.collect(Collectors.toList()); (3.8×)
Stream<Integer> a = Arrays.stream(aInts).boxed();
Stream<Integer> b = Arrays.stream(bInts).boxed();
List<String> list = Stream.concat(a, b)
.parallel() ?
.map(num -> String.valueOf(num).replaceAll(...))
.collect(Collectors.toList());
42
concat() и parallel()
Stream<Integer> a = Arrays.stream(aIntegers);
Stream<Integer> b = Arrays.stream(bIntegers);
List<String> list = Stream.concat(a, b)
.parallel() 227.9
.map(num -> String.valueOf(num).replaceAll(...)) ± 3.5 ms
.collect(Collectors.toList()); (3.8×)
Stream<Integer> a = Arrays.stream(aInts).boxed();
Stream<Integer> b = Arrays.stream(bInts).boxed();
List<String> list = Stream.concat(a, b)
.parallel() 437.8
.map(num -> String.valueOf(num).replaceAll(...)) ± 5.2 ms
.collect(Collectors.toList()); (1.98×)
43
concat()
1. Пусть A = aStream.spliterator(), B = bStream.spliterator()
2. Создать новый spliterator из этих двух:
• tryAdvance: вызывать A.tryAdvance(),
а если там кончилось, то B.tryAdvance().
• forEachRemaining: вызвать A.forEachRemaining(),
затем B.forEachRemaining().
• trySplit: разделить назад на A и B.
3. Создать новый stream по новому сплитератору.
4. Повесить на onClose вызов aStream.close() и
bStream.close()
44
Stream.spliterator()
1. Нет промежуточных операций? Вернём исходный сплитератор.
2. Есть промежуточные операции? Создадим новый WrappingSpliterator:
• forEachRemaining(): ≈ Stream.forEach()
• tryAdvance(): вызвать tryAdvance у источника и собрать в буфер,
что накопилось, а потом идти по буферу
• trySplit(): если исходный стрим параллельный, вызвать trySplit() у
источника и обернуть результат в такой же WrappingSpliterator
45
concat() и parallel()
Stream<Integer> a = Arrays.stream(aIntegers);
Stream<Integer> b = Arrays.stream(bIntegers);
List<String> list = Stream.concat(a, b)
.parallel() 227.9
.map(num -> String.valueOf(num).replaceAll(...)) ± 3.5 ms
.collect(Collectors.toList()); (3.8×)
Stream<Integer> a = Arrays.stream(aInts).boxed();
Stream<Integer> b = Arrays.stream(bInts).boxed();
List<String> list = Stream.concat(a, b)
.parallel() 437.8
.map(num -> String.valueOf(num).replaceAll(...)) ± 5.2 ms
.collect(Collectors.toList()); (1.98×)
46
concat() и parallel()
Stream<Integer> a = Arrays.stream(aInts).boxed().parallel();
Stream<Integer> b = Arrays.stream(bInts).boxed().parallel();
List<String> list = Stream.concat(a, b)
.map(num -> String.valueOf(num).replaceAll(...))
.collect(Collectors.toList());
222.1 ± 2.3 ms (3.9×)
47
concat() и ordering
List<Integer> a = Arrays.asList(1,2,3,4,5,6,7,8,9,10);
List<Integer> b = Arrays.asList();
Stream.concat(a.parallelStream(), b.parallelStream())
.filter(x -> x % 2 == 0)
.limit(3)
.forEachOrdered(System.out::println);
>> 2
>> 4
>> 6
48
concat() и ordering
List<Integer> a = Arrays.asList(1,2,3,4,5,6,7,8,9,10);
List<Integer> b = Collections.emptyList();
Stream.concat(a.parallelStream(), b.parallelStream())
.filter(x -> x % 2 == 0)
.limit(3)
.forEachOrdered(System.out::println);
>> 2
>> 6
>> 10
49
flatMap()
Stream<Integer> a = ...;
Stream<Integer> b = ...;
Stream<Integer> c = ...;
Stream<Integer> d = ...;
Stream<Integer> res = Stream.concat(
Stream.concat(Stream.concat(a, b), c), d);
Stream<Integer> res = Stream.of(a, b, c, d)
.flatMap(Function.identity());
50
concat() или flatMap()?
Stream<Integer> a = Arrays.stream(aInts).boxed().parallel();
Stream<Integer> b = Arrays.stream(bInts).boxed().parallel();
List<String> list = Stream.of(a, b)
.flatMap(Function.identity())
.parallel()
.map(num -> String.valueOf(num).replaceAll(...))
.collect(Collectors.toList()); // 444.8 ± 7.3 ms (1.95x)
51
concat() или flatMap()?
IntStream s1 = IntStream.range(0, 50_000_000);
IntStream s2 = IntStream.range(50_000_000, 100_000_000);
IntStream.concat(s1, s2).toArray(); // -Xmx580M
Stream.of(s1, s2).flatMapToInt(Function.identity())
.toArray(); // -Xmx1330M
52
flatMap() и short-circuiting
IntStream s1 = IntStream.range(0, 50_000_000);
IntStream s2 = IntStream.range(50_000_000, 100_000_000);
IntStream.concat(s1, s2)
.filter(x -> x > 2).findFirst(); // 0.13 μs
Stream.of(s1, s2).flatMapToInt(Function.identity())
.filter(x -> x > 2).findFirst(); // 301051 μs
53
flatMap() и tryAdvance()
Stream<Integer> s =
IntStream.range(0, 1_000_000_000).boxed();
s.spliterator().tryAdvance(System.out::println);
>> 0
54
flatMap() и tryAdvance()
Stream<Integer> s = IntStream.of(1_000_000_000)
.flatMap(x -> IntStream.range(0, x)).boxed();
s.spliterator().tryAdvance(System.out::println);
55
java.lang.OutOfMemoryError: Java heap space
at java.util.stream.SpinedBuffer.ensureCapacity
at java.util.stream.SpinedBuffer.increaseCapacity
at java.util.stream.SpinedBuffer.accept
at java.util.stream.IntPipeline$4$1.accept
at java.util.stream.IntPipeline$7$1.lambda$accept$198
at java.util.stream.IntPipeline$7$1$$Lambda$7/1831932724.accept
at java.util.stream.Streams$RangeIntSpliterator.forEachRemaining
at java.util.stream.IntPipeline$Head.forEach
at java.util.stream.IntPipeline$7$1.accept
at java.util.stream.Streams$IntStreamBuilderImpl.tryAdvance
at java.util.Spliterator$OfInt.tryAdvance
...
at java.util.stream.StreamSpliterators$WrappingSpliterator.tryAdvance
at ru.javapoint.streamsamples.FlatMapTryAdvance.main
56
flatMap() и tryAdvance()
Stream<Integer> s = IntStream.of(1_000_000_000)
.flatMap(x -> IntStream.range(0, x)).boxed();
s.spliterator().tryAdvance(System.out::println);
57
flatMap() и concat()
IntStream s = IntStream.of(1_000_000_000)
.flatMap(x -> IntStream.range(0, x));
s.sum();
s.findFirst(); // non short-circuit
IntStream.concat(s, IntStream.of(1)).sum();
IntStream.concat(s, IntStream.of(1)).findFirst();
58
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
at java.util.stream.SpinedBuffer$OfInt.newArray
at java.util.stream.SpinedBuffer$OfInt.newArray
at java.util.stream.SpinedBuffer$OfPrimitive.ensureCapacity
at java.util.stream.SpinedBuffer$OfPrimitive.increaseCapacity
at java.util.stream.SpinedBuffer$OfPrimitive.preAccept
at java.util.stream.SpinedBuffer$OfInt.accept
...
at java.util.stream.Streams$ConcatSpliterator$OfInt.tryAdvance
at java.util.stream.IntPipeline.forEachWithCancel
at java.util.stream.AbstractPipeline.copyIntoWithCancel
at java.util.stream.AbstractPipeline.copyInto
at java.util.stream.AbstractPipeline.wrapAndCopyInto
at java.util.stream.FindOps$FindOp.evaluateSequential
at java.util.stream.AbstractPipeline.evaluate
at java.util.stream.IntPipeline.findFirst
at ru.javapoint.streamsamples.ConcatFlat.main 59
flatMap() vs concat()
concat() flatMap()
Сохраняет SIZED
Short-circuiting
Memory-friendly tryAdvance()
Полноценный параллелизм
Всегда сохраняет порядок
Многократная конкатенация
±
60
Всё же concat()?
Object[][] data = new Object[20000][4000];
Object[] flat = Arrays.stream(data)
.flatMap(Arrays::stream).toArray();
>> java.lang.OutOfMemoryError
61
Всё же concat()?
Object[][] data = new Object[20000][4000];
Object[] flat = Arrays.stream(data)
.flatMap(Arrays::stream).toArray();
>> java.lang.OutOfMemoryError
Stream<Object> s = Arrays.stream(data)
.map(Arrays::stream).reduce(Stream::concat)
.orElse(Stream.empty());
Object[] flat = s.toArray();
62
Exception in thread "main" java.lang.StackOverflowError
at java.util.stream.Streams$ConcatSpliterator.forEachRemaining
at java.util.stream.Streams$ConcatSpliterator.forEachRemaining
at java.util.stream.Streams$ConcatSpliterator.forEachRemaining
at java.util.stream.Streams$ConcatSpliterator.forEachRemaining
at java.util.stream.Streams$ConcatSpliterator.forEachRemaining
at java.util.stream.Streams$ConcatSpliterator.forEachRemaining
at java.util.stream.Streams$ConcatSpliterator.forEachRemaining
at java.util.stream.Streams$ConcatSpliterator.forEachRemaining
at java.util.stream.Streams$ConcatSpliterator.forEachRemaining
at java.util.stream.Streams$ConcatSpliterator.forEachRemaining
at java.util.stream.Streams$ConcatSpliterator.forEachRemaining
at java.util.stream.Streams$ConcatSpliterator.forEachRemaining
at java.util.stream.Streams$ConcatSpliterator.forEachRemaining
at java.util.stream.Streams$ConcatSpliterator.forEachRemaining
at java.util.stream.Streams$ConcatSpliterator.forEachRemaining
... 63
reduce(Stream::concat)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
64
Распараллелим!
Object[][] data = new Object[20000][4000];
Stream<Object> s = Arrays.stream(data)
.parallel()
.map(Arrays::stream)
.reduce(Stream::concat)
.orElse(Stream.empty());
Object[] flat = s.toArray();
65
parallel().reduce(Stream::concat)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
.reduce(Predicate::or)
.reduce(Predicate::and)
.reduce(Function::andThen)
https://habrahabr.ru/post/255813/
66
Stream и Iterator
67
iterator()
Верните цикл for()!
68
for vs forEach()
for forEach()
Появился Java 1.5 Java 1.8
Нормальная отладка
Короткие стектрейсы
Checked exceptions
Изменяемые переменные
Досрочный выход по break
Параллелизм (всё равно не нужен) 69
iterator()
70
iterator()
Stream<String> s = Stream.of("a", "b", "c");
for(String str : (Iterable<String>)s::iterator) {
System.out.println(str);
}
71
iterator()
Stream<String> s = Stream.of("a", "b", "c");
for(String str : (Iterable<String>)s::iterator) {
System.out.println(str);
}
// Joshua Bloch approves
for(String str : StreamEx.of("a", "b", "c")) {
System.out.println(str);
}
72
iterator()
IntStream s = IntStream.of(1_000_000_000)
.flatMap(x -> IntStream.range(0, x));
for(int i : (Iterable<Integer>)s::iterator) {
System.out.println(i);
}
73
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
at j.u.s.SpinedBuffer$OfInt.newArray
at j.u.s.SpinedBuffer$OfInt.newArray
at j.u.s.SpinedBuffer$OfPrimitive.ensureCapacity
at j.u.s.SpinedBuffer$OfPrimitive.increaseCapacity
at j.u.s.SpinedBuffer$OfPrimitive.preAccept
at j.u.s.SpinedBuffer$OfInt.accept
at j.u.s.IntPipeline$7$1.lambda$accept$198
...
at j.u.s.StreamSpliterators$AbstractWrappingSpliterator.fillBuffer
at j.u.s.StreamSpliterators$AbstractWrappingSpliterator.doAdvance
at j.u.s.StreamSpliterators$IntWrappingSpliterator.tryAdvance
at j.u.Spliterators$2Adapter.hasNext
at ru.javapoint.streamsamples.IterableWorkaround.main
74
Stream из итератора
StreamSupport.stream(
Spliterators.spliteratorUnknownSize(
iterator, Spliterator.ORDERED), false);
75
Stream из итератора
StreamSupport.stream(
Spliterators.spliteratorUnknownSize(
iterator, Spliterator.ORDERED), false);
StreamSupport.stream(
((Iterable<String>)() -> iterator).spliterator(),
false);
76
Stream из итератора
Files.find();
Files.lines();
Files.list();
Files.walk();
BufferedReader.lines();
Pattern.splitAsStream();
77
Как распараллелить
последовательное?
...
78
Как распараллелить
последовательное?
...
Thread-1
79
Как распараллелить
последовательное?
...
Thread-1
Thread-2
80
Files.list()
List<Record> list = Files.list(root)
.map(path -> parse(path))
.collect(Collectors.toList()); 204 ms
81
Files.list().parallel()
List<Record> list = Files.list(root)
.parallel()
.map(path -> parse(path))
.collect(Collectors.toList()); 202 ms
82
Files.list().parallel()
List<Record> list = Files.list(root)
.parallel()
.sorted(comparingLong(p -> p.toFile().length()))
.map(path -> parse(path))
.collect(Collectors.toList()); 57.5 ms (3.5×)
83
StreamTools
https://github.com/amaembo/streamtools
SplitTree tree = SplitTree.inspect(IntStream.range(0, 200));
try(OutputStream os = Files.newOutputStream(
Paths.get("range.xgml"))) {
new XGMLFormatter().nodeWidth(60).nodeHeight(20)
.nodeFormat("%f..%l", "(empty)")
.writeTo(tree, os);
}
84
IntStream.range(0, 200)
85
Stream из итератора (200)
86
Stream из итератора (2000)
87
Stream из итератора (10000)
88
0
0.5
1
1.5
2
2.5
3
3.5
4
4.5
0 5000 10000 15000 20000 25000
Speed-up
Speed-up
89
Stream из итератора
StreamSupport.stream(
Spliterators.spliterator(
iterator, size, Spliterator.ORDERED), false);
90
SIZED-Stream из итератора (10000)
91
Files.list()
List<Record> list = Files.list(root)
.collect(Collectors.toList())
.parallelStream()
.map(path -> parse(path))
.collect(Collectors.toList());
92
Спасибо за внимание
https://twitter.com/tagir_valeev
https://github.com/amaembo
https://habrahabr.ru/users/lany
93

Mais conteúdo relacionado

Mais procurados

Wprowadzenie do technologi Big Data i Apache Hadoop
Wprowadzenie do technologi Big Data i Apache HadoopWprowadzenie do technologi Big Data i Apache Hadoop
Wprowadzenie do technologi Big Data i Apache Hadoop
Sages
 
Riga DevDays 2017 - The hitchhiker’s guide to Java class reloading
Riga DevDays 2017 - The hitchhiker’s guide to Java class reloadingRiga DevDays 2017 - The hitchhiker’s guide to Java class reloading
Riga DevDays 2017 - The hitchhiker’s guide to Java class reloading
Anton Arhipov
 
Обзор фреймворка Twisted
Обзор фреймворка TwistedОбзор фреймворка Twisted
Обзор фреймворка Twisted
Maxim Kulsha
 
JJUG CCC 2011 Spring
JJUG CCC 2011 SpringJJUG CCC 2011 Spring
JJUG CCC 2011 Spring
Kiyotaka Oku
 

Mais procurados (20)

Introduction to rx java for android
Introduction to rx java for androidIntroduction to rx java for android
Introduction to rx java for android
 
Wprowadzenie do technologii Big Data / Intro to Big Data Ecosystem
Wprowadzenie do technologii Big Data / Intro to Big Data EcosystemWprowadzenie do technologii Big Data / Intro to Big Data Ecosystem
Wprowadzenie do technologii Big Data / Intro to Big Data Ecosystem
 
The Ring programming language version 1.10 book - Part 94 of 212
The Ring programming language version 1.10 book - Part 94 of 212The Ring programming language version 1.10 book - Part 94 of 212
The Ring programming language version 1.10 book - Part 94 of 212
 
Wprowadzenie do technologi Big Data i Apache Hadoop
Wprowadzenie do technologi Big Data i Apache HadoopWprowadzenie do technologi Big Data i Apache Hadoop
Wprowadzenie do technologi Big Data i Apache Hadoop
 
Nodejs性能分析优化和分布式设计探讨
Nodejs性能分析优化和分布式设计探讨Nodejs性能分析优化和分布式设计探讨
Nodejs性能分析优化和分布式设计探讨
 
Riga DevDays 2017 - The hitchhiker’s guide to Java class reloading
Riga DevDays 2017 - The hitchhiker’s guide to Java class reloadingRiga DevDays 2017 - The hitchhiker’s guide to Java class reloading
Riga DevDays 2017 - The hitchhiker’s guide to Java class reloading
 
Dagger & rxjava & retrofit
Dagger & rxjava & retrofitDagger & rxjava & retrofit
Dagger & rxjava & retrofit
 
Riga Dev Day 2016 - Having fun with Javassist
Riga Dev Day 2016 - Having fun with JavassistRiga Dev Day 2016 - Having fun with Javassist
Riga Dev Day 2016 - Having fun with Javassist
 
Обзор фреймворка Twisted
Обзор фреймворка TwistedОбзор фреймворка Twisted
Обзор фреймворка Twisted
 
JavaOne 2015 - Having fun with Javassist
JavaOne 2015 - Having fun with JavassistJavaOne 2015 - Having fun with Javassist
JavaOne 2015 - Having fun with Javassist
 
미려한 UI/UX를 위한 여정
미려한 UI/UX를 위한 여정미려한 UI/UX를 위한 여정
미려한 UI/UX를 위한 여정
 
Advanced Debugging Using Java Bytecodes
Advanced Debugging Using Java BytecodesAdvanced Debugging Using Java Bytecodes
Advanced Debugging Using Java Bytecodes
 
[131]해커의 관점에서 바라보기
[131]해커의 관점에서 바라보기[131]해커의 관점에서 바라보기
[131]해커의 관점에서 바라보기
 
The Ring programming language version 1.5.3 book - Part 10 of 184
The Ring programming language version 1.5.3 book - Part 10 of 184The Ring programming language version 1.5.3 book - Part 10 of 184
The Ring programming language version 1.5.3 book - Part 10 of 184
 
ES6 in Real Life
ES6 in Real LifeES6 in Real Life
ES6 in Real Life
 
Why Sifu
Why SifuWhy Sifu
Why Sifu
 
The Ring programming language version 1.5.1 book - Part 44 of 180
The Ring programming language version 1.5.1 book - Part 44 of 180The Ring programming language version 1.5.1 book - Part 44 of 180
The Ring programming language version 1.5.1 book - Part 44 of 180
 
What’s new in C# 6
What’s new in C# 6What’s new in C# 6
What’s new in C# 6
 
JJUG CCC 2011 Spring
JJUG CCC 2011 SpringJJUG CCC 2011 Spring
JJUG CCC 2011 Spring
 
Using Reflections and Automatic Code Generation
Using Reflections and Automatic Code GenerationUsing Reflections and Automatic Code Generation
Using Reflections and Automatic Code Generation
 

Destaque

Stream API: рекомендации лучших собаководов
Stream API: рекомендации лучших собаководовStream API: рекомендации лучших собаководов
Stream API: рекомендации лучших собаководов
tvaleev
 

Destaque (8)

Stream API: рекомендации лучших собаководов
Stream API: рекомендации лучших собаководовStream API: рекомендации лучших собаководов
Stream API: рекомендации лучших собаководов
 
Железные счётчики на страже производительности
Железные счётчики на страже производительностиЖелезные счётчики на страже производительности
Железные счётчики на страже производительности
 
JDK8: Stream style
JDK8: Stream styleJDK8: Stream style
JDK8: Stream style
 
"Quantum" Performance Effects
"Quantum" Performance Effects"Quantum" Performance Effects
"Quantum" Performance Effects
 
Javaland keynote final
Javaland keynote finalJavaland keynote final
Javaland keynote final
 
"Quantum" performance effects
"Quantum" performance effects"Quantum" performance effects
"Quantum" performance effects
 
Java 8 Puzzlers as it was presented at Codemash 2017
Java 8 Puzzlers as it was presented at Codemash 2017Java 8 Puzzlers as it was presented at Codemash 2017
Java 8 Puzzlers as it was presented at Codemash 2017
 
Java Performance: Speedup your application with hardware counters
Java Performance: Speedup your application with hardware countersJava Performance: Speedup your application with hardware counters
Java Performance: Speedup your application with hardware counters
 

Semelhante a JPoint 2016 - Валеев Тагир - Странности Stream API

Scala Turkiye 2013-02-07 Sunumu
Scala Turkiye 2013-02-07 SunumuScala Turkiye 2013-02-07 Sunumu
Scala Turkiye 2013-02-07 Sunumu
Volkan Yazıcı
 
Retro gaming with lambdas stephen chin
Retro gaming with lambdas   stephen chinRetro gaming with lambdas   stephen chin
Retro gaming with lambdas stephen chin
NLJUG
 
Apache Spark for Library Developers with William Benton and Erik Erlandson
 Apache Spark for Library Developers with William Benton and Erik Erlandson Apache Spark for Library Developers with William Benton and Erik Erlandson
Apache Spark for Library Developers with William Benton and Erik Erlandson
Databricks
 
Postgres performance for humans
Postgres performance for humansPostgres performance for humans
Postgres performance for humans
Craig Kerstiens
 

Semelhante a JPoint 2016 - Валеев Тагир - Странности Stream API (20)

Java8 training - class 3
Java8 training - class 3Java8 training - class 3
Java8 training - class 3
 
Futures e abstração - QCon São Paulo 2015
Futures e abstração - QCon São Paulo 2015Futures e abstração - QCon São Paulo 2015
Futures e abstração - QCon São Paulo 2015
 
Spark_Documentation_Template1
Spark_Documentation_Template1Spark_Documentation_Template1
Spark_Documentation_Template1
 
Scala Turkiye 2013-02-07 Sunumu
Scala Turkiye 2013-02-07 SunumuScala Turkiye 2013-02-07 Sunumu
Scala Turkiye 2013-02-07 Sunumu
 
What is new in Java 8
What is new in Java 8What is new in Java 8
What is new in Java 8
 
Hot Streaming Java
Hot Streaming JavaHot Streaming Java
Hot Streaming Java
 
"Kotlin и rx в android" Дмитрий Воронин (Avito)
"Kotlin и rx в android" Дмитрий Воронин  (Avito)"Kotlin и rx в android" Дмитрий Воронин  (Avito)
"Kotlin и rx в android" Дмитрий Воронин (Avito)
 
Solr @ Etsy - Apache Lucene Eurocon
Solr @ Etsy - Apache Lucene EuroconSolr @ Etsy - Apache Lucene Eurocon
Solr @ Etsy - Apache Lucene Eurocon
 
Retro gaming with lambdas stephen chin
Retro gaming with lambdas   stephen chinRetro gaming with lambdas   stephen chin
Retro gaming with lambdas stephen chin
 
Java7 New Features and Code Examples
Java7 New Features and Code ExamplesJava7 New Features and Code Examples
Java7 New Features and Code Examples
 
Reactive stream processing using Akka streams
Reactive stream processing using Akka streams Reactive stream processing using Akka streams
Reactive stream processing using Akka streams
 
Introduction to java 8 stream api
Introduction to java 8 stream apiIntroduction to java 8 stream api
Introduction to java 8 stream api
 
Apache Spark for Library Developers with William Benton and Erik Erlandson
 Apache Spark for Library Developers with William Benton and Erik Erlandson Apache Spark for Library Developers with William Benton and Erik Erlandson
Apache Spark for Library Developers with William Benton and Erik Erlandson
 
Postgres performance for humans
Postgres performance for humansPostgres performance for humans
Postgres performance for humans
 
Practical RxJava for Android
Practical RxJava for AndroidPractical RxJava for Android
Practical RxJava for Android
 
RxJava applied [JavaDay Kyiv 2016]
RxJava applied [JavaDay Kyiv 2016]RxJava applied [JavaDay Kyiv 2016]
RxJava applied [JavaDay Kyiv 2016]
 
«Практическое применение Akka Streams» — Алексей Романчук, 2ГИС
«Практическое применение Akka Streams» — Алексей Романчук, 2ГИС«Практическое применение Akka Streams» — Алексей Романчук, 2ГИС
«Практическое применение Akka Streams» — Алексей Романчук, 2ГИС
 
Практическое применения Akka Streams
Практическое применения Akka StreamsПрактическое применения Akka Streams
Практическое применения Akka Streams
 
Java Performance Puzzlers
Java Performance PuzzlersJava Performance Puzzlers
Java Performance Puzzlers
 
Hive - ORIEN IT
Hive - ORIEN ITHive - ORIEN IT
Hive - ORIEN IT
 

Último

Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 

Último (20)

Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 

JPoint 2016 - Валеев Тагир - Странности Stream API