Skip to content

Commit 90a88bd

Browse files
committed
Fix a few typos in unsorted/speed-vs-size.md
1 parent 16817be commit 90a88bd

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/unsorted/speed-vs-size.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Optimizations: the speed size tradeoff
22

33
Everyone wants their program to be super fast and super small but it's usually
4-
not possible to have maximize both characteristics. This section discusses the
5-
different optimization levels that `rustc` provides and how the affect the
4+
not possible to have both characteristics. This section discusses the
5+
different optimization levels that `rustc` provides and how they affect the
66
execution time and binary size of a program.
77

88
## No optimizations
@@ -25,15 +25,15 @@ debug = true
2525

2626
No optimizations is great for debugging because stepping through the code feels
2727
like you are executing the program statement by statement, plus you can `print`
28-
stack variables and function arguments in GDB. When the code is optimized trying
28+
stack variables and function arguments in GDB. When the code is optimized, trying
2929
to print variables results in `$0 = <value optimized out>` being printed.
3030

3131
The biggest downside of the `dev` profile is that the resulting binary will be
3232
huge and slow. The size is usually more of a problem because unoptimized
3333
binaries can occupy dozens of KiB of Flash, which your target device may not
3434
have -- the result: your unoptimized binary doesn't fit in your device!
3535

36-
Can we have smaller debugger friendly binaries? Yes, there's a trick.
36+
Can we have smaller, debugger friendly binaries? Yes, there's a trick.
3737

3838
### Optimizing dependencies
3939

@@ -117,7 +117,7 @@ profile which defaults to `opt-level = 3`.
117117

118118
Both `opt-level = 2` and `3` optimize for speed at the expense of binary size,
119119
but level `3` does more vectorization and inlining than level `2`. In
120-
particular, you'll see that at `opt-level` equal or greater than `2` LLVM will
120+
particular, you'll see that at `opt-level` equal to or greater than `2` LLVM will
121121
unroll loops. Loop unrolling has a rather high cost in terms of Flash / ROM
122122
(e.g. from 26 bytes to 194 for a zero this array loop) but can also halve the
123123
execution time given the right conditions (e.g. number of iterations is big

0 commit comments

Comments
 (0)