Skip to content

perf: avoid boxing components into an interface when adding to storage - #30

Merged
ragoune merged 2 commits into
masterfrom
perf/storage-avoid-boxing
Jun 28, 2026
Merged

perf: avoid boxing components into an interface when adding to storage#30
ragoune merged 2 commits into
masterfrom
perf/storage-avoid-boxing

Conversation

@ragoune

Copy link
Copy Markdown
Contributor

addComponentsToArchetypeN and copy hold a concrete *ComponentsStorage[T], but went through add(component ComponentInterface), boxing the component into an interface and doing a type assertion on every add. Add a typed addTyped(T) that appends the value directly; the interface add now just delegates to it.

ragouneand others added 2 commits June 28, 2026 12:23
 addComponentsToArchetypeN and copy hold a concrete *ComponentsStorage[T], but
went through add(component ComponentInterface), boxing the component into an
interface and doing a type assertion on every add. Add a typed addTyped(T) that
appends the value directly; the interface add now just delegates to it.
@codecov

codecovBot commented Jun 28, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.50000% with 1 line in your changes missing coverage. Please review.

Files with missing linesPatch %Lines
storage.go75.00%1 Missing ⚠️
Files with missing linesCoverage Δ
component.go66.05% <100.00%> (ø)
storage.go64.00% <75.00%> (-2.67%)⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ragoune
ragoune merged commit fdfc167 into masterJun 28, 2026
4 checks passed
@ragoune
ragoune deleted the perf/storage-avoid-boxing branch June 28, 2026 10:26
Sign up for freeto 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

@ragoune