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
f220ddc6
Verified
Commit
f220ddc6
authored
2 years ago
by
João Magalhães
Browse files
Options
Downloads
Patches
Plain Diff
feat: improved num cpus in compilation
parent
ce05bfc6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#2201
failed
2 years ago
Stage: build
Stage: test
Stage: deploy
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Cargo.toml
+0
-1
0 additions, 1 deletion
Cargo.toml
build.rs
+6
-3
6 additions, 3 deletions
build.rs
src/gen/mock.rs
+1
-2
1 addition, 2 deletions
src/gen/mock.rs
with
7 additions
and
6 deletions
Cargo.toml
+
0
−
1
View file @
f220ddc6
...
@@ -23,7 +23,6 @@ wasm-bindgen = { version = "0.2", optional = true }
...
@@ -23,7 +23,6 @@ wasm-bindgen = { version = "0.2", optional = true }
[build-dependencies]
[build-dependencies]
chrono
=
"0.4"
chrono
=
"0.4"
num_cpus
=
"1"
regex
=
"1"
regex
=
"1"
[profile.release]
[profile.release]
...
...
This diff is collapsed.
Click to expand it.
build.rs
+
6
−
3
View file @
f220ddc6
...
@@ -29,7 +29,7 @@ use std::fs::{File, OpenOptions};
...
@@ -29,7 +29,7 @@ use std::fs::{File, OpenOptions};
use
std
::
io
::
Write
;
use
std
::
io
::
Write
;
use
std
::
path
::
Path
;
use
std
::
path
::
Path
;
use
std
::
process
::
Command
;
use
std
::
process
::
Command
;
use
std
::{
env
,
str
};
use
std
::{
env
,
str
,
thread
};
const
BUILD_OUT_FILE
:
&
str
=
"build.rs"
;
const
BUILD_OUT_FILE
:
&
str
=
"build.rs"
;
const
SOURCE_DIR
:
&
str
=
"./src/gen"
;
const
SOURCE_DIR
:
&
str
=
"./src/gen"
;
...
@@ -147,8 +147,11 @@ fn main() {
...
@@ -147,8 +147,11 @@ fn main() {
&
(
std
::
mem
::
size_of
::
<
usize
>
()
*
8
)
.to_string
(),
&
(
std
::
mem
::
size_of
::
<
usize
>
()
*
8
)
.to_string
(),
);
);
write_constant
(
&
mut
file
,
"DEFAULT_THREAD_POOL_SIZE"
,
num_cpus
::
get
());
write_constant
(
write_constant
(
&
mut
file
,
"MAX_THREAD_POOL_SIZE"
,
num_cpus
::
get
()
*
10
);
&
mut
file
,
"NUM_CPUS"
,
thread
::
available_parallelism
()
.unwrap
()
.get
(),
);
}
}
fn
write_constant
<
T
>
(
file
:
&
mut
File
,
key
:
&
str
,
val
:
T
)
fn
write_constant
<
T
>
(
file
:
&
mut
File
,
key
:
&
str
,
val
:
T
)
...
...
This diff is collapsed.
Click to expand it.
src/gen/mock.rs
+
1
−
2
View file @
f220ddc6
...
@@ -13,5 +13,4 @@ pub const OPT_LEVEL: &str = "-";
...
@@ -13,5 +13,4 @@ pub const OPT_LEVEL: &str = "-";
pub
const
MAKEFLAGS
:
&
str
=
"-"
;
pub
const
MAKEFLAGS
:
&
str
=
"-"
;
pub
const
FEATURES
:
[
&
str
;
1
]
=
[
"cpu"
];
pub
const
FEATURES
:
[
&
str
;
1
]
=
[
"cpu"
];
pub
const
PLATFORM_CPU_BITS
:
&
str
=
"64"
;
pub
const
PLATFORM_CPU_BITS
:
&
str
=
"64"
;
pub
const
DEFAULT_THREAD_POOL_SIZE
:
usize
=
1
;
pub
const
NUM_CPUS
:
usize
=
1
;
pub
const
MAX_THREAD_POOL_SIZE
:
usize
=
1
;
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