surrealdb / surrealdb.net

SurrealDB SDK for .NET
https://surrealdb.com
Apache License 2.0
93 stars 18 forks source link

⚡️ replace Superpower parser by Pidgin #83

Closed Odonno closed 7 months ago

Odonno commented 8 months ago

Improve parsing performance by using Pidgin package instead of Superpower.

Performance benchmark on Duration parsing:

| Method     | Param          | Mean       | Error    | StdDev   | Gen0   | Allocated |
|----------- |--------------- |-----------:|---------:|---------:|-------:|----------:|
| Superpower | 0ns            |   479.2 ns |  2.27 ns |  2.01 ns | 0.0429 |     720 B |
| Pidgin     | 0ns            |   500.4 ns |  5.44 ns |  5.09 ns | 0.0191 |     320 B |
| Superpower | 5y4w3h115ms4ns | 3,405.1 ns | 12.95 ns | 11.48 ns | 0.1831 |    3072 B |
| Pidgin     | 5y4w3h115ms4ns | 2,645.1 ns | 52.15 ns | 48.78 ns | 0.0267 |     488 B |