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)