Skip to content

Reorder variables structs to optimize memory #1257

Closed
@ValarDragon

Description

@ValarDragon

Read this first: https://medium.com/@felipedutratine/how-to-organize-the-go-struct-in-order-to-save-memory-c78afcf59ec2 (Its short)

We should reorder the variables in all of our structs, to save on memory used. I've tagged this is as prelaunch, since I'm not sure if this can be changed easily postlaunch, as it may affect state variables / data encoding. (I don't actually know though, anyone who knows if our codec cares about the order variables appear in, feel free to chime in. Would be glad to make this post-launch if wire.codec didn't care about the order variables appeared in) From what I can gather, it doesn't look like this will be done automatically for us before go 2.0 (judging from this issue: golang/go#10014), so we'll have to reorder all of our structs ourselves.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions