sgxs: reduce build time: less time features, no thiserror#910
Open
phlip9 wants to merge 2 commits intofortanix:masterfrom
Open
sgxs: reduce build time: less time features, no thiserror#910phlip9 wants to merge 2 commits intofortanix:masterfrom
time features, no thiserror#910phlip9 wants to merge 2 commits intofortanix:masterfrom
Conversation
Taowyoo
reviewed
Mar 18, 2026
Before:
```bash
$ cargo tree -p sgxs
sgxs v0.8.1 (/home/phlip9/dev/rust-sgx/intel-sgx/sgxs)
├── anyhow v1.0.100
├── byteorder v1.5.0
├── sgx-isa v0.4.1 (/home/phlip9/dev/rust-sgx/intel-sgx/sgx-isa)
│ └── bitflags v1.2.1
├── thiserror v1.0.59
│ └── thiserror-impl v1.0.59 (proc-macro)
│ ├── proc-macro2 v1.0.95
│ │ └── unicode-ident v1.0.12
│ ├── quote v1.0.41
│ │ └── proc-macro2 v1.0.95 (*)
│ └── syn v2.0.115
│ ├── proc-macro2 v1.0.95 (*)
│ ├── quote v1.0.41 (*)
│ └── unicode-ident v1.0.12
└── time v0.3.41
├── deranged v0.4.0
│ └── powerfmt v0.2.0
├── itoa v1.0.1
├── libc v0.2.180
├── num-conv v0.1.0
├── num_threads v0.1.6
├── powerfmt v0.2.0
├── time-core v0.1.4
└── time-macros v0.2.22 (proc-macro)
├── num-conv v0.1.0
└── time-core v0.1.4
$ taskset -c 3 cargo build --target-dir /tmp/cargo-target-1 -p sgxs --lib
Finished `dev` profile [unoptimized + debuginfo] target(s) in 5.36s
```
After:
```bash
$ cargo tree -p sgxs
sgxs v0.8.1 (/home/phlip9/dev/rust-sgx/intel-sgx/sgxs)
├── anyhow v1.0.100
├── byteorder v1.5.0
├── sgx-isa v0.4.1 (/home/phlip9/dev/rust-sgx/intel-sgx/sgx-isa)
│ └── bitflags v1.2.1
└── time v0.3.41
├── deranged v0.4.0
│ └── powerfmt v0.2.0
├── num-conv v0.1.0
├── powerfmt v0.2.0
└── time-core v0.1.4
$ taskset -c 3 cargo build --target-dir /tmp/cargo-target-2 -p sgxs --lib
Finished `dev` profile [unoptimized + debuginfo] target(s) in 1.57s
```
fb80800 to
c5066bd
Compare
Contributor
Author
|
gentle ping @Taowyoo, is there anything else you'd like to see in this diff? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hey all,
I noticed the
sgxscrate is on the critical path in one of ourbuild.rsscripts in CI, and so I took a pass at improving that. After some slight refactoring to removethiserrorandtimecrate's proc-macro usage, the build time for justsgxsis down ~3.4x, without many downsides:Before:
After: