Skip to content

Commit a8c9270

Browse files
committed
Skip validity and length calls when the byte cannot be part of a multibyte sequence
Almost every character set can be given a number N such that a multibyte sequence starts with a byte higher than that number N. This allows us to skip a lot of work. To ensure the correctness of this, a sanity check is implemented that exhaustively tries every 4-byte sequence for every character set and checks for consistency issues. This finally gives: Time (mean ± σ): 120.2 ms ± 1.2 ms [User: 116.9 ms, System: 2.8 ms] Range (min … max): 118.0 ms … 122.9 ms 24 runs
1 parent 1571eed commit a8c9270

File tree

4 files changed

+326
-253
lines changed

4 files changed

+326
-253
lines changed

ext/mysqlnd/mysqlnd.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@
4545
#define MYSQLND_DBG_ENABLED 0
4646
#endif
4747

48+
#define MYSQLND_CHARSETS_SANITY_CHECK 0
49+
4850
#ifdef ZTS
4951
#include "TSRM.h"
5052
#endif

0 commit comments

Comments
 (0)