From ce291a7c6ba67d708dea40095678b5d2e470fc6e Mon Sep 17 00:00:00 2001 From: liuq19 Date: Fri, 28 Jun 2024 16:17:45 +0800 Subject: [PATCH] fix: make lookup opt as a option --- internal/optcaching/fcache.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/optcaching/fcache.go b/internal/optcaching/fcache.go index 3fe37351a..7a4883b29 100644 --- a/internal/optcaching/fcache.go +++ b/internal/optcaching/fcache.go @@ -21,6 +21,7 @@ import ( "unicode" "unsafe" + "github.com/bytedance/sonic/internal/envs" "github.com/bytedance/sonic/internal/native" "github.com/bytedance/sonic/internal/resolver" "github.com/bytedance/sonic/internal/rt" @@ -58,7 +59,7 @@ func NewFieldLookup(fields []resolver.FieldMeta) FieldLookup { if n <= 8 { f = NewSmallFieldMap(n) - } else if n <= 128 && isAsc { + } else if envs.UseFastMap && n <= 128 && isAsc { f = NewNormalFieldMap(n) } else { f = NewFallbackFieldMap(n)