Skip to content

Use Cow<'static, str> for opcode string #322

@DaniPopes

Description

@DaniPopes

This op.to_string() is a significant waste of time and memory because op.as_str() returns a &'static str

op: self.op.to_string(),

It can be avoided if the field was a Cow<'static, str> here https://github.com/alloy-rs/alloy/blob/566cee40c4413f2fb921bbbea705c45f4eb25d9a/crates/rpc-types-trace/src/geth/mod.rs#L75-L76

@mattsse however this would be a breaking change in alloy, wdyt?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions