Skip to content

Commit 18ad9cb

Browse files
committed
fix typos
1 parent 5ec1c95 commit 18ad9cb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

posts/counting-words-at-simd-speed.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ with open(sys.argv[1], "rb") as f:
4343
print(words)
4444
```
4545

46-
This program is horrendously slow. It takes 86.6 seconds on my Apple M1 Pro. Python code runs for every byte, incurring interpreter dispatch and object checks again and again.
46+
This program is horrendously slow. It takes 89.6 seconds on my Apple M1 Pro. Python code runs for every byte, incurring interpreter dispatch and object checks again and again.
4747

4848
## Using CPython efficiently (13.7 seconds)
4949

@@ -70,7 +70,7 @@ This version is ~6× faster than the initial Python version.
7070

7171
I think the above Python version is very close to the limit that we can get with straightforward Python (e.g. no NumPy, no threads).
7272

73-
By porting our first Python attempt to C, we're rewarded with a ~11× speedup.
73+
By porting our first Python attempt to C, we're rewarded with a ~74× speedup.
7474

7575
```c
7676
// 2_mvp.c
@@ -100,7 +100,7 @@ Why is it so much quicker? Before, `re.finditer(...)` was creating a Python `Mat
100100
101101
The regex engine was also doing extra work when it searched, matched, backtracked, and performed bookkeeping. Even though that's in C, it's still building Python objects for the iterator.
102102
103-
In comparison, this version's C loop is a single pass over bytes with two booleans (`prev_ws`, `cur_ws`) and a predictable branch. Compilers turn this into very tight code, i.e., no per-word allocations, and no callbacks into the interpreter.
103+
In comparison, this version's C loop is a single pass over bytes with two booleans (`prev_ws`, `cur_ws`) and a simple branch. Compilers turn this into very tight code, i.e., no per-word allocations, and no callbacks into the interpreter.
104104
105105
## Adding SIMD (249 milliseconds)
106106

0 commit comments

Comments
 (0)