Skip to content

Commit

Permalink
fix: add mssing max pc-sp of natives (#636)
Browse files Browse the repository at this point in the history
  • Loading branch information
AsterDY authored May 29, 2024
1 parent d79801f commit 381aa24
Show file tree
Hide file tree
Showing 47 changed files with 134 additions and 41 deletions.
2 changes: 1 addition & 1 deletion internal/native/avx/f32toa_subr.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion internal/native/avx/f64toa_subr.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion internal/native/avx/html_escape_subr.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion internal/native/avx/i64toa_subr.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion internal/native/avx/lspace_subr.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion internal/native/avx/quote_subr.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions internal/native/avx/recover_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion internal/native/avx/u64toa_subr.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion internal/native/avx/unquote_subr.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion internal/native/avx/validate_utf8_fast_subr.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion internal/native/avx/validate_utf8_subr.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion internal/native/avx/vnumber_subr.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion internal/native/avx/vsigned_subr.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion internal/native/avx/vstring_subr.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion internal/native/avx/vunsigned_subr.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion internal/native/avx2/f32toa_subr.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion internal/native/avx2/f64toa_subr.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion internal/native/avx2/html_escape_subr.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion internal/native/avx2/i64toa_subr.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion internal/native/avx2/lspace_subr.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion internal/native/avx2/quote_subr.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions internal/native/avx2/recover_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion internal/native/avx2/u64toa_subr.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion internal/native/avx2/validate_utf8_subr.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion internal/native/avx2/vnumber_subr.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion internal/native/avx2/vsigned_subr.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion internal/native/avx2/vstring_subr.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion internal/native/avx2/vunsigned_subr.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions internal/native/recover_test.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,18 @@
package {{PACKAGE}}

import (
`bytes`
`os`
`runtime`
`runtime/debug`
`runtime/pprof`
`strings`
`testing`
`time`
`unsafe`

`github.com/bytedance/sonic/internal/native/types`
`github.com/bytedance/sonic/internal/rt`
)

var (
Expand Down Expand Up @@ -109,6 +113,23 @@ func TestRecover_lspace(t *testing.T) {
_ = lspace(nil, 2, 0)
}

func TestRecover_lspace2(t *testing.T) {
// generate random space with json
cases := []string{
strings.Repeat(" ", 1) + "123",
strings.Repeat(" ", 1) + "123",
"123",
}
pprof.StartCPUProfile(bytes.NewBuffer(nil))
defer pprof.StopCPUProfile()
for i := 0; i < 10000000; i++{
for _, t := range cases {
sp := (*byte)((*rt.GoString)(unsafe.Pointer(&t)).Ptr)
_ = lspace(sp, len(t), 0)
}
}
}

func TestRecover_quote(t *testing.T) {
var dn = 10
var dp = make([]byte, dn)
Expand Down
2 changes: 1 addition & 1 deletion internal/native/sse/f32toa_subr.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion internal/native/sse/f64toa_subr.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion internal/native/sse/html_escape_subr.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion internal/native/sse/i64toa_subr.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 381aa24

Please sign in to comment.