-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Performance optimization for aggregates: do not save context of varia… (
#1886) Performance optimization for aggregates: - do not save context of variables in state - passing key instead of full context before aggregate - using AGG global variable in aggregates instead of name of class
- Loading branch information
Showing
23 changed files
with
289 additions
and
234 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
engine/api/src/main/scala/pl/touk/nussknacker/engine/api/Context.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
.../benchmarks/src/test/scala/pl/touk/nussknacker/engine/benchmarks/spel/UUIDBenchmark.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package pl.touk.nussknacker.engine.benchmarks.spel | ||
|
||
import org.openjdk.jmh.annotations.{Benchmark, BenchmarkMode, Mode, OutputTimeUnit, Scope, State, Threads} | ||
import pl.touk.nussknacker.engine.api.Context | ||
|
||
import java.util.UUID | ||
import java.util.concurrent.TimeUnit | ||
|
||
/** | ||
* results: | ||
* - UUIDBenchmark.secureUUIDTest avgt 25 9.873 ± 0.467 us/op | ||
* - UUIDBenchmark.unsecureUUIDTest avgt 25 6.227 ± 0.130 us/op | ||
*/ | ||
@State(Scope.Benchmark) | ||
class UUIDBenchmark { | ||
|
||
@Threads(10) | ||
@Benchmark | ||
@BenchmarkMode(Array(Mode.AverageTime)) | ||
@OutputTimeUnit(TimeUnit.MICROSECONDS) | ||
def unsecureUUIDTest(): AnyRef = { | ||
Context.withInitialId | ||
} | ||
|
||
@Threads(10) | ||
@Benchmark | ||
@BenchmarkMode(Array(Mode.AverageTime)) | ||
@OutputTimeUnit(TimeUnit.MICROSECONDS) | ||
def secureUUIDTest(): AnyRef = { | ||
Context(UUID.randomUUID().toString) | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 0 additions & 37 deletions
37
.../nussknacker/engine/flink/util/transformer/aggregate/AddedElementContextStateHolder.scala
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.