Skip to content

Conversation

@dimkr
Copy link
Owner

@dimkr dimkr commented Oct 13, 2025

No description provided.

@dimkr dimkr force-pushed the main branch 2 times, most recently from f4895bb to d1ad494 Compare November 1, 2025 15:48
@dimkr dimkr requested a review from Copilot November 8, 2025 18:31
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements buffer pooling to reuse request buffers across the codebase, reducing memory allocations and garbage collection pressure. The changes introduce sync.Pool for managing reusable byte slices in protocol handlers and HTTP clients.

Key changes:

  • Modified protocol handlers (Gemini, Gopher, Finger) to use pooled buffers instead of creating new allocations per request
  • Updated HTTP client code in fed/send.go to return buffer data with cleanup callbacks instead of response objects
  • Replaced bytes.Buffer with pooled []byte in LineWriter for more efficient buffer management

Reviewed Changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
front/text/line.go Replaces bytes.Buffer with pooled []byte slice and adds buffer return on goroutine cleanup
front/gopher/gopher.go Extracts request reading into separate function using pooled buffers
front/gemini/gemini.go Extracts request reading into separate function using pooled buffers
front/finger/finger.go Extracts request reading into separate function using pooled buffers
fed/send.go Changes return signature to provide buffer data with cleanup callback instead of http.Response
fed/resolve.go Updates to use new send() signature with buffer cleanup callbacks
fed/inbox.go Updates to use pooled buffers for reading request bodies
fed/followers.go Updates to use new resolver signature with cleanup callbacks
fed/deliver.go Updates to use new send() signature with cleanup callback
fed/listener.go Adds Buffers field to Listener struct
ap/resolver.go Updates Get() interface signature to return status, body, cleanup function
cmd/tootik/main.go Initializes buffer pools for all protocol listeners
test/register_test.go Adds buffer pool initialization to all test cases
fed/resolve_test.go Updates tests to use buffer pools instead of MaxResponseBodySize config
cluster/server.go Initializes buffer pools for test server setup

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@dimkr dimkr requested a review from Copilot November 9, 2025 06:16
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 15 out of 15 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@dimkr dimkr requested a review from Copilot November 9, 2025 06:50
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

Copilot AI commented Nov 9, 2025

@dimkr I've opened a new pull request, #186, to work on those changes. Once the pull request is ready, I'll request review from you.

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