aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeffrey Wilcke <jeffrey@ethereum.org>2017-05-25 17:34:07 +0800
committerJeffrey Wilcke <jeffrey@ethereum.org>2017-05-25 17:37:04 +0800
commit846d091bd25a9b3d0f6ed9c190d42027c682a045 (patch)
tree47ae5655e0aae6f95e7b87ee4f143607adfb9508
parentef25b826e655f8e6a57fc7a05454bf356382bd5f (diff)
downloadgo-tangerine-846d091bd25a9b3d0f6ed9c190d42027c682a045.tar.gz
go-tangerine-846d091bd25a9b3d0f6ed9c190d42027c682a045.tar.zst
go-tangerine-846d091bd25a9b3d0f6ed9c190d42027c682a045.zip
core/vm: allocate stack to 1024
Pre allocate the stack to 1024 optimising stack pushing, reducing calls to runtime.makeslice and runtime.mallocgc
-rw-r--r--core/vm/stack.go2
1 files changed, 1 insertions, 1 deletions
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 {