Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c0e9e2f

Browse files
PedroRosalbaguiferpa
authored andcommitted
lint: md benchmarks file
1 parent 29286c7 commit c0e9e2f

1 file changed

Lines changed: 36 additions & 22 deletions

File tree

lexer/bench_manual_scanner.md

Lines changed: 36 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,36 @@
1-
goos: darwin
2-
goarch: arm64
3-
pkg: github.com/guiferpa/aurora/lexer
4-
cpu: Apple M3
5-
BenchmarkScanToken_Keyword-8 78417979 15.25 ns/op 0 B/op 0 allocs/op
6-
BenchmarkScanToken_Identifier-8 73019718 17.32 ns/op 0 B/op 0 allocs/op
7-
BenchmarkScanToken_Number-8 131816068 9.118 ns/op 0 B/op 0 allocs/op
8-
BenchmarkScanToken_HexNumber-8 100000000 10.64 ns/op 0 B/op 0 allocs/op
9-
BenchmarkScanToken_String-8 151201761 7.927 ns/op 0 B/op 0 allocs/op
10-
BenchmarkScanToken_SingleChar-8 192291577 7.268 ns/op 0 B/op 0 allocs/op
11-
BenchmarkScanToken_Comment-8 167061290 7.180 ns/op 0 B/op 0 allocs/op
12-
BenchmarkGetTokens_Simple-8 3057578 444.7 ns/op 1360 B/op 14 allocs/op
13-
BenchmarkGetTokens_Medium-8 1000000 1201 ns/op 3984 B/op 37 allocs/op
14-
BenchmarkGetTokens_Complex-8 349312 4002 ns/op 13488 B/op 102 allocs/op
15-
BenchmarkGetTokens_Hex-8 981447 1231 ns/op 3984 B/op 37 allocs/op
16-
BenchmarkGetTokens_Strings-8 1000000 1116 ns/op 3696 B/op 34 allocs/op
17-
BenchmarkGetTokens_ManyTokens-8 346030 3432 ns/op 13104 B/op 98 allocs/op
18-
BenchmarkGetFilledTokens_Complex-8 223297 5263 ns/op 15648 B/op 109 allocs/op
19-
BenchmarkIsIdentChar-8 145176751 8.246 ns/op 0 B/op 0 allocs/op
20-
BenchmarkKeywordsLookup-8 27211629 50.22 ns/op 0 B/op 0 allocs/op
21-
PASS
22-
ok github.com/guiferpa/aurora/lexer 25.273s
1+
# Benchmark Results: Manual Scanner
2+
3+
**Environment:**
4+
- OS: darwin
5+
- Arch: arm64
6+
- CPU: Apple M3
7+
8+
## Single Token Scanning
9+
10+
| Benchmark | ops | ns/op | B/op | allocs/op |
11+
|-----------|-----|-------|------|-----------|
12+
| Keyword | 78,417,979 | 15.25 | 0 | 0 |
13+
| Identifier | 73,019,718 | 17.32 | 0 | 0 |
14+
| Number | 131,816,068 | 9.12 | 0 | 0 |
15+
| HexNumber | 100,000,000 | 10.64 | 0 | 0 |
16+
| String | 151,201,761 | 7.93 | 0 | 0 |
17+
| SingleChar | 192,291,577 | 7.27 | 0 | 0 |
18+
| Comment | 167,061,290 | 7.18 | 0 | 0 |
19+
20+
## Full Tokenization
21+
22+
| Benchmark | ops | ns/op | B/op | allocs/op |
23+
|-----------|-----|-------|------|-----------|
24+
| Simple | 3,057,578 | 445 | 1,360 | 14 |
25+
| Medium | 1,000,000 | 1,201 | 3,984 | 37 |
26+
| Complex | 349,312 | 4,002 | 13,488 | 102 |
27+
| Hex | 981,447 | 1,231 | 3,984 | 37 |
28+
| Strings | 1,000,000 | 1,116 | 3,696 | 34 |
29+
| ManyTokens | 346,030 | 3,432 | 13,104 | 98 |
30+
31+
## Helper Functions
32+
33+
| Benchmark | ops | ns/op | B/op | allocs/op |
34+
|-----------|-----|-------|------|-----------|
35+
| IsIdentChar | 145,176,751 | 8.25 | 0 | 0 |
36+
| KeywordsLookup | 27,211,629 | 50.22 | 0 | 0 |

0 commit comments

Comments
 (0)