Commit fff6563c authored by Hoa Nguyen's avatar Hoa Nguyen Committed by GitHub

chore(op-service): reduce allocations (#10331)

* refactor: improve perf

* improve perf

* rollback

* rollback

---------
Co-authored-by: default avatarKhanh Hoa <khanhoait.bka@gmail.com>
parent 472322e8
......@@ -46,7 +46,7 @@ func NewSubcommands(m Metrics) cli.Commands {
table.SetCenterSeparator("|")
table.SetAutoWrapText(false)
table.SetHeader([]string{"Metric", "Description", "Labels", "Type"})
var data [][]string
data := make([][]string, 0, len(supportedMetrics))
for _, metric := range supportedMetrics {
labels := strings.Join(metric.Labels, ",")
data = append(data, []string{metric.Name, metric.Help, labels, metric.Type})
......
......@@ -323,7 +323,7 @@ func (m *SimpleTxManager) craftTx(ctx context.Context, candidate TxCandidate) (*
// data.
func MakeSidecar(blobs []*eth.Blob) (*types.BlobTxSidecar, []common.Hash, error) {
sidecar := &types.BlobTxSidecar{}
blobHashes := []common.Hash{}
blobHashes := make([]common.Hash, 0, len(blobs))
for i, blob := range blobs {
rawBlob := *blob.KZGBlob()
sidecar.Blobs = append(sidecar.Blobs, rawBlob)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment