Skip to content

Commit

Permalink
Speed up task scheduling in standalone mode by reusing serializer
Browse files Browse the repository at this point in the history
instead of creating a new one for each task.
  • Loading branch information
coolfrood committed May 21, 2015
1 parent a25c1ab commit fe530cd
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,8 @@ class CoarseGrainedSchedulerBackend(scheduler: TaskSchedulerImpl, val rpcEnv: Rp

// Launch tasks returned by a set of resource offers
def launchTasks(tasks: Seq[Seq[TaskDescription]]) {
val ser = SparkEnv.get.closureSerializer.newInstance()
for (task <- tasks.flatten) {
val ser = SparkEnv.get.closureSerializer.newInstance()
val serializedTask = ser.serialize(task)
if (serializedTask.limit >= akkaFrameSize - AkkaUtils.reservedSizeBytes) {
val taskSetId = scheduler.taskIdToTaskSetId(task.taskId)
Expand Down

0 comments on commit fe530cd

Please sign in to comment.