[Zlib-devel] [PING] Improve longest_match performance

Jan Seiffert kaffeemonster at googlemail.com
Tue Jul 24 18:37:08 EDT 2012


John Reiser schrieb:
> On 07/24/2012, Andreas Krebbel wrote:
> 
>> any comments regarding this one?
>>
>> http://mail.madler.net/pipermail/zlib-devel_madler.net/2012-June/002907.html
> 
> These changes in the width of variables which contribute to indexing
> of arrays:
> -----
> +    uLong cur_match = pcur_match; /* extend to pointer width */
> 
> +    uLong wmask = s->w_mask;
> -----
> should use 'ptrdiff_t' instead.  It ought to take only a minor increase
> in intelligence for the compiler to do such a widening automatically,
> because all uses are associated with array indexing, and a machine with
> 64-bit addresses often charges a high price for indexing by a 32-bit quantity.
> 

But it can also be the other way round, that was the reason for his regression
on Core2.
And he wants an unsigned type (there is no negative indexing going on), because
the sign extension is killing s/390. ptrdiff_t is a signed type.

as already mentioned in and ff:
http://mail.madler.net/pipermail/zlib-devel_madler.net/2012-July/002931.html

He propably wants to create a new type, some kind of uIdx.
This type should default to unsigned int.
Maybe force it to a specific type for say __x86_64__ (unsigned int)
If there is a stdint.h and it has a uint16_fastest_t, use that for uIdx.

use uIdx for the vars above.

Greetings
	Jan

-- 
Carpe the heck out of the diem




More information about the Zlib-devel mailing list