Skip to content

Add branchless is_alnum borrowed from MSVC++'s std::regex' _Is_word#823

Merged
ras0219-msft merged 1 commit intomicrosoft:masterfrom
BillyONeal:dev/bion/isalnum_perf
Aug 1, 2018
Merged

Add branchless is_alnum borrowed from MSVC++'s std::regex' _Is_word#823
ras0219-msft merged 1 commit intomicrosoft:masterfrom
BillyONeal:dev/bion/isalnum_perf

Conversation

@BillyONeal
Copy link
Copy Markdown
Member

Should be about 5x faster.

The _Is_word change resulted in the following results in microbenchmarks; the previous is_alnum looks like branching_ranges.

.\word_character_test.exe
08/01/18 16:33:03
Running .\word_character_test.exe
Run on (12 X 2904 MHz CPU s)
CPU Caches:
  L1 Data 32K (x6)
  L1 Instruction 32K (x6)
  L2 Unified 262K (x6)
  L3 Unified 12582K (x1)
--------------------------------------------------------
Benchmark                 Time           CPU Iterations
--------------------------------------------------------
strchr_search    19426572900 ns 19421875000 ns          1
branching_ranges 7582129000 ns 7578125000 ns          1
branching_search 6592977800 ns 6593750000 ns          1
table_index      1091321300 ns 1078125000 ns          1

…should be about 5x faster.

The _Is_word change resulted in the following results in microbenchmarks; the previous is_alnum looks like branching_ranges.

.\word_character_test.exe
08/01/18 16:33:03
Running .\word_character_test.exe
Run on (12 X 2904 MHz CPU s)
CPU Caches:
  L1 Data 32K (x6)
  L1 Instruction 32K (x6)
  L2 Unified 262K (x6)
  L3 Unified 12582K (x1)
--------------------------------------------------------
Benchmark                 Time           CPU Iterations
--------------------------------------------------------
strchr_search    19426572900 ns 19421875000 ns          1
branching_ranges 7582129000 ns 7578125000 ns          1
branching_search 6592977800 ns 6593750000 ns          1
table_index      1091321300 ns 1078125000 ns          1
@ras0219-msft ras0219-msft merged commit c55ada9 into microsoft:master Aug 1, 2018
@BillyONeal BillyONeal deleted the dev/bion/isalnum_perf branch August 2, 2018 02:27
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