Fix scan doing **<type>
Given that the reflect.New already returns a pointer to the type, this additional Pointer caused the Scan to receive **<types> The issue with this is that golang's database package contains optimizations for single pointer types, and thus doesn't use reflection. This patch (in my benchmarks) decreases CPU usage by 10% and memory usage by 10%.
This commit is contained in:
parent
418ee3fc19
commit
6f1960017c
@ -985,6 +985,6 @@ func (field *Field) setupNewValuePool() {
|
||||
}
|
||||
|
||||
if field.NewValuePool == nil {
|
||||
field.NewValuePool = poolInitializer(reflect.PtrTo(field.IndirectFieldType))
|
||||
field.NewValuePool = poolInitializer(field.IndirectFieldType)
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user