ponder-lab / Optimize-Java-8-Streams-Refactoring

Refactorings for optimizing Java 8 stream client code for greater parallelism and efficiency.
http://cuny.is/streams
Eclipse Public License 1.0
8 stars 7 forks source link

Performance improvement (slicing) for #103 #130

Closed yiming-tang-cs closed 6 years ago

yiming-tang-cs commented 6 years ago

103 False positive regarding missing terminal operation when a stream is returned from a method

khatchad commented 6 years ago

Thanks, I'll have a look.

khatchad commented 6 years ago

@saledouble Can you please add a link to the issue in the description?

khatchad commented 6 years ago

We need to verify that we are processing all of and only the client nodes, so you tell me :).

yiming-tang-cs commented 6 years ago

Output example:

INFO: Processing Node: < Application, Lp/A, <init>()V > Context: CallStringContext: [ com.ibm.wala.FakeRootClass.fakeRootMethod()V@2 ]
Dec 19, 2017 9:25:13 PM edu.cuny.hunter.streamrefactoring.core.analysis.StreamStateMachine start
INFO: Processing Node: < Application, Lp/A, n()V > Context: CallStringContext: [ com.ibm.wala.FakeRootClass.fakeRootMethod()V@3 ]
Dec 19, 2017 9:25:14 PM edu.cuny.hunter.streamrefactoring.core.analysis.StreamStateMachine start
INFO: Adding state: [name: bottom, accepting: false] for instance: SITE_IN_NODE{< Primordial, Ljava/util/stream/StreamSupport, stream(Ljava/util/Spliterator;Z)Ljava/util/stream/Stream; >:NEW <Primordial,Ljava/util/stream/ReferencePipeline$Head>@5 in CallStringContext: [ java.util.Collection.stream()Ljava/util/stream/Stream;@7 p.A.m()Ljava/util/stream/Stream;@7 ]} for block: BB[SSA:5..5]3 - p.A.n()V for rule: ordering
Dec 19, 2017 9:25:14 PM edu.cuny.hunter.streamrefactoring.core.analysis.StreamStateMachine start
INFO: Processing Node: < Application, Lp/A, m()Ljava/util/stream/Stream; > Context: CallStringContext: [ p.A.n()V@1 com.ibm.wala.FakeRootClass.fakeRootMethod()V@3 ]
Dec 19, 2017 9:25:14 PM edu.cuny.hunter.streamrefactoring.core.analysis.StreamStateMachine start
INFO: Processing Node: < Application, Lp/A, <init>()V > Context: CallStringContext: [ com.ibm.wala.FakeRootClass.fakeRootMethod()V@2 ]
Dec 19, 2017 9:25:14 PM edu.cuny.hunter.streamrefactoring.core.analysis.StreamStateMachine start
INFO: Processing Node: < Application, Lp/A, n()V > Context: CallStringContext: [ com.ibm.wala.FakeRootClass.fakeRootMethod()V@3 ]
Dec 19, 2017 9:25:14 PM edu.cuny.hunter.streamrefactoring.core.analysis.StreamStateMachine start
INFO: Processing Node: < Application, Lp/A, m()Ljava/util/stream/Stream; > Context: CallStringContext: [ p.A.n()V@1 com.ibm.wala.FakeRootClass.fakeRootMethod()V@3 ]
Dec 19, 2017 9:25:14 PM edu.cuny.hunter.streamrefactoring.core.analysis.StreamStateMachine start
INFO: Processing Node: < Application, Lp/A, <init>()V > Context: CallStringContext: [ com.ibm.wala.FakeRootClass.fakeRootMethod()V@2 ]
Dec 19, 2017 9:25:14 PM edu.cuny.hunter.streamrefactoring.core.analysis.StreamStateMachine start
INFO: Processing Node: < Application, Lp/A, n()V > Context: CallStringContext: [ com.ibm.wala.FakeRootClass.fakeRootMethod()V@3 ]
Dec 19, 2017 9:25:14 PM edu.cuny.hunter.streamrefactoring.core.analysis.StreamStateMachine start
INFO: Adding state: [name: bottom, accepting: false] for instance: SITE_IN_NODE{< Primordial, Ljava/util/stream/DistinctOps, makeRef(Ljava/util/stream/AbstractPipeline;)Ljava/util/stream/ReferencePipeline; >:NEW <Primordial,Ljava/util/stream/DistinctOps$1>@0 in CallStringContext: [ java.util.stream.ReferencePipeline.distinct()Ljava/util/stream/Stream;@1 p.A.n()V@6 ]} for block: BB[SSA:5..5]3 - p.A.n()V for rule: ordering
Dec 19, 2017 9:25:14 PM edu.cuny.hunter.streamrefactoring.core.analysis.StreamStateMachine start
INFO: Processing Node: < Application, Lp/A, m()Ljava/util/stream/Stream; > Context: CallStringContext: [ p.A.n()V@1 com.ibm.wala.FakeRootClass.fakeRootMethod()V@3 ]
Dec 19, 2017 9:25:14 PM edu.cuny.hunter.streamrefactoring.core.analysis.StreamStateMachine start
INFO: Processing Node: < Application, Lp/A, <init>()V > Context: CallStringContext: [ com.ibm.wala.FakeRootClass.fakeRootMethod()V@2 ]
Dec 19, 2017 9:25:14 PM edu.cuny.hunter.streamrefactoring.core.analysis.StreamStateMachine start
INFO: Processing Node: < Application, Lp/A, n()V > Context: CallStringContext: [ com.ibm.wala.FakeRootClass.fakeRootMethod()V@3 ]
Dec 19, 2017 9:25:14 PM edu.cuny.hunter.streamrefactoring.core.analysis.StreamStateMachine start
INFO: Processing Node: < Application, Lp/A, m()Ljava/util/stream/Stream; > Context: CallStringContext: [ p.A.n()V@1 com.ibm.wala.FakeRootClass.fakeRootMethod()V@3 ]
Dec 19, 2017 9:25:15 PM edu.cuny.hunter.streamrefactoring.core.analysis.StreamStateMachine discoverPossibleSideEffects
WARNING: Can't find IR for target: < Primordial, Ljava/util/stream/Stream, count()J >
Dec 19, 2017 9:25:15 PM edu.cuny.hunter.streamrefactoring.core.analysis.StreamStateMachine discoverPossibleSideEffects
WARNING: Can't find IR for target: < Primordial, Ljava/util/stream/Stream, distinct()Ljava/util/stream/Stream; >
Dec 19, 2017 9:25:15 PM edu.cuny.hunter.streamrefactoring.core.analysis.StreamStateMachine discoverIfReduceOrderingPossiblyMatters
INFO: Reduce ordering doesn't matter for: 8 = invokeinterface < Application, Ljava/util/stream/Stream, count()J > 6 @11 exception:7
Dec 19, 2017 9:25:15 PM edu.cuny.hunter.streamrefactoring.core.analysis.Util lambda$7
WARNING: Instruction: 3 = new <Application,Ljava/util/HashSet>@0 has no definitions.
Dec 19, 2017 9:25:15 PM edu.cuny.hunter.streamrefactoring.core.analysis.Util lambda$7
WARNING: Instruction: invokespecial < Application, Ljava/util/HashSet, <init>()V > 3 @4 exception:4 has no definitions.
Dec 19, 2017 9:25:15 PM edu.cuny.hunter.streamrefactoring.core.analysis.Util lambda$7
WARNING: Instruction: 3 = new <Application,Ljava/util/HashSet>@0 has no definitions.
Dec 19, 2017 9:25:15 PM edu.cuny.hunter.streamrefactoring.core.analysis.Util lambda$7
WARNING: Instruction: invokespecial < Application, Ljava/util/HashSet, <init>()V > 3 @4 exception:4 has no definitions.
Dec 19, 2017 9:25:15 PM edu.cuny.hunter.streamrefactoring.core.analysis.Stream check
INFO: Execution modes: [SEQUENTIAL, PARALLEL]
Dec 19, 2017 9:25:15 PM edu.cuny.hunter.streamrefactoring.core.analysis.Stream check
INFO: Orderings: [UNORDERED]
Dec 19, 2017 9:25:15 PM edu.cuny.hunter.streamrefactoring.core.analysis.Stream check
INFO: Side-effects: false
Dec 19, 2017 9:25:15 PM edu.cuny.hunter.streamrefactoring.core.analysis.Stream check
INFO: Stateful intermediate operations: true
Dec 19, 2017 9:25:15 PM edu.cuny.hunter.streamrefactoring.core.analysis.Stream check
INFO: Reduce ordering matters: false