Skip to content

Commit c614586

Browse files
authored
Merge pull request #32 from rustbox/draw_perf
Draw perf
2 parents fb0edef + 58bfa36 commit c614586

26 files changed

+1102
-290
lines changed

Cargo.lock

Lines changed: 74 additions & 39 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ path = "src/bin/keypad.rs"
2828

2929
[profile.release]
3030
opt-level = 2
31+
lto = true
3132

3233
[profile.dev]
3334
debug = true # Symbols are nice and they don't increase the size on Flash
@@ -40,13 +41,13 @@ critical-section = "1.1.1"
4041
embedded-graphics = "0.7.1"
4142
embedded-hal = "0.2"
4243
esp-alloc = { version = "0.2.0", features = ["oom-handler"] }
43-
esp-backtrace = { version = "0.6.0", features = [
44+
esp-backtrace = { version = "0.7.0", features = [
4445
"esp32c3",
4546
"panic-handler",
4647
"exception-handler",
4748
"print-jtag-serial",
4849
] }
49-
esp-println = { version = "0.4.0", default-features = false, features = [
50+
esp-println = { version = "0.5.0", default-features = false, features = [
5051
"esp32c3",
5152
"jtag_serial",
5253
] }
@@ -63,8 +64,11 @@ unroll = "0.1.5"
6364

6465
[dev-dependencies]
6566

67+
[features]
68+
default = ["perf_log"]
69+
perf_log = []
6670

6771
[patch.crates-io]
6872
# TODO: automate these updates
69-
esp32c3-hal = { git = "https://github.com/rustbox/esp-hal", rev = "72aefcc" }
70-
esp-hal-common = { git = "https://github.com/rustbox/esp-hal", rev = "72aefcc" }
73+
esp32c3-hal = { git = "https://github.com/rustbox/esp-hal", rev = "f49dc55" }
74+
esp-hal-common = { git = "https://github.com/rustbox/esp-hal", rev = "f49dc55" }

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ This is targeted at the RISC-V architecture esp32-c3 processor from espressif. T
1313

1414
`rustup target add riscv32imc-unknown-none-elf`
1515

16-
3. Using Cargo, install the `espflash` tool which can upload and flash the code across a serial
16+
3. Using Cargo, install the `espflash` tool which can upload and flash the code across a serial
1717
port (through usb) to the esp32 chip:
1818

1919
`cargo install espflash`

draw_perf.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# Original
2+
3+
Hash `3ec5c707513c4b6a533ae8099fe242e81975947e`
4+
===============================================
5+
6+
```
7+
528 bytes
8+
169776.02 draw cycles per byte
9+
558 bytes
10+
193957.2 draw cycles per byte
11+
558 bytes
12+
199648.33 draw cycles per byte
13+
558 bytes
14+
204402.34 draw cycles per byte
15+
630 bytes
16+
167890.98 draw cycles per byte
17+
558 bytes
18+
223444.6 draw cycles per byte
19+
558 bytes
20+
219381.02 draw cycles per byte
21+
558 bytes
22+
200000.14 draw cycles per byte
23+
```
24+
25+
* Average bytes: `563`
26+
* Average cycles: `197312.6`
27+
28+
# Directly set video memory
29+
30+
Hash: `f2627740c2a6f1ed37715a0d487b7f4987971bb9`
31+
========================================
32+
33+
```
34+
698 bytes
35+
144043.72 draw cycles per byte
36+
698 bytes
37+
141167.67 draw cycles per byte
38+
700 bytes
39+
140613.3 draw cycles per byte
40+
698 bytes
41+
150651.81 draw cycles per byte
42+
698 bytes
43+
138351.31 draw cycles per byte
44+
698 bytes
45+
142081.36 draw cycles per byte
46+
```
47+
48+
* Average bytes: `698`
49+
* Average cycles: `142818.195`
50+
* Improvement: `24%`
51+
52+
# Draw with `fill_contiguous`, buffer drawing characters, text carries dirty state
53+
54+
Hash: `304c52f8662db2f1363da8a9c36d6136a42d6236`
55+
============================================
56+
57+
```
58+
1562 bytes
59+
12544.181 draw cycles per byte
60+
2512 bytes
61+
22627.264 draw cycles per byte
62+
```
63+
64+
* Average bytes: `2037`
65+
* Average cycles: `17585.7`
66+
* Improvement: `3.6x`
67+

0 commit comments

Comments
 (0)