From 846d091bd25a9b3d0f6ed9c190d42027c682a045 Mon Sep 17 00:00:00 2001 From: Jeffrey Wilcke Date: Thu, 25 May 2017 11:34:07 +0200 Subject: 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(-) (limited to 'core') diff --git a/core/vm/stack.go b/core/vm/stack.go index f4777c5b3..9c10d50ad 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 { -- cgit v1.2.3