Skip to content

Commit

Permalink
opt: shrink encoder stack size
Browse files Browse the repository at this point in the history
  • Loading branch information
AsterDY committed Oct 18, 2022
1 parent 1ea952b commit f71042e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions encoder/encoder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ type f64Bench struct {
name string
float float64
}
func BenchmarkEncoder_Float64(b *testing.B) {
func BenchmarkEncode_Float64(b *testing.B) {
var bench = []f64Bench{
{"Zero", 0},
{"ShortDecimal", 1000},
Expand Down Expand Up @@ -564,7 +564,7 @@ type f32Bench struct {
name string
float float32
}
func BenchmarkEncoder_Float32(b *testing.B) {
func BenchmarkEncode_Float32(b *testing.B) {
var bench = []f32Bench{
{"Zero", 0},
{"ShortDecimal", 1000},
Expand Down
2 changes: 1 addition & 1 deletion encoder/pools.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
)

const (
_MaxStack = 65536 // 64k states
_MaxStack = 4096 // 4k states
_MaxBuffer = 1048576 // 1MB buffer size

_StackSize = unsafe.Sizeof(_Stack{})
Expand Down
2 changes: 1 addition & 1 deletion issue_test/pretouch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ func TestPretouchSynteaRoot(t *testing.T) {
println("end decode:", e.UnixNano())
d2 := e.Sub(s).Nanoseconds()
println("elapsed:", d2, "ns")
if d1 > d2 * 10 {
if d1 > d2 * 20 {
t.Fatal("decoder pretouch not finish yet")
}

Expand Down

0 comments on commit f71042e

Please sign in to comment.