Skip to content

Conversation

@davecgh
Copy link
Member

@davecgh davecgh commented Dec 8, 2025

This updates the 2.1 release branch to use the latest version of the wire module which includes reduced allocations writing messages to the p2p network.

In particular, the following updated module version is used:

- github.com/decred/dcrd/wire@v1.7.2

Note that it also cherry picks all of the commits included in updates to the wire module to ensure they are also included in the release branch even though it is not strictly necessary since go.mod has been updated to require the new release and thus will pull in the new code. However, from past experience, not having code backported to modules available in the release branch too leads to headaches for devs building from source in their local workspace with overrides such as those in go.work.

The following PRs are included:

jrick and others added 2 commits December 8, 2025 13:45
For at least the past 5 years, due to garbage collector design, Go has not
optimized small non-pointer types to fit inside interface headers, and instead
always uses a pointer to data, if the type is not already a pointer.  This
means that writeElement, which was written before this time to avoid
unnecessary heap allocations, was now causing heap allocations for each
special cased non-pointer type.

This commit rewrites writeElement to only special case pointers to types, and
to pass all elements by pointer.

Co-authored-by: David Hill <dhill@mindcry.org>
This updates the 2.1 release branch to use the latest version of the
wire module which includes reduced allocations writing messages to the
p2p network.

In particular, the following updated module version is used:

- github.com/decred/dcrd/wire@v1.7.2
@davecgh davecgh added this to the 2.1.2 milestone Dec 8, 2025
@davecgh davecgh changed the title Rel21 wire backports [release-v2.1] main: Use backported wire updates. Dec 8, 2025
@davecgh davecgh merged commit 0d98382 into decred:release-v2.1 Dec 8, 2025
34 checks passed
@davecgh davecgh deleted the rel21_wire_backports branch December 8, 2025 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants