Skip to content

Commit 05d971f

Browse files
committed
customisable -> customizable
1 parent 95da3ba commit 05d971f

File tree

7 files changed

+145
-145
lines changed

7 files changed

+145
-145
lines changed

src/execution.jl

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ end
1616

1717
mutable struct Benchmark
1818
samplefunc
19-
customisable_func
19+
customizable_func
2020
quote_vals
2121
params::Parameters
2222
end
@@ -111,56 +111,56 @@ function _run(b::Benchmark, p::Parameters; verbose=false, pad="", warmup=true, k
111111
params = Parameters(p; kwargs...)
112112
@assert params.seconds > 0.0 "time limit must be greater than 0.0"
113113
if warmup #warmup sample
114-
params.run_customisable_func_only &&
114+
params.run_customizable_func_only &&
115115
b.samplefunc(b.quote_vals, Parameters(params; evals=1))
116-
!params.run_customisable_func_only &&
117-
b.customisable_func(b.quote_vals, Parameters(params; evals=1))
116+
!params.run_customizable_func_only &&
117+
b.customizable_func(b.quote_vals, Parameters(params; evals=1))
118118
end
119119
trial = Trial(params)
120-
if params.enable_customisable_func == :ALL
121-
trial.customisable_result = []
122-
trial.customisable_result_for_every_sample = true
120+
if params.enable_customizable_func == :ALL
121+
trial.customizable_result = []
122+
trial.customizable_result_for_every_sample = true
123123
end
124124
params.gctrial && gcscrub()
125125
start_time = Base.time()
126126

127127
return_val = nothing
128-
if !params.run_customisable_func_only
128+
if !params.run_customizable_func_only
129129
s = b.samplefunc(b.quote_vals, params)
130130
push!(trial, s[1:(end - 1)]...)
131131
return_val = s[end]
132132
end
133-
if params.enable_customisable_func == :ALL
134-
params.customisable_gcsample && gcscrub()
135-
s = b.customisable_func(b.quote_vals, params)
136-
push!(trial.customisable_result, s[1])
133+
if params.enable_customizable_func == :ALL
134+
params.customizable_gcsample && gcscrub()
135+
s = b.customizable_func(b.quote_vals, params)
136+
push!(trial.customizable_result, s[1])
137137

138-
if params.run_customisable_func_only
138+
if params.run_customizable_func_only
139139
return_val = s[end]
140140
end
141141
end
142142

143143
iters = 2
144144
while (Base.time() - start_time) < params.seconds && iters params.samples
145-
if !params.run_customisable_func_only
145+
if !params.run_customizable_func_only
146146
params.gcsample && gcscrub()
147147
push!(trial, b.samplefunc(b.quote_vals, params)[1:(end - 1)]...)
148148
end
149149

150-
if params.enable_customisable_func == :ALL
151-
params.customisable_gcsample && gcscrub()
152-
push!(trial.customisable_result, b.customisable_func(b.quote_vals, params)[1])
150+
if params.enable_customizable_func == :ALL
151+
params.customizable_gcsample && gcscrub()
152+
push!(trial.customizable_result, b.customizable_func(b.quote_vals, params)[1])
153153
end
154154

155155
iters += 1
156156
end
157157

158-
if params.enable_customisable_func == :LAST
159-
params.customisable_gcsample && gcscrub()
160-
s = b.customisable_func(b.quote_vals, params)
161-
trial.customisable_result = s[1]
158+
if params.enable_customizable_func == :LAST
159+
params.customizable_gcsample && gcscrub()
160+
s = b.customizable_func(b.quote_vals, params)
161+
trial.customizable_result = s[1]
162162

163-
if params.run_customisable_func_only
163+
if params.run_customizable_func_only
164164
return_val = s[end]
165165
end
166166
end
@@ -578,7 +578,7 @@ function generate_benchmark_definition(
578578
@nospecialize
579579
corefunc = gensym("core")
580580
samplefunc = gensym("sample")
581-
customisable_func = gensym("customisable")
581+
customizable_func = gensym("customizable")
582582
type_vars = [gensym() for i in 1:(length(quote_vars) + length(setup_vars))]
583583
signature = Expr(:call, corefunc, quote_vars..., setup_vars...)
584584
signature_def = Expr(
@@ -644,7 +644,7 @@ function generate_benchmark_definition(
644644
)...,
645645
__return_val
646646
end
647-
@noinline function $(customisable_func)(
647+
@noinline function $(customizable_func)(
648648
$(Expr(:tuple, quote_vars...)), __params::$BenchmarkTools.Parameters
649649
)
650650
local __setup_prehook_result
@@ -680,7 +680,7 @@ function generate_benchmark_definition(
680680
end
681681
end
682682
$BenchmarkTools.Benchmark(
683-
$(samplefunc), $(customisable_func), $(quote_vals), $(params)
683+
$(samplefunc), $(customizable_func), $(quote_vals), $(params)
684684
)
685685
end,
686686
)

src/parameters.jl

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ mutable struct Parameters{A,B}
1515
gcsample::Bool
1616
time_tolerance::Float64
1717
memory_tolerance::Float64
18-
run_customisable_func_only::Bool
19-
enable_customisable_func::Symbol
20-
customisable_gcsample::Bool
18+
run_customizable_func_only::Bool
19+
enable_customizable_func::Symbol
20+
customizable_gcsample::Bool
2121
setup_prehook
2222
teardown_posthook
2323
sample_result
@@ -34,26 +34,26 @@ mutable struct Parameters{A,B}
3434
gcsample,
3535
time_tolerance,
3636
memory_tolerance,
37-
run_customisable_func_only,
38-
enable_customisable_func,
39-
customisable_gcsample,
37+
run_customizable_func_only,
38+
enable_customizable_func,
39+
customizable_gcsample,
4040
setup_prehook,
4141
teardown_posthook,
4242
sample_result,
4343
prehook::A,
4444
posthook::B,
4545
) where {A,B}
46-
if enable_customisable_func (:FALSE, :ALL, :LAST)
46+
if enable_customizable_func (:FALSE, :ALL, :LAST)
4747
throw(
4848
ArgumentError(
49-
"invalid value $(enable_customisable_func) for enable_customisable_func which must be :FALSE, :ALL or :LAST",
49+
"invalid value $(enable_customizable_func) for enable_customizable_func which must be :FALSE, :ALL or :LAST",
5050
),
5151
)
5252
end
53-
if run_customisable_func_only && enable_customisable_func == :FALSE
53+
if run_customizable_func_only && enable_customizable_func == :FALSE
5454
throw(
5555
ArgumentError(
56-
"run_customisable_func_only is set to true, but enable_customisable_func is set to :FALSE",
56+
"run_customizable_func_only is set to true, but enable_customizable_func is set to :FALSE",
5757
),
5858
)
5959
end
@@ -67,9 +67,9 @@ mutable struct Parameters{A,B}
6767
gcsample,
6868
time_tolerance,
6969
memory_tolerance,
70-
run_customisable_func_only,
71-
enable_customisable_func,
72-
customisable_gcsample,
70+
run_customizable_func_only,
71+
enable_customizable_func,
72+
customizable_gcsample,
7373
setup_prehook,
7474
teardown_posthook,
7575
sample_result,
@@ -90,9 +90,9 @@ function Parameters(
9090
gcsample,
9191
time_tolerance,
9292
memory_tolerance,
93-
run_customisable_func_only,
94-
enable_customisable_func,
95-
customisable_gcsample,
93+
run_customizable_func_only,
94+
enable_customizable_func,
95+
customizable_gcsample,
9696
setup_prehook,
9797
teardown_posthook,
9898
sample_result,
@@ -109,9 +109,9 @@ function Parameters(
109109
gcsample,
110110
time_tolerance,
111111
memory_tolerance,
112-
run_customisable_func_only,
113-
enable_customisable_func,
114-
customisable_gcsample,
112+
run_customizable_func_only,
113+
enable_customizable_func,
114+
customizable_gcsample,
115115
setup_prehook,
116116
teardown_posthook,
117117
sample_result,
@@ -131,11 +131,11 @@ DEFAULT_PARAMETERS = Parameters(
131131
false,
132132
0.05,
133133
0.01,
134-
# Customisable Parameters
134+
# customizable Parameters
135135
false,
136136
:FALSE,
137137
false,
138-
# Customisable functions
138+
# customizable functions
139139
_nothing_func,
140140
_nothing_func,
141141
_nothing_func,
@@ -153,9 +153,9 @@ function Parameters(;
153153
gcsample=DEFAULT_PARAMETERS.gcsample,
154154
time_tolerance=DEFAULT_PARAMETERS.time_tolerance,
155155
memory_tolerance=DEFAULT_PARAMETERS.memory_tolerance,
156-
run_customisable_func_only=DEFAULT_PARAMETERS.run_customisable_func_only,
157-
enable_customisable_func=DEFAULT_PARAMETERS.enable_customisable_func,
158-
customisable_gcsample=DEFAULT_PARAMETERS.customisable_gcsample,
156+
run_customizable_func_only=DEFAULT_PARAMETERS.run_customizable_func_only,
157+
enable_customizable_func=DEFAULT_PARAMETERS.enable_customizable_func,
158+
customizable_gcsample=DEFAULT_PARAMETERS.customizable_gcsample,
159159
setup_prehook=DEFAULT_PARAMETERS.setup_prehook,
160160
teardown_posthook=DEFAULT_PARAMETERS.teardown_posthook,
161161
sample_result=DEFAULT_PARAMETERS.sample_result,
@@ -172,9 +172,9 @@ function Parameters(;
172172
gcsample,
173173
time_tolerance,
174174
memory_tolerance,
175-
run_customisable_func_only,
176-
enable_customisable_func,
177-
customisable_gcsample,
175+
run_customizable_func_only,
176+
enable_customizable_func,
177+
customizable_gcsample,
178178
setup_prehook,
179179
teardown_posthook,
180180
sample_result,
@@ -194,9 +194,9 @@ function Parameters(
194194
gcsample=nothing,
195195
time_tolerance=nothing,
196196
memory_tolerance=nothing,
197-
run_customisable_func_only=nothing,
198-
enable_customisable_func=nothing,
199-
customisable_gcsample=nothing,
197+
run_customizable_func_only=nothing,
198+
enable_customizable_func=nothing,
199+
customizable_gcsample=nothing,
200200
setup_prehook=nothing,
201201
teardown_posthook=nothing,
202202
sample_result=nothing,
@@ -214,20 +214,20 @@ function Parameters(
214214
time_tolerance != nothing ? time_tolerance : default.time_tolerance
215215
params_memory_tolerance =
216216
memory_tolerance != nothing ? memory_tolerance : default.memory_tolerance
217-
params_run_customisable_func_only = if run_customisable_func_only != nothing
218-
run_customisable_func_only
217+
params_run_customizable_func_only = if run_customizable_func_only != nothing
218+
run_customizable_func_only
219219
else
220-
default.run_customisable_func_only
220+
default.run_customizable_func_only
221221
end
222-
params_enable_customisable_func = if enable_customisable_func != nothing
223-
enable_customisable_func
222+
params_enable_customizable_func = if enable_customizable_func != nothing
223+
enable_customizable_func
224224
else
225-
default.enable_customisable_func
225+
default.enable_customizable_func
226226
end
227-
params_customisable_gcscrub = if customisable_gcsample != nothing
228-
customisable_gcsample
227+
params_customizable_gcscrub = if customizable_gcsample != nothing
228+
customizable_gcsample
229229
else
230-
default.customisable_gcsample
230+
default.customizable_gcsample
231231
end
232232
params_setup_prehook = if setup_prehook != nothing
233233
setup_prehook
@@ -256,9 +256,9 @@ function Parameters(
256256
params_gcsample,
257257
params_time_tolerance,
258258
params_memory_tolerance,
259-
params_run_customisable_func_only,
260-
params_enable_customisable_func,
261-
params_customisable_gcscrub,
259+
params_run_customizable_func_only,
260+
params_enable_customizable_func,
261+
params_customizable_gcscrub,
262262
params_setup_prehook,
263263
params_teardown_posthook,
264264
params_sample_result,
@@ -276,9 +276,9 @@ function Base.:(==)(a::Parameters, b::Parameters)
276276
a.gcsample == b.gcsample &&
277277
a.time_tolerance == b.time_tolerance &&
278278
a.memory_tolerance == b.memory_tolerance &&
279-
a.run_customisable_func_only == b.run_customisable_func_only &&
280-
a.enable_customisable_func == b.enable_customisable_func &&
281-
a.customisable_gcsample == b.customisable_gcsample &&
279+
a.run_customizable_func_only == b.run_customizable_func_only &&
280+
a.enable_customizable_func == b.enable_customizable_func &&
281+
a.customizable_gcsample == b.customizable_gcsample &&
282282
a.setup_prehook == b.setup_prehook &&
283283
a.teardown_posthook == b.teardown_posthook &&
284284
a.sample_result == b.sample_result &&
@@ -297,9 +297,9 @@ function Base.copy(p::Parameters)
297297
p.gcsample,
298298
p.time_tolerance,
299299
p.memory_tolerance,
300-
p.run_customisable_func_only,
301-
p.enable_customisable_func,
302-
p.customisable_gcsample,
300+
p.run_customizable_func_only,
301+
p.enable_customizable_func,
302+
p.customizable_gcsample,
303303
p.setup_prehook,
304304
p.teardown_posthook,
305305
p.sample_result,

src/serialization.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const SUPPORTED_TYPES = Dict{Symbol,Type}(
1616
)
1717
# n.b. Benchmark type not included here, since it is gensym'd
1818

19-
customisable_result_recover(::Nothing) = nothing
19+
customizable_result_recover(::Nothing) = nothing
2020

2121
function JSON.lower(x::Union{values(SUPPORTED_TYPES)...})
2222
d = Dict{String,Any}()
@@ -53,8 +53,8 @@ function recover(x::Vector)
5353
for i in 1:fc
5454
ft = fieldtype(T, i)
5555
fn = String(fieldname(T, i))
56-
xsi = if fn == "customisable_result"
57-
customisable_result_recover(fields[fn])
56+
xsi = if fn == "customizable_result"
57+
customizable_result_recover(fields[fn])
5858
elseif ft <: get(SUPPORTED_TYPES, nameof(ft), Union{})
5959
recover(fields[fn])
6060
elseif fn in (
@@ -68,13 +68,13 @@ function recover(x::Vector)
6868
# JSON spec doesn't support Inf
6969
# These fields should all be >= 0, so we can ignore -Inf case
7070
typemax(ft)
71-
elseif fn == "enable_customisable_func"
71+
elseif fn == "enable_customizable_func"
7272
if !haskey(fields, fn)
7373
:FALSE
7474
else
7575
Symbol(fields[fn])
7676
end
77-
elseif fn in ("run_customisable_func_only", "customisable_gcsample") &&
77+
elseif fn in ("run_customizable_func_only", "customizable_gcsample") &&
7878
!haskey(fields, fn)
7979
getfield(BenchmarkTools.DEFAULT_PARAMETERS, Symbol(fn))
8080
else

0 commit comments

Comments
 (0)