Skip to content

Add ScanPeers() to iterate peers with zero allocations - #44

Merged
orsinium merged 5 commits into
firefly-zero:mainfrom
applejag:feature/zero-alloc-peer-scanner
Sep 5, 2026
Merged

orsinium merged 5 commits into
firefly-zero:mainfrom
applejag:feature/zero-alloc-peer-scanner

Conversation

@applejag

@applejag applejag commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

The firefly.Peers.Slice allocates a slice, and TinyGo doesn't inline firefly.Peers.Iter correctly and so it also allocates.

I've been using a Scanner hack in some of my projects to avoid the allocations. Maybe it could be added to the SDK?


I ran go doc -http to see how this renders, and here's a sample:

image

@applejag
applejag force-pushed the feature/zero-alloc-peer-scanner branch from 3c7aa9d to 09e1c70 Compare September 4, 2026 21:01
Comment thread firefly/net.go Outdated
Comment thread firefly/net_example_test.go Outdated
@applejag
applejag requested a review from orsinium September 5, 2026 08:48
Comment thread firefly/net.go Outdated
@applejag
applejag requested a review from orsinium September 5, 2026 11:36
@orsinium

orsinium commented Sep 5, 2026

Copy link
Copy Markdown
Member

Perfect, thanks :)

@orsinium
orsinium merged commit f94600b into firefly-zero:main Sep 5, 2026
1 check passed
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