Skip to content

blocks: change Block to a value struct#192

Closed
Jorropo wants to merge 1 commit intomainfrom
value-block
Closed

blocks: change Block to a value struct#192
Jorropo wants to merge 1 commit intomainfrom
value-block

Conversation

@Jorropo
Copy link
Contributor

@Jorropo Jorropo commented Mar 3, 2023

The goal is to stop doing two allocations for each block (now it will only allocate the []byte buffer, and pass the cid.Cid, []byte pair by decomposed registers or stack).

This way of changing does not change the syntax for trivial uses of block.Block, so in theory we will have to update only producers of block.Block, not consumers.

Fixes ipfs/go-block-format#45

The goal is to stop doing two allocations for each block (now it will only allocate the `[]byte` buffer, and pass the `cid.Cid, []byte` pair by decomposed registers or stack).

This way of changing does not change the syntax for trivial uses of block.Block, so in theory we will have to update only producers of block.Block, not consumers.

Fixes #57
@Jorropo Jorropo requested a review from a team as a code owner March 3, 2023 07:42
@Jorropo Jorropo mentioned this pull request Mar 3, 2023
2 tasks
Jorropo added a commit to ipfs/go-block-format that referenced this pull request Mar 3, 2023
Jorropo added a commit to ipfs/go-block-format that referenced this pull request Mar 3, 2023
@Jorropo Jorropo marked this pull request as draft March 3, 2023 07:54
@Jorropo
Copy link
Contributor Author

Jorropo commented Mar 3, 2023

@Jorropo Jorropo removed their assignment Mar 4, 2024
gammazero added a commit to ipfs/go-block-format that referenced this pull request Aug 6, 2024
The goal is to stop doing two allocations for each block (now it will only allocate the []byte buffer, and pass the cid.Cid, []byte pair by decomposed registers or stack).

This way of changing does not change the syntax for trivial uses of block.Block, so in theory we will have to update only producers of block.Block, not consumers.

Fixes #45

Replaces ipfs/boxo#192

Note: This change will cause a failure here:
https://github.com/ipfs/go-ipld-format/blob/0f7aff00f72e9dea0d9718bc0972e309ba7c3e8d/format.go#L27
@gammazero
Copy link
Contributor

Replaced by ipfs/go-block-format#53

@gammazero gammazero closed this Aug 6, 2024
gammazero added a commit to ipfs/go-block-format that referenced this pull request May 2, 2025
The goal is to stop doing two allocations for each block (now it will only allocate the []byte buffer, and pass the cid.Cid, []byte pair by decomposed registers or stack).

This way of changing does not change the syntax for trivial uses of block.Block, so in theory we will have to update only producers of block.Block, not consumers.

Fixes #45

Replaces ipfs/boxo#192

Note: This change will cause a failure here:
https://github.com/ipfs/go-ipld-format/blob/0f7aff00f72e9dea0d9718bc0972e309ba7c3e8d/format.go#L27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects
Status: 🔎 In Review

Development

Successfully merging this pull request may close these issues.

valuify blocks.Block

2 participants