Skip to content

Conversation

Nick-Nuon
Copy link
Collaborator

@Nick-Nuon Nick-Nuon commented Oct 11, 2023

Just adding ASCII tests (the same as in the C++ version) and some unrolling.

I am planning to use this to tackle issue #1

These are the benchmarks:

// |                 Method |   N |       Mean |     Error |    StdDev |
// |----------------------- |---- |-----------:|----------:|----------:|
// |     FastUnicodeIsAscii | 100 | 1,601.3 ns |  31.62 ns |  31.05 ns |
// | StandardUnicodeIsAscii | 100 | 2,502.5 ns |  49.20 ns |  65.68 ns |
// |         RuntimeIsAscii | 100 | 2,478.5 ns |  30.08 ns |  26.66 ns |
// |     FastUnicodeIsAscii | 200 |   653.0 ns |   6.26 ns |   5.86 ns |
// | StandardUnicodeIsAscii | 200 | 5,282.7 ns | 102.28 ns | 105.03 ns |
// |         RuntimeIsAscii | 200 | 5,366.1 ns |  65.50 ns |  61.27 ns |
// |     FastUnicodeIsAscii | 500 | 1,305.4 ns |  11.85 ns |  11.09 ns |
// | StandardUnicodeIsAscii | 500 | 6,235.6 ns | 103.06 ns |  96.40 ns |
// |         RuntimeIsAscii | 500 | 6,389.6 ns | 103.20 ns |  96.53 ns |

For reference, this is par:

/* PAR:
|                 Method |   N |       Mean |    Error |   StdDev |
|----------------------- |---- |-----------:|---------:|---------:|
|     FastUnicodeIsAscii | 100 |   652.6 ns |  2.20 ns |  1.95 ns |
| StandardUnicodeIsAscii | 100 | 2,466.5 ns | 21.77 ns | 20.36 ns |
|         RuntimeIsAscii | 100 | 2,502.7 ns | 29.81 ns | 27.89 ns |
|     FastUnicodeIsAscii | 200 | 1,300.8 ns | 17.95 ns | 14.99 ns |
| StandardUnicodeIsAscii | 200 | 5,216.6 ns | 62.48 ns | 55.38 ns |
|         RuntimeIsAscii | 200 | 5,293.2 ns | 41.50 ns | 38.82 ns |
|     FastUnicodeIsAscii | 500 | 2,978.6 ns | 34.99 ns | 32.73 ns |
| StandardUnicodeIsAscii | 500 | 6,172.9 ns | 74.53 ns | 69.71 ns |
|         RuntimeIsAscii | 500 | 6,210.8 ns | 80.82 ns | 63.10 ns | */

@lemire lemire merged commit f844b88 into main Oct 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants