In perl.git, the branch smoke-me/khw-variant has been created
<https://perl5.git.perl.org/perl.git/commitdiff/cffa870df69673be832454f1fe2fb5123c46689a?hp=0000000000000000000000000000000000000000>
at cffa870df69673be832454f1fe2fb5123c46689a (commit)
- Log -----------------------------------------------------------------
commit cffa870df69673be832454f1fe2fb5123c46689a
Author: Karl Williamson <[email protected]>
Date: Thu Jan 25 10:25:27 2018 -0700
PATCH: [perl #132766] Fix VC6 builds
The suffix ULL in, e.g., 7ULL, is not accepted by VC6. Instead wrap
those that would exceed 32 bits within UINTMAX_C(...) which should work.
perl.h has logic to define that macro appropriately if the compiler
doesn't already know it.
commit 3b3c44f1ad6339d27f1f5f03627beaf7b0ad0f9f
Author: Karl Williamson <[email protected]>
Date: Tue Dec 26 18:25:26 2017 -0700
regexec.c: Replace loop by memchr()
This can be called on a potentially long string.
commit e6a6408de8401dec440eb485a074f7c1a1246587
Author: Karl Williamson <[email protected]>
Date: Fri Dec 29 15:45:38 2017 -0700
Use word-at-a-time to repeat /i single byte pattern
For most of the case folding pairs, like [Aa], it is possible to use a
mask to match them word-at-a-time in regrepeat(), so that long sequences
of them are handled with significantly better performance.
commit eabbdefe62f61ecd0c32de8e76f447546120f9e5
Author: Karl Williamson <[email protected]>
Date: Fri Dec 29 15:17:41 2017 -0700
regexec.c: Use word-at-a-time to repeat a single byte pattern
There is special code in the function regrepeat() to handle instances
where the pattern to repeat is a single byte. These all can be done
word-at-a-time to significantly increase the performance of long
repeats.
commit c64650304024f96b8eb2d77b139a1c5bb76dcb44
Author: Karl Williamson <[email protected]>
Date: Tue Dec 5 09:30:49 2017 -0700
maybe drop: avoid ifs
commit 5c381f24e6edd0271214f689d7c2c2aafccf8a65
Author: Karl Williamson <[email protected]>
Date: Thu Dec 7 22:11:03 2017 -0700
regcomp.c: Use some of the new typedefs
This just makes sure the concept works.
commit 9bec1920dac55fecdb3a59a252490bfe8999bd95
Author: Karl Williamson <[email protected]>
Date: Wed Dec 6 22:32:14 2017 -0700
toke.c: Use valid_utf8_length()
commit 423420d3598ffa768b37610130c12d43cc256705
Author: Karl Williamson <[email protected]>
Date: Wed Dec 6 22:29:36 2017 -0700
regexec.c: Use valid_utf8_length()
commit 9ce35b33257c087966fda500ac57b9bfded8e793
Author: Karl Williamson <[email protected]>
Date: Wed Dec 6 22:29:22 2017 -0700
regcomp.c: Use valid_utf8_length()
commit ab46c17f679943e05467c3662ca7440cb3b7e7e3
Author: Karl Williamson <[email protected]>
Date: Wed Dec 6 22:25:37 2017 -0700
ext/B: Use valid_utf8_length()
commit 660081247b70d0967e8838d2fc7de13b9047174e
Author: Karl Williamson <[email protected]>
Date: Wed Dec 6 22:24:19 2017 -0700
mg.c: Use valid_utf8_length()
commit ab683c9c83f4c4b0f7596af44caf6bb1d0e839ac
Author: Karl Williamson <[email protected]>
Date: Wed Dec 6 22:23:54 2017 -0700
mg.h: Use valid_utf8_length()
commit 2ae95971950a7c4837ea1d582f38d931403f20d7
Author: Karl Williamson <[email protected]>
Date: Wed Dec 6 22:21:41 2017 -0700
sv.h: Use valid_utf8_length()
commit c29ad8749e323a2bea21586672c1111b84cc9fd2
Author: Karl Williamson <[email protected]>
Date: Wed Dec 6 22:20:33 2017 -0700
pp_sys.c: Use valid_utf8_length()
commit 3b22043b1efd2a471da143ce605ebea19bcdf60b
Author: Karl Williamson <[email protected]>
Date: Wed Dec 6 22:19:36 2017 -0700
pp_pack.c: Use valid_utf8_length()
commit 2b4387772823dfe02e63ed3fdfb36e4554cda301
Author: Karl Williamson <[email protected]>
Date: Wed Dec 6 22:19:03 2017 -0700
sv.c: Use valid_utf8_length()
commit 4e063ebfe5a07c73e56542f83a2fdd0660bd37ff
Author: Karl Williamson <[email protected]>
Date: Wed Dec 6 22:18:14 2017 -0700
pp_split() Use valid_utf8_length()
commit 4d51deeb635d9aff590108e00f25b7cfff8006b1
Author: Karl Williamson <[email protected]>
Date: Mon Dec 4 18:27:17 2017 -0700
XXX need 32-bit results Add core function valid_utf8_length()
XXX maybe don't do on 32 bit machines
This function is like utf8_length() but assumes that the input is valid
UTF-8 and uses a different algorithm which does counting word-at-a-time,
very much like variant_under_utf8_count(), leading to significant
performance improvements, with longer strings getting more relative
improvement.
The performance improvement is highly data-dependent, and in fact is
worse than the current method for very large code points which require
more bytes to represent them than the platform's word length. This is
because the current algorithm skips all the continuation bytes, so it
may end up skipping more than a words-length, whereas the new algorithm
examines each word. But these code points are not legal Unicode, and
we should consider only legal Unicode when doing optimizations. And
legal Unicode has significant performance improvements.
XXX
having longer
On a 32-bit system, the number of failed branch predictions declines to
half as many, with everything else staying about equal.
32-bit UV's; string length 24 characters; 2 bytes per character
bytecount wordcount
--------- ---------
Ir 100.00 100.72
Dr 100.00 100.82
Dw 100.00 101.10
COND 100.00 100.00
IND 100.00 100.00
COND_m 100.00 200.00
IND_m 100.00 100.00
Ir_m1 100.00 100.00
Dr_m1 100.00 100.00
Dw_m1 100.00 100.00
Ir_mm 100.00 100.00
Dr_mm 100.00 100.00
Dw_mm 100.00 100.00
The results are similar for longer strings, and for code points
represented by different numbers of bytes.
The results on a 64-bit platform also have the branch prediction improve
by 200%, but at some short string lengths, the number of branches
worsens slightly:
64-bit UV's; string length 4 characters; 3 bytes per character
byteutf8_length wordutf8_length
--------------- ---------------
Ir 100.00 96.08
Dr 100.00 100.88
Dw 100.00 100.00
COND 100.00 97.24
IND 100.00 100.00
COND_m 100.00 200.00
IND_m 100.00 100.00
Ir_m1 100.00 100.00
Dr_m1 100.00 100.00
Dw_m1 100.00 100.00
Ir_mm 100.00 100.00
Dr_mm 100.00 100.00
Dw_mm 100.00 100.00
For longer strings things improve:
64-bit UV's; string length 24 characters; 2 bytes per character
byteutf8_length wordutf8_length
--------------- ---------------
Ir 100.00 103.97
Dr 100.00 112.35
Dw 100.00 100.00
COND 100.00 110.27
IND 100.00 100.00
COND_m 100.00 300.00
IND_m 100.00 100.00
Ir_m1 100.00 100.00
Dr_m1 100.00 100.00
Dw_m1 100.00 100.00
Ir_mm 100.00 100.00
Dr_mm 100.00 100.00
Dw_mm 100.00 100.00
64-bit UV's; string length 24 characters; 3 bytes per character
byteutf8_length wordutf8_length
--------------- ---------------
Ir 100.00 99.73
Dr 100.00 111.37
Dw 100.00 100.00
COND 100.00 108.05
IND 100.00 100.00
COND_m 100.00 150.00
IND_m 100.00 100.00
Ir_m1 100.00 100.00
Dr_m1 100.00 100.00
Dw_m1 100.00 100.00
Ir_mm 100.00 100.00
Dr_mm 100.00 100.00
Dw_mm 100.00 100.00
At very long strings
64-bit UV's; string length 10000000 characters; 2 bytes per character
byteutf8_length wordutf8_length
--------------- ---------------
Ir 100.00 160.00
Dr 100.00 799.91
Dw 100.00 100.00
COND 100.00 399.98
IND 100.00 100.00
COND_m 100.00 150.00
IND_m 100.00 100.00
Ir_m1 100.00 100.00
Dr_m1 100.00 100.00
Dw_m1 100.00 100.00
Ir_mm 100.00 100.00
Dr_mm 100.00 100.00
Dw_mm 100.00 100.00
Performance actually worsens on strings with code points that occupy 7
or 13 bytes per code point. These are not in common use, as the maximum
that Unicode recognizes occupies 4 bytes.
commit b9437ef3ad0bb26e0e6636a2d632ac1c53390363
Author: Karl Williamson <[email protected]>
Date: Tue Dec 5 13:53:15 2017 -0700
Debug for EBCDIC
commit 780fc20b8e5decae7c732005c5f8b1b992841bba
Author: Karl Williamson <[email protected]>
Date: Wed Nov 22 23:10:01 2017 -0700
S_multiconcat() Use faster variant counting
commit 75edfd5e6c25907145addb2d04f69a3f43189a20
Author: Karl Williamson <[email protected]>
Date: Wed Nov 22 23:12:37 2017 -0700
toke.c: lex_stuff_pvn() Use faster UTF-8 variant count
-----------------------------------------------------------------------
--
Perl5 Master Repository