Skip to content
Permalink
Browse files

Make send splat be more efficient with large array splats

  • Loading branch information
Alex Gaynor
Alex Gaynor committed Apr 5, 2013
1 parent 938ace7 commit c1c436c70833f16196a8398186b8dbea4c65f170
Showing with 8 additions and 2 deletions.
  1. +8 −2 topaz/interpreter.py
@@ -538,9 +538,15 @@ def SEND_BLOCK(self, space, bytecode, frame, pc, meth_idx, num_args):
def SEND_SPLAT(self, space, bytecode, frame, pc, meth_idx, num_args):
space.getexecutioncontext().last_instr = pc
arrays_w = frame.popitemsreverse(num_args)
args_w = []
length = 0
for w_array in arrays_w:
args_w.extend(space.listview(w_array))
length += len(space.listview(w_array))
args_w = [None] * length
pos = 0
for w_array in arrays_w:
array_w = space.listview(w_array)
args_w[pos:pos + len(array_w)] = array_w
pos += len(array_w)
w_receiver = frame.pop()
w_res = space.send(w_receiver, bytecode.consts_w[meth_idx], args_w)
frame.push(w_res)

0 comments on commit c1c436c

Please sign in to comment.
You can’t perform that action at this time.