Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add mssing max pc-sp of natives #636

Merged
merged 7 commits into from
May 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading