Branch: Tag:


2010-07-11 12:39:11 by 0

Optimize recursive copying of arrays, multisets and mappings. We delay the
allocation of the lookup mapping used to quickly process duplicate entries
until we find that the source contains a container with complex data
inside. Another improvement is to not place basic types in the mapping
since they will be copied the same way regardless. Finally, the old code
added complex entries to the lookup mapping twice (both in svalue.c and in
the respective type handler) which was redundant.

Rev: src/array.c:1.229
Rev: src/mapping.c:1.217
Rev: src/multiset.c:1.120
Rev: src/svalue.c:1.261

2:   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: mapping.c,v 1.216 2010/05/31 10:18:26 mast Exp $ + || $Id: mapping.c,v 1.217 2010/07/11 12:39:11 jonasw Exp $   */      #include "global.h"
2153:       ret=allocate_mapping(MAP_SLOTS(m->data->size));    +  if (p) {    aa.type = T_MAPPING;    aa.subtype = 0;    aa.u.mapping = m;
2160:    bb.subtype = 0;    bb.u.mapping = ret;    mapping_insert(p, &aa, &bb); +  }       ret->data->flags = m->data->flags;