From: Tim Bunce Date: Thu, 21 Mar 2002 21:18:05 +0000 (+0000) Subject: Storable is inefficient retreiving large hashes [PATCH] X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=43b8d2c4a24ef5dc0847963fabc750555891c742;p=p5sagit%2Fp5-mst-13.2.git Storable is inefficient retreiving large hashes [PATCH] Message-ID: <20020321211805.E25276@dansat.data-plan.com> p4raw-id: //depot/perl@15402 --- diff --git a/ext/Storable/Storable.xs b/ext/Storable/Storable.xs index 6e1dec9..847ec1f 100644 --- a/ext/Storable/Storable.xs +++ b/ext/Storable/Storable.xs @@ -4223,6 +4223,7 @@ static SV *retrieve_hash(stcxt_t *cxt, char *cname) SEEN(hv, cname); /* Will return if table not allocated properly */ if (len == 0) return (SV *) hv; /* No data follow if table empty */ + hv_ksplit(hv, len); /* pre-extend hash to save multiple splits */ /* * Now get each key/value pair in turn... @@ -4357,6 +4358,7 @@ static SV *old_retrieve_hash(stcxt_t *cxt, char *cname) SEEN(hv, 0); /* Will return if table not allocated properly */ if (len == 0) return (SV *) hv; /* No data follow if table empty */ + hv_ksplit(hv, len); /* pre-extend hash to save multiple splits */ /* * Now get each key/value pair in turn...