SlideShare una empresa de Scribd logo
1 de 64
Descargar para leer sin conexión
Safe Automated Refactoring for Intelligent
Parallelization of Java 8 Streams
Raffi Khatchadourian1,2
Yiming Tang2
Mehdi Bagherzadeh3
Syed
Ahmed3
International Conference on Software Engineering
May 31, 2019, Montr´eal, Canada
1
Computer Science, City University of New York (CUNY) Hunter College, USA
2
Computer Science, City University of New York (CUNY) Graduate Center, USA
3
Computing Science & Engineering, Oakland University, USA
Introduction
Streaming APIs
• Streaming APIs are widely-available in today’s mainstream,
Object-Oriented programming languages [Biboudis et al., 2015].
1
Streaming APIs
• Streaming APIs are widely-available in today’s mainstream,
Object-Oriented programming languages [Biboudis et al., 2015].
• Incorporate MapReduce-like operations on native data structures like
collections.
1
Streaming APIs
• Streaming APIs are widely-available in today’s mainstream,
Object-Oriented programming languages [Biboudis et al., 2015].
• Incorporate MapReduce-like operations on native data structures like
collections.
• Can make writing parallel code easier, less error-prone (avoid data
races, thread contention).
1
Motivation
Problem
• MapReduce traditionally runs in highly-distributed environments
with no shared memory.
2
Problem
• MapReduce traditionally runs in highly-distributed environments
with no shared memory.
• Streaming APIs typically execute on a single node under multiple
threads or cores in a shared memory space.
2
Problem
• MapReduce traditionally runs in highly-distributed environments
with no shared memory.
• Streaming APIs typically execute on a single node under multiple
threads or cores in a shared memory space.
• Collections reside in local memory.
2
Problem
• MapReduce traditionally runs in highly-distributed environments
with no shared memory.
• Streaming APIs typically execute on a single node under multiple
threads or cores in a shared memory space.
• Collections reside in local memory.
• Issues may arise from close ties between shared memory and the
operations.
2
Problem
• MapReduce traditionally runs in highly-distributed environments
with no shared memory.
• Streaming APIs typically execute on a single node under multiple
threads or cores in a shared memory space.
• Collections reside in local memory.
• Issues may arise from close ties between shared memory and the
operations.
• Developers must manually determine whether running stream code
in parallel is efficient yet interference-free.
2
Problem
• MapReduce traditionally runs in highly-distributed environments
with no shared memory.
• Streaming APIs typically execute on a single node under multiple
threads or cores in a shared memory space.
• Collections reside in local memory.
• Issues may arise from close ties between shared memory and the
operations.
• Developers must manually determine whether running stream code
in parallel is efficient yet interference-free.
• Requires thorough understanding of the API.
2
Problem
• MapReduce traditionally runs in highly-distributed environments
with no shared memory.
• Streaming APIs typically execute on a single node under multiple
threads or cores in a shared memory space.
• Collections reside in local memory.
• Issues may arise from close ties between shared memory and the
operations.
• Developers must manually determine whether running stream code
in parallel is efficient yet interference-free.
• Requires thorough understanding of the API.
• Error-prone, possibly requiring complex analysis.
2
Problem
• MapReduce traditionally runs in highly-distributed environments
with no shared memory.
• Streaming APIs typically execute on a single node under multiple
threads or cores in a shared memory space.
• Collections reside in local memory.
• Issues may arise from close ties between shared memory and the
operations.
• Developers must manually determine whether running stream code
in parallel is efficient yet interference-free.
• Requires thorough understanding of the API.
• Error-prone, possibly requiring complex analysis.
• Omission-prone, optimization opportunities may be missed.
2
Motivating Example
1 List<Widget> sortedWidgets
2 = unorderedWidgets
3 .stream()
4 .sorted(Comparator
5 .comparing(
6 Widget::getWeight))
7 .collect(
8 Collectors.toList());
1 List<Widget> sortedWidgets
2 = unorderedWidgets
3 .stream()parallelStream()
4 .sorted(Comparator
5 .comparing(
6 Widget::getWeight))
7 .collect(
8 Collectors.toList());
3
Motivating Example
1 List<Widget> sortedWidgets
2 = unorderedWidgets
3 .stream()
4 .sorted(Comparator
5 .comparing(
6 Widget::getWeight))
7 .collect(
8 Collectors.toList());
1 List<Widget> sortedWidgets
2 = unorderedWidgets
3 .stream()parallelStream()
4 .sorted(Comparator
5 .comparing(
6 Widget::getWeight))
7 .collect(
8 Collectors.toList());
• We can perform the transformation at line 3 because the operations
do not access shared memory, i.e., no side-effects.
3
Motivating Example
1 List<Widget> sortedWidgets
2 = unorderedWidgets
3 .stream()
4 .sorted(Comparator
5 .comparing(
6 Widget::getWeight))
7 .collect(
8 Collectors.toList());
1 List<Widget> sortedWidgets
2 = unorderedWidgets
3 .stream()parallelStream()
4 .sorted(Comparator
5 .comparing(
6 Widget::getWeight))
7 .collect(
8 Collectors.toList());
• We can perform the transformation at line 3 because the operations
do not access shared memory, i.e., no side-effects.
• Had the stream been ordered, however, running in parallel may
result in worse performance due to sorted() requiring multiple
passes and data buffering.
3
Motivating Example
1 List<Widget> sortedWidgets
2 = unorderedWidgets
3 .stream()
4 .sorted(Comparator
5 .comparing(
6 Widget::getWeight))
7 .collect(
8 Collectors.toList());
1 List<Widget> sortedWidgets
2 = unorderedWidgets
3 .stream()parallelStream()
4 .sorted(Comparator
5 .comparing(
6 Widget::getWeight))
7 .collect(
8 Collectors.toList());
• We can perform the transformation at line 3 because the operations
do not access shared memory, i.e., no side-effects.
• Had the stream been ordered, however, running in parallel may
result in worse performance due to sorted() requiring multiple
passes and data buffering.
• Such operations are called stateful intermediate operations (SIOs).
3
Motivating Example
1 List<Widget> sortedWidgets
2 = unorderedWidgets
3 .stream()
4 .sorted(Comparator
5 .comparing(
6 Widget::getWeight))
7 .collect(
8 Collectors.toList());
1 List<Widget> sortedWidgets
2 = unorderedWidgets
3 .stream()parallelStream()
4 .sorted(Comparator
5 .comparing(
6 Widget::getWeight))
7 .collect(
8 Collectors.toList());
• We can perform the transformation at line 3 because the operations
do not access shared memory, i.e., no side-effects.
• Had the stream been ordered, however, running in parallel may
result in worse performance due to sorted() requiring multiple
passes and data buffering.
• Such operations are called stateful intermediate operations (SIOs).
• Maintaining data ordering is detrimental to parallel performance.
3
Motivating Example
1 // collect distinct widget
2 // weights into a TreeSet.
3 Set<Double>
4 distinctWeightSet =
5 orderedWidgets
6 .stream()
7 .parallel()
8 .map(Widget::getWeight)
9 .distinct()
10 .collect(Collectors
11 .toCollection(
12 TreeSet::new));
1 // collect distinct widget
2 // weights into a TreeSet.
3 Set<Double>
4 distinctWeightSet =
5 orderedWidgets
6 .stream()
7 .parallel()
8 .map(Widget::getWeight)
9 .distinct()
10 .collect(Collectors
11 .toCollection(
12 TreeSet::new));
4
Motivating Example
1 // collect distinct widget
2 // weights into a TreeSet.
3 Set<Double>
4 distinctWeightSet =
5 orderedWidgets
6 .stream()
7 .parallel()
8 .map(Widget::getWeight)
9 .distinct()
10 .collect(Collectors
11 .toCollection(
12 TreeSet::new));
1 // collect distinct widget
2 // weights into a TreeSet.
3 Set<Double>
4 distinctWeightSet =
5 orderedWidgets
6 .stream()
7 .parallel()
8 .map(Widget::getWeight)
9 .distinct()
10 .collect(Collectors
11 .toCollection(
12 TreeSet::new));
• Computation is already in parallel (line 7).
4
Motivating Example
1 // collect distinct widget
2 // weights into a TreeSet.
3 Set<Double>
4 distinctWeightSet =
5 orderedWidgets
6 .stream()
7 .parallel()
8 .map(Widget::getWeight)
9 .distinct()
10 .collect(Collectors
11 .toCollection(
12 TreeSet::new));
1 // collect distinct widget
2 // weights into a TreeSet.
3 Set<Double>
4 distinctWeightSet =
5 orderedWidgets
6 .stream()
7 .parallel()
8 .map(Widget::getWeight)
9 .distinct()
10 .collect(Collectors
11 .toCollection(
12 TreeSet::new));
• Computation is already in parallel (line 7).
• distinct() is an SIO and the stream is ordered.
4
Motivating Example
1 // collect distinct widget
2 // weights into a TreeSet.
3 Set<Double>
4 distinctWeightSet =
5 orderedWidgets
6 .stream()
7 .parallel()
8 .map(Widget::getWeight)
9 .distinct()
10 .collect(Collectors
11 .toCollection(
12 TreeSet::new));
1 // collect distinct widget
2 // weights into a TreeSet.
3 Set<Double>
4 distinctWeightSet =
5 orderedWidgets
6 .stream()
7 .parallel()
8 .map(Widget::getWeight)
9 .distinct()
10 .collect(Collectors
11 .toCollection(
12 TreeSet::new));
• Computation is already in parallel (line 7).
• distinct() is an SIO and the stream is ordered.
• Can we keep it in parallel? No, because TreeSets are ordered.
4
Motivating Example
1 // collect distinct widget
2 // weights into a TreeSet.
3 Set<Double>
4 distinctWeightSet =
5 orderedWidgets
6 .stream()
7 .parallel()
8 .map(Widget::getWeight)
9 .distinct()
10 .collect(Collectors
11 .toCollection(
12 TreeSet::new));
1 // collect distinct widget
2 // weights into a TreeSet.
3 Set<Double>
4 distinctWeightSet =
5 orderedWidgets
6 .stream()
7 .parallel()
8 .map(Widget::getWeight)
9 .distinct()
10 .collect(Collectors
11 .toCollection(
12 TreeSet::new));
• Computation is already in parallel (line 7).
• distinct() is an SIO and the stream is ordered.
• Can we keep it in parallel? No, because TreeSets are ordered.
• De-parallelize on line 7.
4
Approach
Solution
• Devised a fully-automated, semantics-preserving refactoring
approach.
5
Solution
• Devised a fully-automated, semantics-preserving refactoring
approach.
• Embodied by an open source refactoring tool named Optimize
Streams.
5
Solution
• Devised a fully-automated, semantics-preserving refactoring
approach.
• Embodied by an open source refactoring tool named Optimize
Streams.
• Transforms Java 8 stream code for improved performance.
5
Solution
• Devised a fully-automated, semantics-preserving refactoring
approach.
• Embodied by an open source refactoring tool named Optimize
Streams.
• Transforms Java 8 stream code for improved performance.
• Based on:
5
Solution
• Devised a fully-automated, semantics-preserving refactoring
approach.
• Embodied by an open source refactoring tool named Optimize
Streams.
• Transforms Java 8 stream code for improved performance.
• Based on:
• Novel ordering analysis.
5
Solution
• Devised a fully-automated, semantics-preserving refactoring
approach.
• Embodied by an open source refactoring tool named Optimize
Streams.
• Transforms Java 8 stream code for improved performance.
• Based on:
• Novel ordering analysis.
• Infers when maintaining ordering is necessary for semantics
preservation.
5
Solution
• Devised a fully-automated, semantics-preserving refactoring
approach.
• Embodied by an open source refactoring tool named Optimize
Streams.
• Transforms Java 8 stream code for improved performance.
• Based on:
• Novel ordering analysis.
• Infers when maintaining ordering is necessary for semantics
preservation.
• Typestate analysis [Fink et al., 2008; Strom and Yemini, 1986].
5
Solution
• Devised a fully-automated, semantics-preserving refactoring
approach.
• Embodied by an open source refactoring tool named Optimize
Streams.
• Transforms Java 8 stream code for improved performance.
• Based on:
• Novel ordering analysis.
• Infers when maintaining ordering is necessary for semantics
preservation.
• Typestate analysis [Fink et al., 2008; Strom and Yemini, 1986].
• Augments the type system with “state.”
5
Solution
• Devised a fully-automated, semantics-preserving refactoring
approach.
• Embodied by an open source refactoring tool named Optimize
Streams.
• Transforms Java 8 stream code for improved performance.
• Based on:
• Novel ordering analysis.
• Infers when maintaining ordering is necessary for semantics
preservation.
• Typestate analysis [Fink et al., 2008; Strom and Yemini, 1986].
• Augments the type system with “state.”
• Traditionally used for preventing resource usage errors.
5
Solution
• Devised a fully-automated, semantics-preserving refactoring
approach.
• Embodied by an open source refactoring tool named Optimize
Streams.
• Transforms Java 8 stream code for improved performance.
• Based on:
• Novel ordering analysis.
• Infers when maintaining ordering is necessary for semantics
preservation.
• Typestate analysis [Fink et al., 2008; Strom and Yemini, 1986].
• Augments the type system with “state.”
• Traditionally used for preventing resource usage errors.
• Requires interprocedural and alias analyses.
5
Solution
• Devised a fully-automated, semantics-preserving refactoring
approach.
• Embodied by an open source refactoring tool named Optimize
Streams.
• Transforms Java 8 stream code for improved performance.
• Based on:
• Novel ordering analysis.
• Infers when maintaining ordering is necessary for semantics
preservation.
• Typestate analysis [Fink et al., 2008; Strom and Yemini, 1986].
• Augments the type system with “state.”
• Traditionally used for preventing resource usage errors.
• Requires interprocedural and alias analyses.
• Novel adaptation for possibly immutable objects (streams).
5
Solution Highlights
• First to integrate automated refactoring with typestate analysis.1
1To the best of our knowledge.
2http://wala.sf.net
3http://git.io/vxwBs
6
Solution Highlights
• First to integrate automated refactoring with typestate analysis.1
• Uses WALA static analysis framework2
and the SAFE typestate
analysis engine.3
1To the best of our knowledge.
2http://wala.sf.net
3http://git.io/vxwBs
6
Solution Highlights
• First to integrate automated refactoring with typestate analysis.1
• Uses WALA static analysis framework2
and the SAFE typestate
analysis engine.3
• Combines analysis results from varying IR representations (SSA,
AST).
1To the best of our knowledge.
2http://wala.sf.net
3http://git.io/vxwBs
6
Identifying Refactoring Preconditions
• Refactoring preconditions are conditions that must hold to guarantee
that the transformation is type-correct and semantics-preserving.
7
Identifying Refactoring Preconditions
• Refactoring preconditions are conditions that must hold to guarantee
that the transformation is type-correct and semantics-preserving.
• Our refactoring is (conceptually) split into two:
7
Identifying Refactoring Preconditions
• Refactoring preconditions are conditions that must hold to guarantee
that the transformation is type-correct and semantics-preserving.
• Our refactoring is (conceptually) split into two:
• Convert Sequential Stream to Parallel.
7
Identifying Refactoring Preconditions
• Refactoring preconditions are conditions that must hold to guarantee
that the transformation is type-correct and semantics-preserving.
• Our refactoring is (conceptually) split into two:
• Convert Sequential Stream to Parallel.
• Optimize Parallel Stream.
7
Identifying Refactoring Preconditions
Table 1: Convert Sequential Stream to Parallel preconditions.
exe ord se SIO ROM transformation
P1 seq unord F N/A N/A Convert to para.
P2 seq ord F F N/A Convert to para.
P3 seq ord F T F Unorder and convert to para.
8
Identifying Refactoring Preconditions
Table 2: Optimize Parallel Stream preconditions.
exe ord SIO ROM transformation
P4 para ord T F Unorder.
P5 para ord T T Convert to seq.
9
DFA for Determining Stream Execution Mode
⊥ start
seq para
Col.stream(),
BufferedReader.lines(),
Files.lines(Path),
JarFile.stream(),
Pattern.splitAsStream(),
Random.ints()
Col.parallelStream()
BaseStream.sequential()
BaseStream.parallel()
BaseStream.sequential()
BaseStream.parallel()
Figure 1: A subset of the relation E→ in E = (ES , EΛ, E→).
10
DFA for Determining Stream Ordering
⊥
start
ord unord
Arrays.stream(T[]),
Stream.of(T...),
IntStream.range(),
Stream.iterate(),
BitSet.stream(),
Col.parallelStream()
Stream.generate(),
HashSet.stream(),
PriorityQueue.stream(),
CopyOnWrite.parallelStream(),
BeanContextSupport.stream(),
Random.ints()
Stream.sorted()
BaseStream.unordered(),
Stream.concat(unordered),
Stream.concat(ordered)
Stream.sorted(),
Stream.concat(ordered)
BaseStream.unordered(),
Stream.concat(unordered)
Figure 2: A subset of the relation O→ in O = (OS , OΛ, O→).
11
Evaluation
Optimize Streams Eclipse Refactoring Plug-in
• Implemented an open source refactoring tool named Optimize
Streams.
4http://eclipse.org.
5Available at http://git.io/vpTLk.
12
Optimize Streams Eclipse Refactoring Plug-in
• Implemented an open source refactoring tool named Optimize
Streams.
• Publicly available as an open source Eclipse IDE4
plug-in.5
4http://eclipse.org.
5Available at http://git.io/vpTLk.
12
Optimize Streams Eclipse Refactoring Plug-in
• Implemented an open source refactoring tool named Optimize
Streams.
• Publicly available as an open source Eclipse IDE4
plug-in.5
• Can we be used by projects not using Eclipse.
4http://eclipse.org.
5Available at http://git.io/vpTLk.
12
Optimize Streams Eclipse Refactoring Plug-in
• Implemented an open source refactoring tool named Optimize
Streams.
• Publicly available as an open source Eclipse IDE4
plug-in.5
• Can we be used by projects not using Eclipse.
• Includes fully-functional UI, preview pane, and refactoring unit tests.
4http://eclipse.org.
5Available at http://git.io/vpTLk.
12
Results
• Applied to 11 Java projects of varying size and domain with a total
of ∼642 KSLOC.
13
Results
• Applied to 11 Java projects of varying size and domain with a total
of ∼642 KSLOC.
• 36.31% candidate streams were refactorable.
13
Results
• Applied to 11 Java projects of varying size and domain with a total
of ∼642 KSLOC.
• 36.31% candidate streams were refactorable.
• Observed an average speedup of 3.49 during performance testing.
13
Results
• Applied to 11 Java projects of varying size and domain with a total
of ∼642 KSLOC.
• 36.31% candidate streams were refactorable.
• Observed an average speedup of 3.49 during performance testing.
• See paper and [Khatchadourian et al., 2018] for more details,
including user feedback, as well as tool and data set engineering
challenges.
13
Results
Table 3: Experimental results.
subject KLOC eps k str rft P1 P2 P3 t (m)
htm.java 41.14 21 4 34 10 0 10 0 1.85
JacpFX 23.79 195 4 4 3 3 0 0 2.31
jdp* 19.96 25 4 28 15 1 13 1 31.88
jdk8-exp* 3.43 134 4 26 4 0 4 0 0.78
jetty 354.48 106 4 21 7 3 4 0 17.85
jOOQ 154.01 43 4 5 1 0 1 0 12.94
koral 7.13 51 3 6 6 0 6 0 1.06
monads 1.01 47 2 1 1 0 1 0 0.05
retroλ 5.14 1 4 8 6 3 3 0 0.66
streamql 4.01 92 2 22 2 0 2 0 0.72
threeten 27.53 36 2 2 2 0 2 0 0.51
Total 641.65 751 4 157 57 10 46 1 70.60
* jdp is java-design-patterns and jdk8-exp is jdk8-experiments.
14
Performance Evaluation
Table 4: Average run times of JMH benchmarks.
# benchmark orig (s/op) refact (s/op) su
1 shouldRetrieveChildren 0.011 (0.001) 0.002 (0.000) 6.57
2 shouldConstructCar 0.011 (0.001) 0.001 (0.000) 8.22
3 addingShouldResultInFailure 0.014 (0.000) 0.004 (0.000) 3.78
4 deletionShouldBeSuccess 0.013 (0.000) 0.003 (0.000) 3.82
5 addingShouldResultInSuccess 0.027 (0.000) 0.005 (0.000) 5.08
6 deletionShouldBeFailure 0.014 (0.000) 0.004 (0.000) 3.90
7 specification.AppTest.test 12.666 (5.961) 12.258 (1.880) 1.03
8 CoffeeMakingTaskTest.testId 0.681 (0.065) 0.469 (0.009) 1.45
9 PotatoPeelingTaskTest.testId 0.676 (0.062) 0.465 (0.008) 1.45
10 SpatialPoolerLocalInhibition 1.580 (0.168) 1.396 (0.029) 1.13
11 TemporalMemory 0.013 (0.001) 0.006 (0.000) 1.97
15
Conclusion
Conclusion
• Optimize Streams is an open source, automated refactoring tool
that assists developers with writing optimal Java 8 Stream code.
16
Conclusion
• Optimize Streams is an open source, automated refactoring tool
that assists developers with writing optimal Java 8 Stream code.
• Integrates an Eclipse refactoring with the advanced static analyses
offered by WALA and SAFE.
16
Conclusion
• Optimize Streams is an open source, automated refactoring tool
that assists developers with writing optimal Java 8 Stream code.
• Integrates an Eclipse refactoring with the advanced static analyses
offered by WALA and SAFE.
• 11 Java projects totaling ∼642 thousands of lines of code were used
in the tool’s assessment.
16
Conclusion
• Optimize Streams is an open source, automated refactoring tool
that assists developers with writing optimal Java 8 Stream code.
• Integrates an Eclipse refactoring with the advanced static analyses
offered by WALA and SAFE.
• 11 Java projects totaling ∼642 thousands of lines of code were used
in the tool’s assessment.
• An average speedup of 3.49 on the refactored code was observed as
part of a experimental study.
16
For Further Reading
Biboudis, Aggelos, Nick Palladinos, George Fourtounis, and Yannis Smaragdakis
(2015). “Streams `a la carte: Extensible Pipelines with Object Algebras”. In:
ECOOP, pp. 591–613. doi: 10.4230/LIPIcs.ECOOP.2015.591.
Fink, Stephen J., Eran Yahav, Nurit Dor, G. Ramalingam, and Emmanuel Geay (May
2008). “Effective Typestate Verification in the Presence of Aliasing”. In: ACM
TOSEM 17.2, pp. 91–934. doi: 10.1145/1348250.1348255.
Khatchadourian, Raffi, Yiming Tang, Mehdi Bagherzadeh, and Syed Ahmed (Sept.
2018). “A Tool for Optimizing Java 8 Stream Software via Automated
Refactoring”. In: International Working Conference on Source Code Analysis and
Manipulation. SCAM ’18. Engineering Track. Distinguished Paper Award. IEEE.
IEEE Press, pp. 34–39. doi: 10.1109/SCAM.2018.00011.
Strom, Robert E and Shaula Yemini (Jan. 1986). “Typestate: A programming
language concept for enhancing software reliability”. In: IEEE TSE SE-12.1,
pp. 157–171. doi: 10.1109/tse.1986.6312929.
17

Más contenido relacionado

La actualidad más candente

Stream processing from single node to a cluster
Stream processing from single node to a clusterStream processing from single node to a cluster
Stream processing from single node to a clusterGal Marder
 
Effective Java. By materials of Josch Bloch's book
Effective Java. By materials of Josch Bloch's bookEffective Java. By materials of Josch Bloch's book
Effective Java. By materials of Josch Bloch's bookRoman Tsypuk
 
EVERYTHING ABOUT STATIC CODE ANALYSIS FOR A JAVA PROGRAMMER
EVERYTHING ABOUT STATIC CODE ANALYSIS FOR A JAVA PROGRAMMEREVERYTHING ABOUT STATIC CODE ANALYSIS FOR A JAVA PROGRAMMER
EVERYTHING ABOUT STATIC CODE ANALYSIS FOR A JAVA PROGRAMMERAndrey Karpov
 
JDD 2016 - Grzegorz Rozniecki - Java 8 What Could Possibly Go Wrong
JDD 2016 - Grzegorz Rozniecki - Java 8 What Could Possibly Go WrongJDD 2016 - Grzegorz Rozniecki - Java 8 What Could Possibly Go Wrong
JDD 2016 - Grzegorz Rozniecki - Java 8 What Could Possibly Go WrongPROIDEA
 
The Materials Project Ecosystem - A Complete Software and Data Platform for M...
The Materials Project Ecosystem - A Complete Software and Data Platform for M...The Materials Project Ecosystem - A Complete Software and Data Platform for M...
The Materials Project Ecosystem - A Complete Software and Data Platform for M...University of California, San Diego
 
.NET Core, ASP.NET Core Course, Session 5
.NET Core, ASP.NET Core Course, Session 5.NET Core, ASP.NET Core Course, Session 5
.NET Core, ASP.NET Core Course, Session 5aminmesbahi
 
Writing Galaxy Tools
Writing Galaxy ToolsWriting Galaxy Tools
Writing Galaxy Toolspjacock
 
.NET Core, ASP.NET Core Course, Session 9
.NET Core, ASP.NET Core Course, Session 9.NET Core, ASP.NET Core Course, Session 9
.NET Core, ASP.NET Core Course, Session 9aminmesbahi
 
.NET Core, ASP.NET Core Course, Session 4
.NET Core, ASP.NET Core Course, Session 4.NET Core, ASP.NET Core Course, Session 4
.NET Core, ASP.NET Core Course, Session 4aminmesbahi
 
JVM languages "flame wars"
JVM languages "flame wars"JVM languages "flame wars"
JVM languages "flame wars"Gal Marder
 
Introduction to Java 8
Introduction to Java 8Introduction to Java 8
Introduction to Java 8Knoldus Inc.
 

La actualidad más candente (20)

Stream processing from single node to a cluster
Stream processing from single node to a clusterStream processing from single node to a cluster
Stream processing from single node to a cluster
 
Effective Java. By materials of Josch Bloch's book
Effective Java. By materials of Josch Bloch's bookEffective Java. By materials of Josch Bloch's book
Effective Java. By materials of Josch Bloch's book
 
Introduction to new features in java 8
Introduction to new features in java 8Introduction to new features in java 8
Introduction to new features in java 8
 
Java 5 and 6 New Features
Java 5 and 6 New FeaturesJava 5 and 6 New Features
Java 5 and 6 New Features
 
EVERYTHING ABOUT STATIC CODE ANALYSIS FOR A JAVA PROGRAMMER
EVERYTHING ABOUT STATIC CODE ANALYSIS FOR A JAVA PROGRAMMEREVERYTHING ABOUT STATIC CODE ANALYSIS FOR A JAVA PROGRAMMER
EVERYTHING ABOUT STATIC CODE ANALYSIS FOR A JAVA PROGRAMMER
 
Complete Java Course
Complete Java CourseComplete Java Course
Complete Java Course
 
JDK1.6
JDK1.6JDK1.6
JDK1.6
 
Software Architecture - Quiz Questions
Software Architecture - Quiz QuestionsSoftware Architecture - Quiz Questions
Software Architecture - Quiz Questions
 
JDD 2016 - Grzegorz Rozniecki - Java 8 What Could Possibly Go Wrong
JDD 2016 - Grzegorz Rozniecki - Java 8 What Could Possibly Go WrongJDD 2016 - Grzegorz Rozniecki - Java 8 What Could Possibly Go Wrong
JDD 2016 - Grzegorz Rozniecki - Java 8 What Could Possibly Go Wrong
 
Servlet Filter
Servlet FilterServlet Filter
Servlet Filter
 
The Materials Project Ecosystem - A Complete Software and Data Platform for M...
The Materials Project Ecosystem - A Complete Software and Data Platform for M...The Materials Project Ecosystem - A Complete Software and Data Platform for M...
The Materials Project Ecosystem - A Complete Software and Data Platform for M...
 
.NET Core, ASP.NET Core Course, Session 5
.NET Core, ASP.NET Core Course, Session 5.NET Core, ASP.NET Core Course, Session 5
.NET Core, ASP.NET Core Course, Session 5
 
Writing Galaxy Tools
Writing Galaxy ToolsWriting Galaxy Tools
Writing Galaxy Tools
 
Spring data jpa
Spring data jpaSpring data jpa
Spring data jpa
 
.NET Core, ASP.NET Core Course, Session 9
.NET Core, ASP.NET Core Course, Session 9.NET Core, ASP.NET Core Course, Session 9
.NET Core, ASP.NET Core Course, Session 9
 
.NET Core, ASP.NET Core Course, Session 4
.NET Core, ASP.NET Core Course, Session 4.NET Core, ASP.NET Core Course, Session 4
.NET Core, ASP.NET Core Course, Session 4
 
JDK8 Streams
JDK8 StreamsJDK8 Streams
JDK8 Streams
 
JVM languages "flame wars"
JVM languages "flame wars"JVM languages "flame wars"
JVM languages "flame wars"
 
Introduction to Java 8
Introduction to Java 8Introduction to Java 8
Introduction to Java 8
 
Migrate to Drupal 8
Migrate to Drupal 8Migrate to Drupal 8
Migrate to Drupal 8
 

Similar a Safe Automated Refactoring for Intelligent Parallelization of Java 8 Streams

[ACNA2022] Hadoop Vectored IO_ your data just got faster!.pdf
[ACNA2022] Hadoop Vectored IO_ your data just got faster!.pdf[ACNA2022] Hadoop Vectored IO_ your data just got faster!.pdf
[ACNA2022] Hadoop Vectored IO_ your data just got faster!.pdfMukundThakur22
 
An Engineer's Intro to Oracle Coherence
An Engineer's Intro to Oracle CoherenceAn Engineer's Intro to Oracle Coherence
An Engineer's Intro to Oracle CoherenceOracle
 
Scalable Distributed Real-Time Clustering for Big Data Streams
Scalable Distributed Real-Time Clustering for Big Data StreamsScalable Distributed Real-Time Clustering for Big Data Streams
Scalable Distributed Real-Time Clustering for Big Data StreamsAntonio Severien
 
GemFire In Memory Data Grid
GemFire In Memory Data GridGemFire In Memory Data Grid
GemFire In Memory Data GridDmitry Buzdin
 
JavaOne2016 - Microservices: Terabytes in Microseconds [CON4516]
JavaOne2016 - Microservices: Terabytes in Microseconds [CON4516]JavaOne2016 - Microservices: Terabytes in Microseconds [CON4516]
JavaOne2016 - Microservices: Terabytes in Microseconds [CON4516]Speedment, Inc.
 
JavaOne2016 - Microservices: Terabytes in Microseconds [CON4516]
JavaOne2016 - Microservices: Terabytes in Microseconds [CON4516]JavaOne2016 - Microservices: Terabytes in Microseconds [CON4516]
JavaOne2016 - Microservices: Terabytes in Microseconds [CON4516]Malin Weiss
 
It summit 150604 cb_wcl_ld_kmh_v6_to_publish
It summit 150604 cb_wcl_ld_kmh_v6_to_publishIt summit 150604 cb_wcl_ld_kmh_v6_to_publish
It summit 150604 cb_wcl_ld_kmh_v6_to_publishkevin_donovan
 
Distribute Storage System May-2014
Distribute Storage System May-2014Distribute Storage System May-2014
Distribute Storage System May-2014Công Lợi Dương
 
TU-Charts Project - First Spring
TU-Charts Project - First SpringTU-Charts Project - First Spring
TU-Charts Project - First SpringDidac Montero
 
Software architecture for data applications
Software architecture for data applicationsSoftware architecture for data applications
Software architecture for data applicationsDing Li
 
Optimizing your java applications for multi core hardware
Optimizing your java applications for multi core hardwareOptimizing your java applications for multi core hardware
Optimizing your java applications for multi core hardwareIndicThreads
 

Similar a Safe Automated Refactoring for Intelligent Parallelization of Java 8 Streams (20)

Java 8
Java 8Java 8
Java 8
 
[ACNA2022] Hadoop Vectored IO_ your data just got faster!.pdf
[ACNA2022] Hadoop Vectored IO_ your data just got faster!.pdf[ACNA2022] Hadoop Vectored IO_ your data just got faster!.pdf
[ACNA2022] Hadoop Vectored IO_ your data just got faster!.pdf
 
SSBSE10.ppt
SSBSE10.pptSSBSE10.ppt
SSBSE10.ppt
 
An Engineer's Intro to Oracle Coherence
An Engineer's Intro to Oracle CoherenceAn Engineer's Intro to Oracle Coherence
An Engineer's Intro to Oracle Coherence
 
GemFire In-Memory Data Grid
GemFire In-Memory Data GridGemFire In-Memory Data Grid
GemFire In-Memory Data Grid
 
Scalable Distributed Real-Time Clustering for Big Data Streams
Scalable Distributed Real-Time Clustering for Big Data StreamsScalable Distributed Real-Time Clustering for Big Data Streams
Scalable Distributed Real-Time Clustering for Big Data Streams
 
GemFire In Memory Data Grid
GemFire In Memory Data GridGemFire In Memory Data Grid
GemFire In Memory Data Grid
 
Clustering van IT-componenten
Clustering van IT-componentenClustering van IT-componenten
Clustering van IT-componenten
 
JavaOne2016 - Microservices: Terabytes in Microseconds [CON4516]
JavaOne2016 - Microservices: Terabytes in Microseconds [CON4516]JavaOne2016 - Microservices: Terabytes in Microseconds [CON4516]
JavaOne2016 - Microservices: Terabytes in Microseconds [CON4516]
 
JavaOne2016 - Microservices: Terabytes in Microseconds [CON4516]
JavaOne2016 - Microservices: Terabytes in Microseconds [CON4516]JavaOne2016 - Microservices: Terabytes in Microseconds [CON4516]
JavaOne2016 - Microservices: Terabytes in Microseconds [CON4516]
 
Wt unit 3
Wt unit 3 Wt unit 3
Wt unit 3
 
It summit 150604 cb_wcl_ld_kmh_v6_to_publish
It summit 150604 cb_wcl_ld_kmh_v6_to_publishIt summit 150604 cb_wcl_ld_kmh_v6_to_publish
It summit 150604 cb_wcl_ld_kmh_v6_to_publish
 
Distribute Storage System May-2014
Distribute Storage System May-2014Distribute Storage System May-2014
Distribute Storage System May-2014
 
First spring
First springFirst spring
First spring
 
TU-Charts Project - First Spring
TU-Charts Project - First SpringTU-Charts Project - First Spring
TU-Charts Project - First Spring
 
Noha mega store
Noha mega storeNoha mega store
Noha mega store
 
Nosql databases
Nosql databasesNosql databases
Nosql databases
 
Software architecture for data applications
Software architecture for data applicationsSoftware architecture for data applications
Software architecture for data applications
 
Ssbse10.ppt
Ssbse10.pptSsbse10.ppt
Ssbse10.ppt
 
Optimizing your java applications for multi core hardware
Optimizing your java applications for multi core hardwareOptimizing your java applications for multi core hardware
Optimizing your java applications for multi core hardware
 

Más de Raffi Khatchadourian

Towards Safe Automated Refactoring of Imperative Deep Learning Programs to Gr...
Towards Safe Automated Refactoring of Imperative Deep Learning Programs to Gr...Towards Safe Automated Refactoring of Imperative Deep Learning Programs to Gr...
Towards Safe Automated Refactoring of Imperative Deep Learning Programs to Gr...Raffi Khatchadourian
 
Automated Evolution of Feature Logging Statement Levels Using Git Histories a...
Automated Evolution of Feature Logging Statement Levels Using Git Histories a...Automated Evolution of Feature Logging Statement Levels Using Git Histories a...
Automated Evolution of Feature Logging Statement Levels Using Git Histories a...Raffi Khatchadourian
 
A Tool for Rejuvenating Feature Logging Levels via Git Histories and Degree o...
A Tool for Rejuvenating Feature Logging Levels via Git Histories and Degree o...A Tool for Rejuvenating Feature Logging Levels via Git Histories and Degree o...
A Tool for Rejuvenating Feature Logging Levels via Git Histories and Degree o...Raffi Khatchadourian
 
Challenges in Migrating Imperative Deep Learning Programs to Graph Execution:...
Challenges in Migrating Imperative Deep Learning Programs to Graph Execution:...Challenges in Migrating Imperative Deep Learning Programs to Graph Execution:...
Challenges in Migrating Imperative Deep Learning Programs to Graph Execution:...Raffi Khatchadourian
 
Actor Concurrency Bugs: A Comprehensive Study on Symptoms, Root Causes, API U...
Actor Concurrency Bugs: A Comprehensive Study on Symptoms, Root Causes, API U...Actor Concurrency Bugs: A Comprehensive Study on Symptoms, Root Causes, API U...
Actor Concurrency Bugs: A Comprehensive Study on Symptoms, Root Causes, API U...Raffi Khatchadourian
 
An Empirical Study of Refactorings and Technical Debt in Machine Learning Sys...
An Empirical Study of Refactorings and Technical Debt in Machine Learning Sys...An Empirical Study of Refactorings and Technical Debt in Machine Learning Sys...
An Empirical Study of Refactorings and Technical Debt in Machine Learning Sys...Raffi Khatchadourian
 
Automated Evolution of Feature Logging Statement Levels Using Git Histories a...
Automated Evolution of Feature Logging Statement Levels Using Git Histories a...Automated Evolution of Feature Logging Statement Levels Using Git Histories a...
Automated Evolution of Feature Logging Statement Levels Using Git Histories a...Raffi Khatchadourian
 
A Brief Introduction to Type Constraints
A Brief Introduction to Type ConstraintsA Brief Introduction to Type Constraints
A Brief Introduction to Type ConstraintsRaffi Khatchadourian
 
Porting the NetBeans Java 8 Enhanced For Loop Lambda Expression Refactoring t...
Porting the NetBeans Java 8 Enhanced For Loop Lambda Expression Refactoring t...Porting the NetBeans Java 8 Enhanced For Loop Lambda Expression Refactoring t...
Porting the NetBeans Java 8 Enhanced For Loop Lambda Expression Refactoring t...Raffi Khatchadourian
 
Proactive Empirical Assessment of New Language Feature Adoption via Automated...
Proactive Empirical Assessment of New Language Feature Adoption via Automated...Proactive Empirical Assessment of New Language Feature Adoption via Automated...
Proactive Empirical Assessment of New Language Feature Adoption via Automated...Raffi Khatchadourian
 
Defaultification Refactoring: A Tool for Automatically Converting Java Method...
Defaultification Refactoring: A Tool for Automatically Converting Java Method...Defaultification Refactoring: A Tool for Automatically Converting Java Method...
Defaultification Refactoring: A Tool for Automatically Converting Java Method...Raffi Khatchadourian
 
Defaultification Refactoring: A Tool for Automatically Converting Java Method...
Defaultification Refactoring: A Tool for Automatically Converting Java Method...Defaultification Refactoring: A Tool for Automatically Converting Java Method...
Defaultification Refactoring: A Tool for Automatically Converting Java Method...Raffi Khatchadourian
 
Automated Refactoring of Legacy Java Software to Default Methods Talk at ICSE...
Automated Refactoring of Legacy Java Software to Default Methods Talk at ICSE...Automated Refactoring of Legacy Java Software to Default Methods Talk at ICSE...
Automated Refactoring of Legacy Java Software to Default Methods Talk at ICSE...Raffi Khatchadourian
 
Poster on Automated Refactoring of Legacy Java Software to Default Methods
Poster on Automated Refactoring of Legacy Java Software to Default MethodsPoster on Automated Refactoring of Legacy Java Software to Default Methods
Poster on Automated Refactoring of Legacy Java Software to Default MethodsRaffi Khatchadourian
 
Automated Refactoring of Legacy Java Software to Default Methods Talk at GMU
Automated Refactoring of Legacy Java Software to Default Methods Talk at GMUAutomated Refactoring of Legacy Java Software to Default Methods Talk at GMU
Automated Refactoring of Legacy Java Software to Default Methods Talk at GMURaffi Khatchadourian
 
Towards Improving Interface Modularity in Legacy Java Software Through Automa...
Towards Improving Interface Modularity in Legacy Java Software Through Automa...Towards Improving Interface Modularity in Legacy Java Software Through Automa...
Towards Improving Interface Modularity in Legacy Java Software Through Automa...Raffi Khatchadourian
 
Detecting Broken Pointcuts using Structural Commonality and Degree of Interest
Detecting Broken Pointcuts using Structural Commonality and Degree of InterestDetecting Broken Pointcuts using Structural Commonality and Degree of Interest
Detecting Broken Pointcuts using Structural Commonality and Degree of InterestRaffi Khatchadourian
 
Fraglight: Shedding Light on Broken Pointcuts in Evolving Aspect-Oriented Sof...
Fraglight: Shedding Light on Broken Pointcuts in Evolving Aspect-Oriented Sof...Fraglight: Shedding Light on Broken Pointcuts in Evolving Aspect-Oriented Sof...
Fraglight: Shedding Light on Broken Pointcuts in Evolving Aspect-Oriented Sof...Raffi Khatchadourian
 
Fraglight: Shedding Light on Broken Pointcuts Using Structural Commonality
Fraglight: Shedding Light on Broken Pointcuts Using Structural CommonalityFraglight: Shedding Light on Broken Pointcuts Using Structural Commonality
Fraglight: Shedding Light on Broken Pointcuts Using Structural CommonalityRaffi Khatchadourian
 
Automatic Migration of Legacy Java Method Implementations to Interfaces
Automatic Migration of Legacy Java Method Implementations to InterfacesAutomatic Migration of Legacy Java Method Implementations to Interfaces
Automatic Migration of Legacy Java Method Implementations to InterfacesRaffi Khatchadourian
 

Más de Raffi Khatchadourian (20)

Towards Safe Automated Refactoring of Imperative Deep Learning Programs to Gr...
Towards Safe Automated Refactoring of Imperative Deep Learning Programs to Gr...Towards Safe Automated Refactoring of Imperative Deep Learning Programs to Gr...
Towards Safe Automated Refactoring of Imperative Deep Learning Programs to Gr...
 
Automated Evolution of Feature Logging Statement Levels Using Git Histories a...
Automated Evolution of Feature Logging Statement Levels Using Git Histories a...Automated Evolution of Feature Logging Statement Levels Using Git Histories a...
Automated Evolution of Feature Logging Statement Levels Using Git Histories a...
 
A Tool for Rejuvenating Feature Logging Levels via Git Histories and Degree o...
A Tool for Rejuvenating Feature Logging Levels via Git Histories and Degree o...A Tool for Rejuvenating Feature Logging Levels via Git Histories and Degree o...
A Tool for Rejuvenating Feature Logging Levels via Git Histories and Degree o...
 
Challenges in Migrating Imperative Deep Learning Programs to Graph Execution:...
Challenges in Migrating Imperative Deep Learning Programs to Graph Execution:...Challenges in Migrating Imperative Deep Learning Programs to Graph Execution:...
Challenges in Migrating Imperative Deep Learning Programs to Graph Execution:...
 
Actor Concurrency Bugs: A Comprehensive Study on Symptoms, Root Causes, API U...
Actor Concurrency Bugs: A Comprehensive Study on Symptoms, Root Causes, API U...Actor Concurrency Bugs: A Comprehensive Study on Symptoms, Root Causes, API U...
Actor Concurrency Bugs: A Comprehensive Study on Symptoms, Root Causes, API U...
 
An Empirical Study of Refactorings and Technical Debt in Machine Learning Sys...
An Empirical Study of Refactorings and Technical Debt in Machine Learning Sys...An Empirical Study of Refactorings and Technical Debt in Machine Learning Sys...
An Empirical Study of Refactorings and Technical Debt in Machine Learning Sys...
 
Automated Evolution of Feature Logging Statement Levels Using Git Histories a...
Automated Evolution of Feature Logging Statement Levels Using Git Histories a...Automated Evolution of Feature Logging Statement Levels Using Git Histories a...
Automated Evolution of Feature Logging Statement Levels Using Git Histories a...
 
A Brief Introduction to Type Constraints
A Brief Introduction to Type ConstraintsA Brief Introduction to Type Constraints
A Brief Introduction to Type Constraints
 
Porting the NetBeans Java 8 Enhanced For Loop Lambda Expression Refactoring t...
Porting the NetBeans Java 8 Enhanced For Loop Lambda Expression Refactoring t...Porting the NetBeans Java 8 Enhanced For Loop Lambda Expression Refactoring t...
Porting the NetBeans Java 8 Enhanced For Loop Lambda Expression Refactoring t...
 
Proactive Empirical Assessment of New Language Feature Adoption via Automated...
Proactive Empirical Assessment of New Language Feature Adoption via Automated...Proactive Empirical Assessment of New Language Feature Adoption via Automated...
Proactive Empirical Assessment of New Language Feature Adoption via Automated...
 
Defaultification Refactoring: A Tool for Automatically Converting Java Method...
Defaultification Refactoring: A Tool for Automatically Converting Java Method...Defaultification Refactoring: A Tool for Automatically Converting Java Method...
Defaultification Refactoring: A Tool for Automatically Converting Java Method...
 
Defaultification Refactoring: A Tool for Automatically Converting Java Method...
Defaultification Refactoring: A Tool for Automatically Converting Java Method...Defaultification Refactoring: A Tool for Automatically Converting Java Method...
Defaultification Refactoring: A Tool for Automatically Converting Java Method...
 
Automated Refactoring of Legacy Java Software to Default Methods Talk at ICSE...
Automated Refactoring of Legacy Java Software to Default Methods Talk at ICSE...Automated Refactoring of Legacy Java Software to Default Methods Talk at ICSE...
Automated Refactoring of Legacy Java Software to Default Methods Talk at ICSE...
 
Poster on Automated Refactoring of Legacy Java Software to Default Methods
Poster on Automated Refactoring of Legacy Java Software to Default MethodsPoster on Automated Refactoring of Legacy Java Software to Default Methods
Poster on Automated Refactoring of Legacy Java Software to Default Methods
 
Automated Refactoring of Legacy Java Software to Default Methods Talk at GMU
Automated Refactoring of Legacy Java Software to Default Methods Talk at GMUAutomated Refactoring of Legacy Java Software to Default Methods Talk at GMU
Automated Refactoring of Legacy Java Software to Default Methods Talk at GMU
 
Towards Improving Interface Modularity in Legacy Java Software Through Automa...
Towards Improving Interface Modularity in Legacy Java Software Through Automa...Towards Improving Interface Modularity in Legacy Java Software Through Automa...
Towards Improving Interface Modularity in Legacy Java Software Through Automa...
 
Detecting Broken Pointcuts using Structural Commonality and Degree of Interest
Detecting Broken Pointcuts using Structural Commonality and Degree of InterestDetecting Broken Pointcuts using Structural Commonality and Degree of Interest
Detecting Broken Pointcuts using Structural Commonality and Degree of Interest
 
Fraglight: Shedding Light on Broken Pointcuts in Evolving Aspect-Oriented Sof...
Fraglight: Shedding Light on Broken Pointcuts in Evolving Aspect-Oriented Sof...Fraglight: Shedding Light on Broken Pointcuts in Evolving Aspect-Oriented Sof...
Fraglight: Shedding Light on Broken Pointcuts in Evolving Aspect-Oriented Sof...
 
Fraglight: Shedding Light on Broken Pointcuts Using Structural Commonality
Fraglight: Shedding Light on Broken Pointcuts Using Structural CommonalityFraglight: Shedding Light on Broken Pointcuts Using Structural Commonality
Fraglight: Shedding Light on Broken Pointcuts Using Structural Commonality
 
Automatic Migration of Legacy Java Method Implementations to Interfaces
Automatic Migration of Legacy Java Method Implementations to InterfacesAutomatic Migration of Legacy Java Method Implementations to Interfaces
Automatic Migration of Legacy Java Method Implementations to Interfaces
 

Último

Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
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.pdfsudhanshuwaghmare1
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 

Último (20)

Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
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
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 

Safe Automated Refactoring for Intelligent Parallelization of Java 8 Streams

  • 1. Safe Automated Refactoring for Intelligent Parallelization of Java 8 Streams Raffi Khatchadourian1,2 Yiming Tang2 Mehdi Bagherzadeh3 Syed Ahmed3 International Conference on Software Engineering May 31, 2019, Montr´eal, Canada 1 Computer Science, City University of New York (CUNY) Hunter College, USA 2 Computer Science, City University of New York (CUNY) Graduate Center, USA 3 Computing Science & Engineering, Oakland University, USA
  • 3. Streaming APIs • Streaming APIs are widely-available in today’s mainstream, Object-Oriented programming languages [Biboudis et al., 2015]. 1
  • 4. Streaming APIs • Streaming APIs are widely-available in today’s mainstream, Object-Oriented programming languages [Biboudis et al., 2015]. • Incorporate MapReduce-like operations on native data structures like collections. 1
  • 5. Streaming APIs • Streaming APIs are widely-available in today’s mainstream, Object-Oriented programming languages [Biboudis et al., 2015]. • Incorporate MapReduce-like operations on native data structures like collections. • Can make writing parallel code easier, less error-prone (avoid data races, thread contention). 1
  • 7. Problem • MapReduce traditionally runs in highly-distributed environments with no shared memory. 2
  • 8. Problem • MapReduce traditionally runs in highly-distributed environments with no shared memory. • Streaming APIs typically execute on a single node under multiple threads or cores in a shared memory space. 2
  • 9. Problem • MapReduce traditionally runs in highly-distributed environments with no shared memory. • Streaming APIs typically execute on a single node under multiple threads or cores in a shared memory space. • Collections reside in local memory. 2
  • 10. Problem • MapReduce traditionally runs in highly-distributed environments with no shared memory. • Streaming APIs typically execute on a single node under multiple threads or cores in a shared memory space. • Collections reside in local memory. • Issues may arise from close ties between shared memory and the operations. 2
  • 11. Problem • MapReduce traditionally runs in highly-distributed environments with no shared memory. • Streaming APIs typically execute on a single node under multiple threads or cores in a shared memory space. • Collections reside in local memory. • Issues may arise from close ties between shared memory and the operations. • Developers must manually determine whether running stream code in parallel is efficient yet interference-free. 2
  • 12. Problem • MapReduce traditionally runs in highly-distributed environments with no shared memory. • Streaming APIs typically execute on a single node under multiple threads or cores in a shared memory space. • Collections reside in local memory. • Issues may arise from close ties between shared memory and the operations. • Developers must manually determine whether running stream code in parallel is efficient yet interference-free. • Requires thorough understanding of the API. 2
  • 13. Problem • MapReduce traditionally runs in highly-distributed environments with no shared memory. • Streaming APIs typically execute on a single node under multiple threads or cores in a shared memory space. • Collections reside in local memory. • Issues may arise from close ties between shared memory and the operations. • Developers must manually determine whether running stream code in parallel is efficient yet interference-free. • Requires thorough understanding of the API. • Error-prone, possibly requiring complex analysis. 2
  • 14. Problem • MapReduce traditionally runs in highly-distributed environments with no shared memory. • Streaming APIs typically execute on a single node under multiple threads or cores in a shared memory space. • Collections reside in local memory. • Issues may arise from close ties between shared memory and the operations. • Developers must manually determine whether running stream code in parallel is efficient yet interference-free. • Requires thorough understanding of the API. • Error-prone, possibly requiring complex analysis. • Omission-prone, optimization opportunities may be missed. 2
  • 15. Motivating Example 1 List<Widget> sortedWidgets 2 = unorderedWidgets 3 .stream() 4 .sorted(Comparator 5 .comparing( 6 Widget::getWeight)) 7 .collect( 8 Collectors.toList()); 1 List<Widget> sortedWidgets 2 = unorderedWidgets 3 .stream()parallelStream() 4 .sorted(Comparator 5 .comparing( 6 Widget::getWeight)) 7 .collect( 8 Collectors.toList()); 3
  • 16. Motivating Example 1 List<Widget> sortedWidgets 2 = unorderedWidgets 3 .stream() 4 .sorted(Comparator 5 .comparing( 6 Widget::getWeight)) 7 .collect( 8 Collectors.toList()); 1 List<Widget> sortedWidgets 2 = unorderedWidgets 3 .stream()parallelStream() 4 .sorted(Comparator 5 .comparing( 6 Widget::getWeight)) 7 .collect( 8 Collectors.toList()); • We can perform the transformation at line 3 because the operations do not access shared memory, i.e., no side-effects. 3
  • 17. Motivating Example 1 List<Widget> sortedWidgets 2 = unorderedWidgets 3 .stream() 4 .sorted(Comparator 5 .comparing( 6 Widget::getWeight)) 7 .collect( 8 Collectors.toList()); 1 List<Widget> sortedWidgets 2 = unorderedWidgets 3 .stream()parallelStream() 4 .sorted(Comparator 5 .comparing( 6 Widget::getWeight)) 7 .collect( 8 Collectors.toList()); • We can perform the transformation at line 3 because the operations do not access shared memory, i.e., no side-effects. • Had the stream been ordered, however, running in parallel may result in worse performance due to sorted() requiring multiple passes and data buffering. 3
  • 18. Motivating Example 1 List<Widget> sortedWidgets 2 = unorderedWidgets 3 .stream() 4 .sorted(Comparator 5 .comparing( 6 Widget::getWeight)) 7 .collect( 8 Collectors.toList()); 1 List<Widget> sortedWidgets 2 = unorderedWidgets 3 .stream()parallelStream() 4 .sorted(Comparator 5 .comparing( 6 Widget::getWeight)) 7 .collect( 8 Collectors.toList()); • We can perform the transformation at line 3 because the operations do not access shared memory, i.e., no side-effects. • Had the stream been ordered, however, running in parallel may result in worse performance due to sorted() requiring multiple passes and data buffering. • Such operations are called stateful intermediate operations (SIOs). 3
  • 19. Motivating Example 1 List<Widget> sortedWidgets 2 = unorderedWidgets 3 .stream() 4 .sorted(Comparator 5 .comparing( 6 Widget::getWeight)) 7 .collect( 8 Collectors.toList()); 1 List<Widget> sortedWidgets 2 = unorderedWidgets 3 .stream()parallelStream() 4 .sorted(Comparator 5 .comparing( 6 Widget::getWeight)) 7 .collect( 8 Collectors.toList()); • We can perform the transformation at line 3 because the operations do not access shared memory, i.e., no side-effects. • Had the stream been ordered, however, running in parallel may result in worse performance due to sorted() requiring multiple passes and data buffering. • Such operations are called stateful intermediate operations (SIOs). • Maintaining data ordering is detrimental to parallel performance. 3
  • 20. Motivating Example 1 // collect distinct widget 2 // weights into a TreeSet. 3 Set<Double> 4 distinctWeightSet = 5 orderedWidgets 6 .stream() 7 .parallel() 8 .map(Widget::getWeight) 9 .distinct() 10 .collect(Collectors 11 .toCollection( 12 TreeSet::new)); 1 // collect distinct widget 2 // weights into a TreeSet. 3 Set<Double> 4 distinctWeightSet = 5 orderedWidgets 6 .stream() 7 .parallel() 8 .map(Widget::getWeight) 9 .distinct() 10 .collect(Collectors 11 .toCollection( 12 TreeSet::new)); 4
  • 21. Motivating Example 1 // collect distinct widget 2 // weights into a TreeSet. 3 Set<Double> 4 distinctWeightSet = 5 orderedWidgets 6 .stream() 7 .parallel() 8 .map(Widget::getWeight) 9 .distinct() 10 .collect(Collectors 11 .toCollection( 12 TreeSet::new)); 1 // collect distinct widget 2 // weights into a TreeSet. 3 Set<Double> 4 distinctWeightSet = 5 orderedWidgets 6 .stream() 7 .parallel() 8 .map(Widget::getWeight) 9 .distinct() 10 .collect(Collectors 11 .toCollection( 12 TreeSet::new)); • Computation is already in parallel (line 7). 4
  • 22. Motivating Example 1 // collect distinct widget 2 // weights into a TreeSet. 3 Set<Double> 4 distinctWeightSet = 5 orderedWidgets 6 .stream() 7 .parallel() 8 .map(Widget::getWeight) 9 .distinct() 10 .collect(Collectors 11 .toCollection( 12 TreeSet::new)); 1 // collect distinct widget 2 // weights into a TreeSet. 3 Set<Double> 4 distinctWeightSet = 5 orderedWidgets 6 .stream() 7 .parallel() 8 .map(Widget::getWeight) 9 .distinct() 10 .collect(Collectors 11 .toCollection( 12 TreeSet::new)); • Computation is already in parallel (line 7). • distinct() is an SIO and the stream is ordered. 4
  • 23. Motivating Example 1 // collect distinct widget 2 // weights into a TreeSet. 3 Set<Double> 4 distinctWeightSet = 5 orderedWidgets 6 .stream() 7 .parallel() 8 .map(Widget::getWeight) 9 .distinct() 10 .collect(Collectors 11 .toCollection( 12 TreeSet::new)); 1 // collect distinct widget 2 // weights into a TreeSet. 3 Set<Double> 4 distinctWeightSet = 5 orderedWidgets 6 .stream() 7 .parallel() 8 .map(Widget::getWeight) 9 .distinct() 10 .collect(Collectors 11 .toCollection( 12 TreeSet::new)); • Computation is already in parallel (line 7). • distinct() is an SIO and the stream is ordered. • Can we keep it in parallel? No, because TreeSets are ordered. 4
  • 24. Motivating Example 1 // collect distinct widget 2 // weights into a TreeSet. 3 Set<Double> 4 distinctWeightSet = 5 orderedWidgets 6 .stream() 7 .parallel() 8 .map(Widget::getWeight) 9 .distinct() 10 .collect(Collectors 11 .toCollection( 12 TreeSet::new)); 1 // collect distinct widget 2 // weights into a TreeSet. 3 Set<Double> 4 distinctWeightSet = 5 orderedWidgets 6 .stream() 7 .parallel() 8 .map(Widget::getWeight) 9 .distinct() 10 .collect(Collectors 11 .toCollection( 12 TreeSet::new)); • Computation is already in parallel (line 7). • distinct() is an SIO and the stream is ordered. • Can we keep it in parallel? No, because TreeSets are ordered. • De-parallelize on line 7. 4
  • 26. Solution • Devised a fully-automated, semantics-preserving refactoring approach. 5
  • 27. Solution • Devised a fully-automated, semantics-preserving refactoring approach. • Embodied by an open source refactoring tool named Optimize Streams. 5
  • 28. Solution • Devised a fully-automated, semantics-preserving refactoring approach. • Embodied by an open source refactoring tool named Optimize Streams. • Transforms Java 8 stream code for improved performance. 5
  • 29. Solution • Devised a fully-automated, semantics-preserving refactoring approach. • Embodied by an open source refactoring tool named Optimize Streams. • Transforms Java 8 stream code for improved performance. • Based on: 5
  • 30. Solution • Devised a fully-automated, semantics-preserving refactoring approach. • Embodied by an open source refactoring tool named Optimize Streams. • Transforms Java 8 stream code for improved performance. • Based on: • Novel ordering analysis. 5
  • 31. Solution • Devised a fully-automated, semantics-preserving refactoring approach. • Embodied by an open source refactoring tool named Optimize Streams. • Transforms Java 8 stream code for improved performance. • Based on: • Novel ordering analysis. • Infers when maintaining ordering is necessary for semantics preservation. 5
  • 32. Solution • Devised a fully-automated, semantics-preserving refactoring approach. • Embodied by an open source refactoring tool named Optimize Streams. • Transforms Java 8 stream code for improved performance. • Based on: • Novel ordering analysis. • Infers when maintaining ordering is necessary for semantics preservation. • Typestate analysis [Fink et al., 2008; Strom and Yemini, 1986]. 5
  • 33. Solution • Devised a fully-automated, semantics-preserving refactoring approach. • Embodied by an open source refactoring tool named Optimize Streams. • Transforms Java 8 stream code for improved performance. • Based on: • Novel ordering analysis. • Infers when maintaining ordering is necessary for semantics preservation. • Typestate analysis [Fink et al., 2008; Strom and Yemini, 1986]. • Augments the type system with “state.” 5
  • 34. Solution • Devised a fully-automated, semantics-preserving refactoring approach. • Embodied by an open source refactoring tool named Optimize Streams. • Transforms Java 8 stream code for improved performance. • Based on: • Novel ordering analysis. • Infers when maintaining ordering is necessary for semantics preservation. • Typestate analysis [Fink et al., 2008; Strom and Yemini, 1986]. • Augments the type system with “state.” • Traditionally used for preventing resource usage errors. 5
  • 35. Solution • Devised a fully-automated, semantics-preserving refactoring approach. • Embodied by an open source refactoring tool named Optimize Streams. • Transforms Java 8 stream code for improved performance. • Based on: • Novel ordering analysis. • Infers when maintaining ordering is necessary for semantics preservation. • Typestate analysis [Fink et al., 2008; Strom and Yemini, 1986]. • Augments the type system with “state.” • Traditionally used for preventing resource usage errors. • Requires interprocedural and alias analyses. 5
  • 36. Solution • Devised a fully-automated, semantics-preserving refactoring approach. • Embodied by an open source refactoring tool named Optimize Streams. • Transforms Java 8 stream code for improved performance. • Based on: • Novel ordering analysis. • Infers when maintaining ordering is necessary for semantics preservation. • Typestate analysis [Fink et al., 2008; Strom and Yemini, 1986]. • Augments the type system with “state.” • Traditionally used for preventing resource usage errors. • Requires interprocedural and alias analyses. • Novel adaptation for possibly immutable objects (streams). 5
  • 37. Solution Highlights • First to integrate automated refactoring with typestate analysis.1 1To the best of our knowledge. 2http://wala.sf.net 3http://git.io/vxwBs 6
  • 38. Solution Highlights • First to integrate automated refactoring with typestate analysis.1 • Uses WALA static analysis framework2 and the SAFE typestate analysis engine.3 1To the best of our knowledge. 2http://wala.sf.net 3http://git.io/vxwBs 6
  • 39. Solution Highlights • First to integrate automated refactoring with typestate analysis.1 • Uses WALA static analysis framework2 and the SAFE typestate analysis engine.3 • Combines analysis results from varying IR representations (SSA, AST). 1To the best of our knowledge. 2http://wala.sf.net 3http://git.io/vxwBs 6
  • 40. Identifying Refactoring Preconditions • Refactoring preconditions are conditions that must hold to guarantee that the transformation is type-correct and semantics-preserving. 7
  • 41. Identifying Refactoring Preconditions • Refactoring preconditions are conditions that must hold to guarantee that the transformation is type-correct and semantics-preserving. • Our refactoring is (conceptually) split into two: 7
  • 42. Identifying Refactoring Preconditions • Refactoring preconditions are conditions that must hold to guarantee that the transformation is type-correct and semantics-preserving. • Our refactoring is (conceptually) split into two: • Convert Sequential Stream to Parallel. 7
  • 43. Identifying Refactoring Preconditions • Refactoring preconditions are conditions that must hold to guarantee that the transformation is type-correct and semantics-preserving. • Our refactoring is (conceptually) split into two: • Convert Sequential Stream to Parallel. • Optimize Parallel Stream. 7
  • 44. Identifying Refactoring Preconditions Table 1: Convert Sequential Stream to Parallel preconditions. exe ord se SIO ROM transformation P1 seq unord F N/A N/A Convert to para. P2 seq ord F F N/A Convert to para. P3 seq ord F T F Unorder and convert to para. 8
  • 45. Identifying Refactoring Preconditions Table 2: Optimize Parallel Stream preconditions. exe ord SIO ROM transformation P4 para ord T F Unorder. P5 para ord T T Convert to seq. 9
  • 46. DFA for Determining Stream Execution Mode ⊥ start seq para Col.stream(), BufferedReader.lines(), Files.lines(Path), JarFile.stream(), Pattern.splitAsStream(), Random.ints() Col.parallelStream() BaseStream.sequential() BaseStream.parallel() BaseStream.sequential() BaseStream.parallel() Figure 1: A subset of the relation E→ in E = (ES , EΛ, E→). 10
  • 47. DFA for Determining Stream Ordering ⊥ start ord unord Arrays.stream(T[]), Stream.of(T...), IntStream.range(), Stream.iterate(), BitSet.stream(), Col.parallelStream() Stream.generate(), HashSet.stream(), PriorityQueue.stream(), CopyOnWrite.parallelStream(), BeanContextSupport.stream(), Random.ints() Stream.sorted() BaseStream.unordered(), Stream.concat(unordered), Stream.concat(ordered) Stream.sorted(), Stream.concat(ordered) BaseStream.unordered(), Stream.concat(unordered) Figure 2: A subset of the relation O→ in O = (OS , OΛ, O→). 11
  • 49. Optimize Streams Eclipse Refactoring Plug-in • Implemented an open source refactoring tool named Optimize Streams. 4http://eclipse.org. 5Available at http://git.io/vpTLk. 12
  • 50. Optimize Streams Eclipse Refactoring Plug-in • Implemented an open source refactoring tool named Optimize Streams. • Publicly available as an open source Eclipse IDE4 plug-in.5 4http://eclipse.org. 5Available at http://git.io/vpTLk. 12
  • 51. Optimize Streams Eclipse Refactoring Plug-in • Implemented an open source refactoring tool named Optimize Streams. • Publicly available as an open source Eclipse IDE4 plug-in.5 • Can we be used by projects not using Eclipse. 4http://eclipse.org. 5Available at http://git.io/vpTLk. 12
  • 52. Optimize Streams Eclipse Refactoring Plug-in • Implemented an open source refactoring tool named Optimize Streams. • Publicly available as an open source Eclipse IDE4 plug-in.5 • Can we be used by projects not using Eclipse. • Includes fully-functional UI, preview pane, and refactoring unit tests. 4http://eclipse.org. 5Available at http://git.io/vpTLk. 12
  • 53. Results • Applied to 11 Java projects of varying size and domain with a total of ∼642 KSLOC. 13
  • 54. Results • Applied to 11 Java projects of varying size and domain with a total of ∼642 KSLOC. • 36.31% candidate streams were refactorable. 13
  • 55. Results • Applied to 11 Java projects of varying size and domain with a total of ∼642 KSLOC. • 36.31% candidate streams were refactorable. • Observed an average speedup of 3.49 during performance testing. 13
  • 56. Results • Applied to 11 Java projects of varying size and domain with a total of ∼642 KSLOC. • 36.31% candidate streams were refactorable. • Observed an average speedup of 3.49 during performance testing. • See paper and [Khatchadourian et al., 2018] for more details, including user feedback, as well as tool and data set engineering challenges. 13
  • 57. Results Table 3: Experimental results. subject KLOC eps k str rft P1 P2 P3 t (m) htm.java 41.14 21 4 34 10 0 10 0 1.85 JacpFX 23.79 195 4 4 3 3 0 0 2.31 jdp* 19.96 25 4 28 15 1 13 1 31.88 jdk8-exp* 3.43 134 4 26 4 0 4 0 0.78 jetty 354.48 106 4 21 7 3 4 0 17.85 jOOQ 154.01 43 4 5 1 0 1 0 12.94 koral 7.13 51 3 6 6 0 6 0 1.06 monads 1.01 47 2 1 1 0 1 0 0.05 retroλ 5.14 1 4 8 6 3 3 0 0.66 streamql 4.01 92 2 22 2 0 2 0 0.72 threeten 27.53 36 2 2 2 0 2 0 0.51 Total 641.65 751 4 157 57 10 46 1 70.60 * jdp is java-design-patterns and jdk8-exp is jdk8-experiments. 14
  • 58. Performance Evaluation Table 4: Average run times of JMH benchmarks. # benchmark orig (s/op) refact (s/op) su 1 shouldRetrieveChildren 0.011 (0.001) 0.002 (0.000) 6.57 2 shouldConstructCar 0.011 (0.001) 0.001 (0.000) 8.22 3 addingShouldResultInFailure 0.014 (0.000) 0.004 (0.000) 3.78 4 deletionShouldBeSuccess 0.013 (0.000) 0.003 (0.000) 3.82 5 addingShouldResultInSuccess 0.027 (0.000) 0.005 (0.000) 5.08 6 deletionShouldBeFailure 0.014 (0.000) 0.004 (0.000) 3.90 7 specification.AppTest.test 12.666 (5.961) 12.258 (1.880) 1.03 8 CoffeeMakingTaskTest.testId 0.681 (0.065) 0.469 (0.009) 1.45 9 PotatoPeelingTaskTest.testId 0.676 (0.062) 0.465 (0.008) 1.45 10 SpatialPoolerLocalInhibition 1.580 (0.168) 1.396 (0.029) 1.13 11 TemporalMemory 0.013 (0.001) 0.006 (0.000) 1.97 15
  • 60. Conclusion • Optimize Streams is an open source, automated refactoring tool that assists developers with writing optimal Java 8 Stream code. 16
  • 61. Conclusion • Optimize Streams is an open source, automated refactoring tool that assists developers with writing optimal Java 8 Stream code. • Integrates an Eclipse refactoring with the advanced static analyses offered by WALA and SAFE. 16
  • 62. Conclusion • Optimize Streams is an open source, automated refactoring tool that assists developers with writing optimal Java 8 Stream code. • Integrates an Eclipse refactoring with the advanced static analyses offered by WALA and SAFE. • 11 Java projects totaling ∼642 thousands of lines of code were used in the tool’s assessment. 16
  • 63. Conclusion • Optimize Streams is an open source, automated refactoring tool that assists developers with writing optimal Java 8 Stream code. • Integrates an Eclipse refactoring with the advanced static analyses offered by WALA and SAFE. • 11 Java projects totaling ∼642 thousands of lines of code were used in the tool’s assessment. • An average speedup of 3.49 on the refactored code was observed as part of a experimental study. 16
  • 64. For Further Reading Biboudis, Aggelos, Nick Palladinos, George Fourtounis, and Yannis Smaragdakis (2015). “Streams `a la carte: Extensible Pipelines with Object Algebras”. In: ECOOP, pp. 591–613. doi: 10.4230/LIPIcs.ECOOP.2015.591. Fink, Stephen J., Eran Yahav, Nurit Dor, G. Ramalingam, and Emmanuel Geay (May 2008). “Effective Typestate Verification in the Presence of Aliasing”. In: ACM TOSEM 17.2, pp. 91–934. doi: 10.1145/1348250.1348255. Khatchadourian, Raffi, Yiming Tang, Mehdi Bagherzadeh, and Syed Ahmed (Sept. 2018). “A Tool for Optimizing Java 8 Stream Software via Automated Refactoring”. In: International Working Conference on Source Code Analysis and Manipulation. SCAM ’18. Engineering Track. Distinguished Paper Award. IEEE. IEEE Press, pp. 34–39. doi: 10.1109/SCAM.2018.00011. Strom, Robert E and Shaula Yemini (Jan. 1986). “Typestate: A programming language concept for enhancing software reliability”. In: IEEE TSE SE-12.1, pp. 157–171. doi: 10.1109/tse.1986.6312929. 17