Skip to content

optimization: uint64 code chunk #537

@gballet

Description

@gballet

the code offset is 1 << 240 and the code chunk is never more than 24kb (maybe 64kb in the future). We can't save an allocation, but we could rewrite codeChunkIndex as such:

func codeChunkIndex(chunk uint64) (*uint256.Int, byte) {
	treeIndex := new(uint256.Int)
	treeIndex[3] = (1 << 48)
	treeIndex[0] = chunk / 8
	return treeIndex, byte(chunk)
}

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions