Skip to content
This repository was archived by the owner on Jul 4, 2023. It is now read-only.

Commit 85813c3

Browse files
authored
rename from BenchmarkPlots to BenchmarkHistograms (#4)
* rename * rename file * rename object
1 parent c04f0c6 commit 85813c3

File tree

7 files changed

+28
-29
lines changed

7 files changed

+28
-29
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name = "BenchmarkPlots"
1+
name = "BenchmarkHistograms"
22
uuid = "a80a1652-aad8-438d-b80b-ecb1a674e33b"
33
authors = ["Eric Hanson <[email protected]> and contributors"]
44
version = "0.1.0"

README.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
1-
[![CI](https://github.com/ericphanson/BenchmarkPlots.jl/actions/workflows/CI.yml/badge.svg)](https://github.com/ericphanson/BenchmarkPlots.jl/actions/workflows/CI.yml)
2-
[![codecov](https://codecov.io/gh/ericphanson/BenchmarkPlots.jl/branch/main/graph/badge.svg?token=v0aca89xRi)](https://codecov.io/gh/ericphanson/BenchmarkPlots.jl)
1+
[![CI](https://github.com/ericphanson/BenchmarkHistograms.jl/actions/workflows/CI.yml/badge.svg)](https://github.com/ericphanson/BenchmarkHistograms.jl/actions/workflows/CI.yml)
2+
[![codecov](https://codecov.io/gh/ericphanson/BenchmarkHistograms.jl/branch/main/graph/badge.svg?token=v0aca89xRi)](https://codecov.io/gh/ericphanson/BenchmarkHistograms.jl)
33

4-
# BenchmarkPlots
4+
# BenchmarkHistograms
55

66
Wraps [BenchmarkTools.jl](https://github.com/JuliaCI/BenchmarkTools.jl/) to provide a UnicodePlots.jl-powered `show` method for `@benchmark`. This is accomplished by a custom `@benchmark` method which wraps the output in a `BenchmarkPlot` struct with a custom show method.
77

8-
This means one should not call `using` on both BenchmarkPlots and BenchmarkTools in the same namespace, or else these `@benchmark` macros will conflict ("WARNING: using `BenchmarkTools.@benchmark` in module Main conflicts with an existing identifier.")
8+
This means one should not call `using` on both BenchmarkHistograms and BenchmarkTools in the same namespace, or else these `@benchmark` macros will conflict ("WARNING: using `BenchmarkTools.@benchmark` in module Main conflicts with an existing identifier.")
99

10-
However, BenchmarkPlots re-exports all the export of BenchmarkTools, so you can simply call `using BenchmarkPlots`.
10+
However, BenchmarkHistograms re-exports all the export of BenchmarkTools, so you can simply call `using BenchmarkHistograms`.
1111

1212
Providing this functionality in BenchmarkTools itself was discussed in <https://github.com/JuliaCI/BenchmarkTools.jl/pull/180>.
1313

14-
Use the setting `BenchmarkPlots.NBINS[] = 10` to change the number of histogram bins used.
14+
Use the setting `BenchmarkHistograms.NBINS[] = 10` to change the number of histogram bins used.
1515

1616
## Example
1717

18-
One just uses `BenchmarkPlots` instead of `BenchmarkTools`, e.g.
18+
One just uses `BenchmarkHistograms` instead of `BenchmarkTools`, e.g.
1919

2020
```julia
21-
using BenchmarkPlots
21+
using BenchmarkHistograms
2222

2323
@benchmark sin(x) setup=(x=rand())
2424
```
@@ -125,4 +125,3 @@ See also <https://tratt.net/laurie/blog/entries/minimum_times_tend_to_mislead_wh
125125
---
126126

127127
*This page was generated using [Literate.jl](https://github.com/fredrikekre/Literate.jl).*
128-

generate_readme/Manifest.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ uuid = "56f22d72-fd6d-98f1-02f0-08ddc0907c33"
99
[[Base64]]
1010
uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
1111

12-
[[BenchmarkPlots]]
12+
[[BenchmarkHistograms]]
1313
deps = ["BenchmarkTools", "Printf", "Statistics", "UnicodePlots"]
1414
path = ".."
1515
uuid = "a80a1652-aad8-438d-b80b-ecb1a674e33b"

generate_readme/Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[deps]
2-
BenchmarkPlots = "a80a1652-aad8-438d-b80b-ecb1a674e33b"
2+
BenchmarkHistograms = "a80a1652-aad8-438d-b80b-ecb1a674e33b"
33
Literate = "98b081ad-f1c9-55d3-8b20-4c87d4299306"

generate_readme/README.jl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
1-
# [![CI](https://github.com/ericphanson/BenchmarkPlots.jl/actions/workflows/CI.yml/badge.svg)](https://github.com/ericphanson/BenchmarkPlots.jl/actions/workflows/CI.yml)
2-
# [![codecov](https://codecov.io/gh/ericphanson/BenchmarkPlots.jl/branch/main/graph/badge.svg?token=v0aca89xRi)](https://codecov.io/gh/ericphanson/BenchmarkPlots.jl)
1+
# [![CI](https://github.com/ericphanson/BenchmarkHistograms.jl/actions/workflows/CI.yml/badge.svg)](https://github.com/ericphanson/BenchmarkHistograms.jl/actions/workflows/CI.yml)
2+
# [![codecov](https://codecov.io/gh/ericphanson/BenchmarkHistograms.jl/branch/main/graph/badge.svg?token=v0aca89xRi)](https://codecov.io/gh/ericphanson/BenchmarkHistograms.jl)
33

4-
# # BenchmarkPlots
4+
# # BenchmarkHistograms
55

66
# Wraps [BenchmarkTools.jl](https://github.com/JuliaCI/BenchmarkTools.jl/) to provide a UnicodePlots.jl-powered `show` method for `@benchmark`. This is accomplished by a custom `@benchmark` method which wraps the output in a `BenchmarkPlot` struct with a custom show method.
77

8-
# This means one should not call `using` on both BenchmarkPlots and BenchmarkTools in the same namespace, or else these `@benchmark` macros will conflict ("WARNING: using `BenchmarkTools.@benchmark` in module Main conflicts with an existing identifier.")
8+
# This means one should not call `using` on both BenchmarkHistograms and BenchmarkTools in the same namespace, or else these `@benchmark` macros will conflict ("WARNING: using `BenchmarkTools.@benchmark` in module Main conflicts with an existing identifier.")
99

10-
# However, BenchmarkPlots re-exports all the export of BenchmarkTools, so you can simply call `using BenchmarkPlots`.
10+
# However, BenchmarkHistograms re-exports all the export of BenchmarkTools, so you can simply call `using BenchmarkHistograms`.
1111

1212
# Providing this functionality in BenchmarkTools itself was discussed in <https://github.com/JuliaCI/BenchmarkTools.jl/pull/180>.
1313

14-
# Use the setting `BenchmarkPlots.NBINS[] = 10` to change the number of histogram bins used.
14+
# Use the setting `BenchmarkHistograms.NBINS[] = 10` to change the number of histogram bins used.
1515

1616
# ## Example
1717

18-
# One just uses `BenchmarkPlots` instead of `BenchmarkTools`, e.g.
18+
# One just uses `BenchmarkHistograms` instead of `BenchmarkTools`, e.g.
1919

20-
using BenchmarkPlots
20+
using BenchmarkHistograms
2121

2222
@benchmark sin(x) setup=(x=rand())
2323

src/BenchmarkPlots.jl renamed to src/BenchmarkHistograms.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module BenchmarkPlots
1+
module BenchmarkHistograms
22

33
using UnicodePlots
44
using Statistics
@@ -24,12 +24,12 @@ When `NBINS[] <= 0`, the number is chosen automatically by UnicodePlots.
2424
"""
2525
const NBINS = Ref(0)
2626

27-
struct BenchmarkPlot
27+
struct BenchmarkHistogram
2828
trial::BenchmarkTools.Trial
2929
end
3030

3131
# borrowed some from `show` implementation for `BenchmarkTools.Trial`
32-
function Base.show(io::IO, ::MIME"text/plain", bp::BenchmarkPlot)
32+
function Base.show(io::IO, ::MIME"text/plain", bp::BenchmarkHistogram)
3333
t = bp.trial
3434
if length(t) > 0
3535
min = minimum(t)
@@ -60,7 +60,7 @@ end
6060

6161
macro benchmark(exprs...)
6262
return quote
63-
BenchmarkPlot(BenchmarkTools.@benchmark($(exprs...)))
63+
BenchmarkHistogram(BenchmarkTools.@benchmark($(exprs...)))
6464
end
6565
end
6666

test/runtests.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using BenchmarkPlots
1+
using BenchmarkHistograms
22
using Test
33

44
function tests()
@@ -27,17 +27,17 @@ function tests()
2727
end
2828

2929
function tests(nbins)
30-
pre = BenchmarkPlots.NBINS[]
31-
BenchmarkPlots.NBINS[] = nbins
30+
pre = BenchmarkHistograms.NBINS[]
31+
BenchmarkHistograms.NBINS[] = nbins
3232
try
3333
tests()
3434
finally
35-
BenchmarkPlots.NBINS[] = pre
35+
BenchmarkHistograms.NBINS[] = pre
3636
end
3737
return nothing
3838
end
3939

40-
@testset "BenchmarkPlots.jl" begin
40+
@testset "BenchmarkHistograms.jl" begin
4141
tests()
4242
tests(10)
4343
tests(-1)

0 commit comments

Comments
 (0)