perf: investigate protobuf builders in hot paths

Open
#427 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Refactor
Clarity
Mostly clear
Activity status
Active
Tech stack
go, grpc
Domain
performance

Research direction

Start with the response-envelope construction in message.go and find where the protobuf _builder{...}.Build() calls sit on per-message paths. Write microbenchmarks comparing builder and setter forms with representative message shapes, reporting ns/op, B/op and allocs/op. Done means a recorded results write-up plus, only where the gain justifies it, targeted setter changes that keep field values and presence semantics intact.

Written by the indexing model from the issue text.

Description

cleanup performance

Question

Does construction with protobuf Opaque API _builder{...}.Build() add meaningful allocations or execution cost in Gorums hot paths compared with creating a message and calling setters?

The Go protobuf Opaque API article describes the API and its performance motivations.
The result depends on message shape, compiler behavior, and workload, so measure Gorums' own paths before changing them.

Investigation

  • Identify builder use on frequently executed library paths, starting with response-envelope construction in message.go and other per-message paths.
  • Benchmark equivalent builder and setter implementations with representative message shapes and current toolchain.
  • Report ns/op, B/op, and allocs/op; include an end-to-end call benchmark if microbenchmarks show a meaningful difference.
  • Check that alternatives preserve field values and presence semantics.
  • Record results and recommend targeted setter changes only where the benefit justifies the added code.

Keep a repository-wide builder rewrite outside this investigation.

Dominant language
Go
Stars
149
Forks
15
Avg merge
1d 7h
Merged PRs (30d)
46

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from relab/gorums

All issues in relab/gorums

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.