Branch: Tag:

2015-03-04

2015-03-04 13:54:17 by Per Hedbor <ph@opera.com>

encode_value: Slightly faster encode of large integers.

Also, do not remember items with only 1 reference, they are rather
unlikely to show up again later on (objects notwithstanding, and they
are handled in another case).

This saves a lot of CPU time when a large array of fairly unique
strings are encoded.

516:    fprintf(stderr,"TAG%d", TYPEOF(*val));    }else{    print_svalue(stderr, val); -  +     }    fputc('\n', stderr););    code_entry (TAG_DELAYED, entry_id.u.integer, data);
544:    print_svalue(stderr, val);    }    fputc('\n', stderr);); +  if( TYPEOF(*val) < MIN_REF_TYPE || val->u.dummy->refs > 1 )    mapping_insert(data->encoded, val, &entry_id);    data->counter.u.integer++;    }