Skip to content

added multiple expression support for @bs macro, removed @bcomp. added common histogram axis. Fixes #8#7

Open
ajinkya-k wants to merge 7 commits intoastrozot:mainfrom
ajinkya-k:ahk/histcommonaxis
Open

added multiple expression support for @bs macro, removed @bcomp. added common histogram axis. Fixes #8#7
ajinkya-k wants to merge 7 commits intoastrozot:mainfrom
ajinkya-k:ahk/histcommonaxis

Conversation

@ajinkya-k
Copy link
Contributor

@ajinkya-k ajinkya-k commented Dec 27, 2024

This PR modifies the Base.show method for comparative benchmarking using @bcomp to display histograms with a common x-axis, making them histograms directly comparable. Also fixes #8

julia> @bs rand(500:1000) rand(_), rand(_^2)
Chairmarks.Benchmark: 336 samples with 1 evaluation.
 Range (min … max):  333.000 ns …   3.750 μs  ┊ GC (min … max): 0.00% … 0.00%
 Time  (median):     583.000 ns               ┊ GC (median):    0.00%
 Time  (mean ± σ):   607.896 ns ± 264.546 ns  ┊ GC (mean ± σ):  0.00% ± 0.00%

  █                                                              
  █▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ ▅
  333 ns        Histogram: log(frequency) by time       2.44 ms <

 Memory estimate: 4.06 KiB, allocs estimate: 3.
Chairmarks.Benchmark: 336 samples with 1 evaluation.
 Range (min … max):  127.459 μs …   2.437 ms  ┊ GC (min … max): 0.00% … 82.74%
 Time  (median):     442.792 μs               ┊ GC (median):    0.00%
 Time  (mean ± σ):   495.488 μs ± 283.638 μs  ┊ GC (mean ± σ):  6.80% ± 16.97%

      ▃█▆▅▃▁▃▂▁▁▅ ▄▁                                             
  ▁▁▁████████████▅██▅▇▅▅▄▃▃▃▄▃▁▃▁▂▂▂▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ ▃
  333 ns           Histogram: frequency by time         2.44 ms <

 Memory estimate: 1.92 MiB, allocs estimate: 3.

@ajinkya-k
Copy link
Contributor Author

@astrozot There is one issue that I could not figure out how to solve: I am using print(io, "\n") (on line 324 in the code) to insert a new line between the prints for each individual benchmark, but this causes there to be two empty lines at the very end, one of which is added by default by the Julia REPL.

@astrozot
Copy link
Owner

Hi @ajinkya-k , thank you, I will take care of it.

@ajinkya-k ajinkya-k changed the title Common x-axis for histograms when using @bcomp macro added multiple expression support for @bs macro, removed @bcomp. added common histogram axis Dec 29, 2024
@ajinkya-k ajinkya-k changed the title added multiple expression support for @bs macro, removed @bcomp. added common histogram axis added multiple expression support for @bs macro, removed @bcomp. added common histogram axis. Fixes #8 Dec 29, 2024
@ajinkya-k
Copy link
Contributor Author

@astrozot @LilithHafner can you try this out and see if you can find any edge cases or issues?

@ajinkya-k
Copy link
Contributor Author

@astrozot does something else need to be done to merge this?

@ajinkya-k ajinkya-k changed the title added multiple expression support for @bs macro, removed @bcomp. added common histogram axis. Fixes #8 added multiple expression support for @bs macro, removed @bcomp. added common histogram axis. Fixes #8 Jan 17, 2025
@ajinkya-k
Copy link
Contributor Author

hey @astrozot did you get a chance to see this PR?

@astrozot
Copy link
Owner

astrozot commented Feb 3, 2025

Hi @ajinkya-k , sorry for the delay, but I am quite busy in this period and did not have a chance to check your code. Will try to do it soon.

@astrozot astrozot self-requested a review February 3, 2025 11:50
@astrozot astrozot self-assigned this Feb 3, 2025
@ajinkya-k
Copy link
Contributor Author

@astrozot No worries. Sorry to bother you.

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.

Throw more meaningful error when calling @bcomp with only one function

2 participants