Skip to content

perf: Optimize test history memory usage#4887

Open
DanielRyanSmith wants to merge 2 commits intomainfrom
perf-optimize-test-history
Open

perf: Optimize test history memory usage#4887
DanielRyanSmith wants to merge 2 commits intomainfrom
perf-optimize-test-history

Conversation

@DanielRyanSmith
Copy link
Copy Markdown
Contributor

@DanielRyanSmith DanielRyanSmith commented May 5, 2026

Overview

This PR improves the memory efficiency and execution time of the testHistoryHandler by removing expensive map allocations.

Root Cause / Motivation

Previously, the test history API modeled each subtest entry as a map[string]string. When processing historical records for a test suite across multiple browsers, instantiating thousands of small maps incurs massive memory overhead, high garbage collection pressure, and slow allocation speeds compared to standard Go structs.

Detailed Changelog

  • api/test_history.go: Refactored Subtest from a map[string]string to a strongly-typed struct with JSON tags. This drastically reduces heap allocations and memory fragmentation when assembling the final JSON response tree.
  • api/test_history_test.go: Updated the unit test assertions to match the new Subtest struct format.

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