Re: Encode UTF-8 optimizations

2016-08-22 Thread pali
On Sunday 21 August 2016 08:49:08 Karl Williamson wrote: > On 08/21/2016 02:34 AM, p...@cpan.org wrote: > >On Sunday 21 August 2016 03:10:40 Karl Williamson wrote: > >>Top posting. > >> > >>Attached is my alternative patch. It effectively uses a different > >>algorithm to avoid decoding the input

Re: Encode utf8 warnings

2016-08-22 Thread pali
On Saturday 13 August 2016 19:41:46 p...@cpan.org wrote: > Hello, I see that there is one big mess in utf8 warnings for Encode. Per request this discussion was moved to perl5-port...@perl.org ML: http://www.nntp.perl.org/group/perl.perl5.porters/2016/08/msg239061.html

Re: Encode UTF-8 optimizations

2016-08-22 Thread Karl Williamson
On 08/22/2016 07:05 AM, p...@cpan.org wrote: On Sunday 21 August 2016 08:49:08 Karl Williamson wrote: On 08/21/2016 02:34 AM, p...@cpan.org wrote: On Sunday 21 August 2016 03:10:40 Karl Williamson wrote: Top posting. Attached is my alternative patch. It effectively uses a different algorithm

Re: Encode UTF-8 optimizations

2016-08-22 Thread pali
On Monday 22 August 2016 21:43:59 Karl Williamson wrote: > On 08/22/2016 07:05 AM, p...@cpan.org wrote: > > On Sunday 21 August 2016 08:49:08 Karl Williamson wrote: > >> On 08/21/2016 02:34 AM, p...@cpan.org wrote: > >>> On Sunday 21 August 2016 03:10:40 Karl Williamson wrote: > Top posting. >

Re: Encode UTF-8 optimizations

2016-08-22 Thread Karl Williamson
On 08/22/2016 02:47 PM, p...@cpan.org wrote: > And I think you misunderstand when is_utf8_char_slow() is called. It is > called only when the next byte in the input indicates that the only > legal UTF-8 that might follow would be for a code point that is at least > U+20, almost twice as high

Re: Encode UTF-8 optimizations

2016-08-22 Thread Karl Williamson
On 08/22/2016 03:19 PM, Karl Williamson wrote: On 08/22/2016 02:47 PM, p...@cpan.org wrote: > And I think you misunderstand when is_utf8_char_slow() is called. It is > called only when the next byte in the input indicates that the only > legal UTF-8 that might follow would be for a code point th

Re: Encode UTF-8 optimizations

2016-08-22 Thread pali
(this only applies for strict UTF-8) On Monday 22 August 2016 23:19:51 Karl Williamson wrote: > The code could be tweaked to call UTF8_IS_SUPER first, but I'm > asserting that an optimizing compiler will see that any call to > is_utf8_char_slow() is pointless, and will optimize it out. Such optim

Re: Encode UTF-8 optimizations

2016-08-22 Thread pali
On Monday 22 August 2016 23:38:05 Karl Williamson wrote: > And, I'd rather not tweak it to call UTF8_IS_SUPER first, > because that relies on knowing what the current internal > implementation is. Then maybe add new macro isUTF8_CHAR_STRICT which only check if character is strictly valid UTF-8? I