Skip to content

Commit 846d091

Browse files
committed
core/vm: allocate stack to 1024
Pre allocate the stack to 1024 optimising stack pushing, reducing calls to runtime.makeslice and runtime.mallocgc
1 parent ef25b82 commit 846d091

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/vm/stack.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ type Stack struct {
2929
}
3030

3131
func newstack() *Stack {
32-
return &Stack{}
32+
return &Stack{data: make([]*big.Int, 0, 1024)}
3333
}
3434

3535
func (st *Stack) Data() []*big.Int {

0 commit comments

Comments
 (0)