Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@bhperry
Copy link
Contributor

@bhperry bhperry commented Aug 17, 2024

Adding a tools sub-package to pixel. This will be a CLI used to aid in the development of pixel.

The first command in the tools CLI is bench, which can be used to benchmark the performance of pixel across various scenarios. This will allow us to gather empirical evidence that improvements made to the pixel library are indeed improving! Or if we find they do not run as expected, to assist in investigating the performance characteristics of the changes being made against existing code.

Usage:

cd tools
go run main.go bench ls
go run main.go bench run --all

TODO:

  • Imdraw benchmarks
  • Additional cmdline options
    • configurable duration
    • profiling files
    • load previous stats file
  • Sprite benchmarks
    • static
    • moving
  • Profiling support

@bhperry
Copy link
Contributor Author

bhperry commented Aug 17, 2024

Open question: Any opinions on the Cobra CLI package? Thought I'd give it a try since this is a separate go package from pixel (so no new deps there). Seems pretty convenient so far, but I'm not tied to it. Happy to switch out for good ol' flag from the stdlib if there's a preference for that.

@dusk125
Copy link
Contributor

dusk125 commented Aug 17, 2024

Open question: Any opinions on the Cobra CLI package? Thought I'd give it a try since this is a separate go package from pixel (so no new deps there). Seems pretty convenient so far, but I'm not tied to it. Happy to switch out for good ol' flag from the stdlib if there's a preference for that.

Cobra is (imo) the command line option. I use it all the time for work and play. I would say we should have a separate mod file for tools (I haven't looked yet to see if there is one) that way they don't impose dependencies on pixel.

@bhperry
Copy link
Contributor Author

bhperry commented Aug 17, 2024

Open question: Any opinions on the Cobra CLI package? Thought I'd give it a try since this is a separate go package from pixel (so no new deps there). Seems pretty convenient so far, but I'm not tied to it. Happy to switch out for good ol' flag from the stdlib if there's a preference for that.

Cobra is (imo) the command line option. I use it all the time for work and play. I would say we should have a separate mod file for tools (I haven't looked yet to see if there is one) that way they don't impose dependencies on pixel.

Yep, have a separate mod for tools. Good to know! I am quite impressed with it so far. Definitely worlds better than raw flag

@bhperry bhperry force-pushed the benchmark branch 3 times, most recently from 564f563 to 6dfe764 Compare August 23, 2024 06:33
@bhperry bhperry force-pushed the benchmark branch 3 times, most recently from c61adc3 to c91d171 Compare August 23, 2024 16:43
@bhperry bhperry marked this pull request as ready for review August 23, 2024 17:50
@bhperry bhperry requested a review from a team August 23, 2024 17:50
@bhperry bhperry merged commit 9070c3c into gopxl:main Aug 27, 2024
@bhperry bhperry deleted the benchmark branch August 27, 2024 18:35
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.

2 participants