ROX-35259: avoid proto timestamp allocs in IsStartupProcessView#21352
ROX-35259: avoid proto timestamp allocs in IsStartupProcessView#21352ebensh wants to merge 1 commit into
Conversation
Replace time.Time → *timestamppb.Timestamp → protoutils.Sub roundtrip with direct time.Time.Sub(). Eliminates ~191M heap allocations per reprocessing cycle by removing two unnecessary proto struct allocations per process indicator row.
|
Skipping CI for Draft Pull Request. |
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Enterprise Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🚀 Build Images ReadyImages are ready for commit ed3db9a. To use with deploy scripts: export MAIN_IMAGE_TAG=4.12.x-268-ged3db9a3c5 |
Description
IsStartupProcessViewconverts two*time.Timevalues to*timestamppb.Timestamp(via
protocompat.ConvertTimeToTimestampOrNil) only to pass them toprotoutils.Sub,which just reads
.GetSeconds()and.GetNanos(). This allocates two proto structsper process indicator row — ~191M heap objects per reprocessing cycle in production profiles.
Fix: subtract
time.Timevalues directly. The nil-SignalTimebehavior is preservedand made explicit (returns
true, matching the existing TODO comment about ROX-31107).User-facing documentation
Testing and quality
Automated testing
How I validated my change
central/processbaseline/evaluatorpasstrue(startup process), matching the priorprotoutils.Subbehavior which returns 0 for nil inputsalloc_objectsprofile of Central under steady-state load (1.35h capture)🤖 Generated with Claude Code