Conversation
- Introduced a new benchmark harness for measuring the performance of various Layer implementations that render mobile units. - Implemented utility functions for creating mock game states, units, and GPU counters. - Added scenarios for benchmarking including full redraw, tick and render, and unit movement simulations. - Provided presets for unit mixes to simulate realistic game scenarios. - Included detailed statistics computation for benchmarking results.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces performance benchmarking tests for both the legacy
UnitLayerand the new, optimizedUnitLayerV2, and updates the main game renderer to useUnitLayerV2instead of the original implementation. The new tests use a shared harness and extensive mocking to enable reliable comparison of rendering performance in a jsdom environment. These changes lay the groundwork for evaluating and validating improvements made inUnitLayerV2.Unit layer optimization and integration:
GameRenderer.ts) now usesUnitLayerV2in place of the legacyUnitLayer, ensuring that all gameplay rendering benefits from the new optimizations. [1] [2]Performance benchmarking:
UnitLayerV2.perf.test.tsandUnitLayer.perf.test.tsto benchmark both the optimized and baseline unit layer implementations using a shared harness. These tests use identical scenarios and extensive mocks to ensure fair and consistent performance comparisons. [1] [2]Testing infrastructure improvements:
ImageDataandcreateImageBitmap) and mock out heavy dependencies (like PIXI.js, image imports, and utility modules) to allow performance tests to run in a jsdom environment without requiring real browser or WebGL features. [1] [2]