pgx/stdlib
Dominique Lefevre 69934dcd95 Make fewer allocations in QueryContext().
For a simple query like `SELECT * FROM t WHERE id = $1`,
QueryContext() used to make 6 allocations on average.
Reduce that to 4 by avoiding two allocations that
are immediately discarded:

  // the variadic arguments of c.conn.Query() escape,
  // so args is heap-allocated
  args := []any{databaseSQLResultFormats}
  // append() reallocates args to add enough space +
  // an array returned by namedValueToInterface()
  // is immediately discarded
  args = append(args, namedValueToInterface(argsV)...)
2025-07-04 14:11:46 +03:00
..
2020-06-01 08:53:45 -05:00
2023-10-10 22:07:06 -05:00