gopxl / pixel

A hand-crafted 2D game library in Go.
MIT License
225 stars 9 forks source link

Benchmark Pixel #105

Closed bhperry closed 2 weeks ago

bhperry commented 3 weeks ago

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:

bhperry commented 3 weeks ago

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 commented 3 weeks ago

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 commented 3 weeks ago

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