Closed sa- closed 4 months ago
@sa- I also definitely want some way to do timing and benchmarking but in general find both julia's @time
and python's @timeit
a bit too crude. Workflows, e.g. notebooks often run in cloud environments with variable wall clock time and other clock issues that come from running in VMs.
I wonder if there might be a better way to instrument program counters instead to be able to probe cpu instructions, syscalls, allocations etc.
Microbenchmarks also usually need special attention. The prior art with JMH (the java microbenchmark harness), HDR histogram, and scalene are also great design points
Thank you for reporting this. For the time being we won't be adding this feature, but we might revisit it next year.
Request
When writing code with performance in mind, keeping an eye on the number of allocations + time taken is crucial to know. This is a feature request to provide a decorator/macro that provides this information.
Motivation
Julia has solved this problem quite well and it would be nice to have this in mojo somehow This is how Julia provides this information
I've found it to be a very pragmatic way to shorten the feedback loop when writing performant code. Allows for faster coding iteration times by making it easy to measure performance.
Description and Requirements
Not sure how this would be implemented since decorators and macros are not implemented yet, maybe this is a feature request for a future point in time. Wanted to express my interest in this sort of feature anyway