Skip to content

Commit

Permalink
Merge pull request akka#20742 from drewhk/wip-reduce-internal-resume-…
Browse files Browse the repository at this point in the history
…allocations

Reduce internal allocation in ActorGraphInterpreter
  • Loading branch information
drewhk committed Jun 7, 2016
2 parents bf76d6c + 6932012 commit 47c1b5b
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -553,11 +553,11 @@ private[stream] class ActorGraphInterpreter(_initial: GraphInterpreterShell) ext
private val eventLimit: Int = _initial.mat.settings.syncProcessingLimit
private var currentLimit: Int = eventLimit
//this is a var in order to save the allocation when no short-circuiting actually happens
private var shortCircuitBuffer: util.LinkedList[Any] = null
private var shortCircuitBuffer: util.ArrayDeque[Any] = null

def enqueueToShortCircuit(input: Any): Unit = {
if (shortCircuitBuffer == null) shortCircuitBuffer = new util.LinkedList[Any]()
shortCircuitBuffer.add(input)
if (shortCircuitBuffer == null) shortCircuitBuffer = new util.ArrayDeque[Any]()
shortCircuitBuffer.addLast(input)
}

def registerShell(shell: GraphInterpreterShell): ActorRef = {
Expand Down

0 comments on commit 47c1b5b

Please sign in to comment.