Open WhiteBlackGoose opened 2 years ago
Initial results:
Method | Mean | Error | StdDev |
---|---|---|---|
Parse | 49.920 us | 1.1544 us | 3.2936 us |
Lex | 3.713 us | 0.0708 us | 0.1494 us |
Replaced ParseError
's binary OR with return first
:
Method | Mean | Error | StdDev |
---|---|---|---|
Parse | 15.655 us | 0.3817 us | 1.0641 us |
Lex | 2.825 us | 0.0562 us | 0.0998 us |
Removed creating a dictionary on ParseError | Method | Mean | Error | StdDev |
---|---|---|---|---|
Parse | 7.425 us | 0.1222 us | 0.1143 us | |
Lex | 2.752 us | 0.0516 us | 0.0552 us |
Warning: this is wrong result, because it dysfunctions
Replaced `public static ParseResult |
(ParseResultwith return first.IsOk ? first.Ok : first.Error;` |
Method | Mean | Error | StdDev |
---|---|---|---|---|---|
Parse | 919.3 ns | 18.34 ns | 25.71 ns | ||
Lex | 3,779.2 ns | 73.81 ns | 121.27 ns |
But it looks wrong, so gotta make it functionally correct
For AngouriMath these optimizations have these impacts
Method | Mean | Error | StdDev | Median |
---|---|---|---|---|
ParseEasy OOB | 11.61 ms | 0.440 ms | 1.298 ms | 11.10 ms |
ParseEasy Optim | 1.143 ms | 0.0510 ms | 0.1371 ms | 1.131 ms |
ParseEasy Antlr | 0.039 ms | |||
ParseHard OOB | 155.05 ms | 9.570 ms | 28.217 ms | 146.27 ms |
ParseHard Optim | 69.306 ms | 2.8647 ms | 7.8420 ms | 66.660 ms |
ParseHard Antlr | 4.4 ms |
Warning: no merge! The Result type is intentionally broken!
@WhiteBlackGoose i'm new maintainer of the Yoakke, so if you still (after such long time) want to continue exploration of Yoakke performance, I'm here for you.
Problem
Yoakke, unfortunately, turns out to have significant performance issues (compared to Antlr, for example). They are:
ParseResult
and related types. Making it efficient may boost it to 10x, but it's still not enoughHowever, the parsing and lexing algos look to be fine. At least, I didn't get past 2., so cannot say for sure.