From 846d091bd25a9b3d0f6ed9c190d42027c682a045 Mon Sep 17 00:00:00 2001 From: Jeffrey Wilcke Date: Thu, 25 May 2017 11:34:07 +0200 Subject: [PATCH] core/vm: allocate stack to 1024 Pre allocate the stack to 1024 optimising stack pushing, reducing calls to runtime.makeslice and runtime.mallocgc --- core/vm/stack.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/vm/stack.go b/core/vm/stack.go index f4777c5b3f..9c10d50ad1 100644 --- a/core/vm/stack.go +++ b/core/vm/stack.go @@ -29,7 +29,7 @@ type Stack struct { } func newstack() *Stack { - return &Stack{} + return &Stack{data: make([]*big.Int, 0, 1024)} } func (st *Stack) Data() []*big.Int {