Skip to content

perf: pre-size 3 slices with known upper bounds#101

Open
KorsarOfficial wants to merge 1 commit intoyandex:mainfrom
KorsarOfficial:perf/preallocate-slices-2
Open

perf: pre-size 3 slices with known upper bounds#101
KorsarOfficial wants to merge 1 commit intoyandex:mainfrom
KorsarOfficial:perf/preallocate-slices-2

Conversation

@KorsarOfficial
Copy link
Copy Markdown

Problem

Three slices allocated with zero capacity in paths that append a known number of elements.

Changes

File Slice Capacity
process/map.go:764 toRemove len(registeredmaps)
process/map.go:765 toAdd len(exemappings)
upload/uploader.go:179 askBuildIDs len(buildIDs)
sample_consumer.go:349 tls len(TlsValues.Values)

All hints are tight upper bounds. Allocations per call: 1+log2(n) to 1.

@KorsarOfficial
Copy link
Copy Markdown
Author

📄 Full analysis report (PDF): 08-perforator-optimizations.pdf

Covers complexity analysis, concurrency audit, and verification for all 7 optimizations.

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.

1 participant