search v2: pre-allocate dashboardQueryResult slice capacity for performance (#91536)
* search v2: pre-allocate dashboardQueryResult slice for performance * use limit parameter for starting slice size
This commit is contained in:
@@ -846,7 +846,7 @@ func (l sqlDashboardLoader) loadAllDashboards(ctx context.Context, limit int, or
|
||||
attribute.Int64("lastID", lastID),
|
||||
))
|
||||
|
||||
rows := make([]*dashboardQueryResult, 0)
|
||||
rows := make([]*dashboardQueryResult, 0, limit)
|
||||
err := l.sql.WithDbSession(dashboardQueryCtx, func(sess *db.Session) error {
|
||||
sess.Table("dashboard").
|
||||
Where("org_id = ?", orgID).
|
||||
|
||||
Reference in New Issue
Block a user