Skip to content

impr: Make the compiledIO benchmarks fairer #1089

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

reczkok
Copy link
Contributor

@reczkok reczkok commented Mar 27, 2025

No description provided.

@reczkok reczkok requested a review from Copilot March 27, 2025 13:44
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR aims to make the compiledIO benchmarks fairer by adjusting how data is written and accessed in various components.

  • Update the compiled writer to use array indexing for vector and matrix component access
  • Cache the compiled writer in the buffer implementation to avoid repeated evaluations
  • Revise benchmark test suites to create and populate data buffers more directly

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
packages/typegpu/src/data/compiledIO.ts Updated component access in writer code and added a console.log for debugging purposes
packages/typegpu/src/core/buffer/buffer.ts Cached the compiled writer to reuse previous evaluation results
apps/typegpu-docs/src/pages/benchmark/test-suites/compiled-write.ts Updated data initialization and buffer writing steps in multiple benchmark scenarios
Comments suppressed due to low confidence (1)

apps/typegpu-docs/src/pages/benchmark/test-suites/compiled-write.ts:143

  • [nitpick] Initializing the boid data arrays as new Array(amountOfBoids) leaves their elements undefined; it might be clearer to initialize these arrays with default objects or null values to set expectations for later assignments.
ctx.typegpuBoidData[size] = new Array(amountOfBoids);

Copy link

github-actions bot commented Mar 27, 2025

pkg.pr.new

packages

pnpm i https://pkg.pr.new/software-mansion/TypeGPU/typegpu@1089
pnpm i https://pkg.pr.new/software-mansion/TypeGPU/typegpu@da916214144773fe4e302d2816dca919a81b2f8e

benchmark
view benchmark

commit
view commit

@reczkok reczkok requested a review from iwoplaza April 1, 2025 14:44
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