Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
boytacean
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
João Magalhães
boytacean
Commits
d8aa1203
Verified
Commit
d8aa1203
authored
1 year ago
by
João Magalhães
Browse files
Options
Downloads
Patches
Plain Diff
chore: better benchmark options
parent
1fd28828
No related branches found
No related tags found
1 merge request
!24
Performance optimisations
Pipeline
#2835
passed
1 year ago
Stage: build
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
frontends/sdl/src/main.rs
+16
-5
16 additions, 5 deletions
frontends/sdl/src/main.rs
with
16 additions
and
5 deletions
frontends/sdl/src/main.rs
+
16
−
5
View file @
d8aa1203
...
...
@@ -44,11 +44,11 @@ pub struct Benchmark {
}
impl
Benchmark
{
pub
fn
new
(
count
:
usize
,
c
pu_only
:
Option
<
bool
>
,
chunk_size
:
Option
<
usize
>
)
->
Self
{
pub
fn
new
(
count
:
usize
,
c
hunk_size
:
Option
<
usize
>
,
cpu_only
:
Option
<
bool
>
)
->
Self
{
Self
{
count
,
cpu_only
,
chunk_size
,
cpu_only
,
}
}
}
...
...
@@ -660,10 +660,17 @@ struct Args {
default_value_t
=
500000000
,
help
=
"The size of the benchmark in clock ticks"
)]
bench_count
:
usize
,
benchmark_count
:
usize
,
#[arg(
long,
default_value_t
=
1
,
help
=
"The size of the benchmark in chunks"
)]
benchmark_chunk
:
usize
,
#[arg(long,
default_value_t
=
false
,
help
=
"Run benchmark only for the CPU"
)]
cpu_only
:
bool
,
benchmark_cpu
:
bool
,
#[arg(
long,
...
...
@@ -736,7 +743,11 @@ fn main() {
// not and runs it accordingly, note that if running in headless
// mode the number of cycles to be run may be specified
if
args
.benchmark
{
emulator
.run_benchmark
(
&
Benchmark
::
new
(
args
.bench_count
,
Some
(
args
.cpu_only
),
None
));
emulator
.run_benchmark
(
&
Benchmark
::
new
(
args
.benchmark_count
,
Some
(
args
.benchmark_chunk
),
Some
(
args
.benchmark_cpu
),
));
}
else
if
args
.headless
{
emulator
.run_headless
(
if
args
.cycles
>
0
{
Some
(
args
.cycles
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment