diff options
author | Karl Williamson <public@khwilliamson.com> | 2012-08-25 11:42:55 -0600 |
---|---|---|
committer | Karl Williamson <public@khwilliamson.com> | 2012-08-25 23:21:29 -0600 |
commit | 5c9f4bd2be62c07fee7298eec0ab8253d15b297a (patch) | |
tree | 17bd40e11b720dda50c790fc85e18260b8220645 /utf8.c | |
parent | 5d3d13d10da5429b4c98a44ea398eb3cfb8c457b (diff) | |
download | perl-5c9f4bd2be62c07fee7298eec0ab8253d15b297a.tar.gz |
utf8.c: Shorten hash key for speed
Experiments have shown that longer hash keys impact performance. See
the thread at
http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2012-08/msg00869.html
This patch shortens a key used very frequently. There are other keys in
this hash which are used frequently in some circumstances, but I expect
to change to use fewer in the future, so am not changing them now
Diffstat (limited to 'utf8.c')
-rw-r--r-- | utf8.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -3067,7 +3067,7 @@ Perl__core_swash_init(pTHX_ const char* pkg, const char* name, SV *listsv, I32 m * inversion list, or create one for it */ if (swash_hv) { - swash_invlistsvp = hv_fetchs(swash_hv, "I", FALSE); + swash_invlistsvp = hv_fetchs(swash_hv, "V", FALSE); if (swash_invlistsvp) { swash_invlist = *swash_invlistsvp; invlist_in_swash_is_valid = TRUE; @@ -3103,7 +3103,7 @@ Perl__core_swash_init(pTHX_ const char* pkg, const char* name, SV *listsv, I32 m * be that there was an inversion list in the swash which didn't get * touched; otherwise save the one computed one */ if (! invlist_in_swash_is_valid) { - if (! hv_stores(MUTABLE_HV(SvRV(retval)), "INVLIST", swash_invlist)) + if (! hv_stores(MUTABLE_HV(SvRV(retval)), "V", swash_invlist)) { Perl_croak(aTHX_ "panic: hv_store() unexpectedly failed"); } @@ -3405,7 +3405,7 @@ S_swatch_get(pTHX_ SV* swash, UV start, UV span) U8 *l, *lend, *x, *xend, *s, *send; STRLEN lcur, xcur, scur; HV *const hv = MUTABLE_HV(SvRV(swash)); - SV** const invlistsvp = hv_fetchs(hv, "INVLIST", FALSE); + SV** const invlistsvp = hv_fetchs(hv, "V", FALSE); SV** listsvp = NULL; /* The string containing the main body of the table */ SV** extssvp = NULL; @@ -4150,7 +4150,7 @@ Perl__get_swash_invlist(pTHX_ SV* const swash) return NULL; } - ptr = hv_fetchs(MUTABLE_HV(SvRV(swash)), "INVLIST", FALSE); + ptr = hv_fetchs(MUTABLE_HV(SvRV(swash)), "V", FALSE); if (! ptr) { return NULL; |