You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found a todo item('speed up the way to manipulate null-bitmaps') in expression/column.go, so I was thinking maybe using Column.MergeNulls() would be better than setting null on every single bit in the bitmap.
In original code, we have to set null for every null element in nullbitmap, using SetNull() method.
n := input.NumRows()
src := input.Column(col.Index)
if col.GetType().Tp == mysql.TypeFloat {
result.ResizeFloat64(n, false)
f32s := src.Float32s()
f64s := result.Float64s()
for i := range f32s {
// TODO(zhangyuanjia): speed up the way to manipulate null-bitmaps.
if src.IsNull(i) {
result.SetNull(i, true)
} else {
f64s[i] = float64(f32s[i])
}
}
return nil
}
Theoretically it would be more efficient if we replace Column.SetNull() with Column.MergeNulls(), which utilizes bit operation underneath.
Proposed method:
n := input.NumRows()
src := input.Column(col.Index)
if col.GetType().Tp == mysql.TypeFloat {
result.ResizeFloat64(n, false)
f32s := src.Float32s()
f64s := result.Float64s()
result.MergeNulls(src)
for i := range f32s {
if src.IsNull(i) {
continue
}
f64s[i] = float64(f32s[i])
}
return nil
}
The text was updated successfully, but these errors were encountered:
General Question
I found a todo item('speed up the way to manipulate null-bitmaps') in expression/column.go, so I was thinking maybe using
Column.MergeNulls()
would be better than setting null on every single bit in the bitmap.In original code, we have to set null for every null element in
nullbitmap
, usingSetNull()
method.Theoretically it would be more efficient if we replace
Column.SetNull()
withColumn.MergeNulls()
, which utilizes bit operation underneath.Proposed method:
The text was updated successfully, but these errors were encountered: