* include/hbserial.ch
* src/rtl/itemseri.c
+ added HB_SERIALIZE_IGNOREREF flag.
This flag fully disables logic used to detect multireferences to the
same complex (sub)items like arrays or hashes. It increses the speed
of serialization but serialized data does not contain any information
about refences, i.e. aVal[ 1 ] and aVal[ 2 ] in code below:
aSub := { 1, 2, 3 }
aVal := { aSub, aSub }
are serialized as separated arrays. Additionally items with cyclic
references like:
aSub[ 2 ] := aSub
cannot be serialized at all with HB_SERIALIZE_IGNOREREF flag because
it will create infinite serialization loop and crash with out of
memory message.
* src/rtl/itemseri.c
% rewritten algorithm used to detect cyclic and multi references in
serialized items. The original algorithm has very high overhead when
huge arrays were serialized, i.e. serialization of array with 1'000'000
of subarrays needed about 30 minutes on my i5@3.30GHz. Now it needs
less then a second and this time is only a little bit bigger then
used by serialization with HB_SERIALIZE_IGNOREREF flag.
This modification improve performance also in other code using Harbour
serialization mechanism like I18N files, HBNETIO, GTNET, ... when large
arrays or hashes are saved or transmitted.
* include/hbapi.h
* include/hbapicls.h
* src/vm/arrays.c
* src/vm/classes.c
* src/vm/hashes.c
* src/vm/itemapi.c
* replaced algorithm used to detect cyclic and multi references in
array and hash clone operations with new one similar to current
item serial code. The speed improvement for very large arrays is
the same as in case of serialization code.
* src/rtl/gtsln/mousesln.c
! typo in while loop - synced with Viktor's branch
60 lines
2.5 KiB
Plaintext
60 lines
2.5 KiB
Plaintext
/*
|
|
* Harbour Project source code:
|
|
* header file for item serialization flags
|
|
*
|
|
* Copyright 2013 Przemyslaw Czerpak <druzus / at / priv.onet.pl>
|
|
* www - http://harbour-project.org
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation; either version 2, or (at your option)
|
|
* any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this software; see the file COPYING.txt. If not, write to
|
|
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
|
* Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/).
|
|
*
|
|
* As a special exception, the Harbour Project gives permission for
|
|
* additional uses of the text contained in its release of Harbour.
|
|
*
|
|
* The exception is that, if you link the Harbour libraries with other
|
|
* files to produce an executable, this does not by itself cause the
|
|
* resulting executable to be covered by the GNU General Public License.
|
|
* Your use of that executable is in no way restricted on account of
|
|
* linking the Harbour library code into it.
|
|
*
|
|
* This exception does not however invalidate any other reasons why
|
|
* the executable file might be covered by the GNU General Public License.
|
|
*
|
|
* This exception applies only to the code released by the Harbour
|
|
* Project under the name Harbour. If you copy code from other
|
|
* Harbour Project or Free Software Foundation releases into a copy of
|
|
* Harbour, as the General Public License permits, the exception does
|
|
* not apply to the code that you add in this way. To avoid misleading
|
|
* anyone as to the status of such modified files, you must delete
|
|
* this exception notice from them.
|
|
*
|
|
* If you write modifications of your own for Harbour, it is your choice
|
|
* whether to permit this exception to apply to your modifications.
|
|
* If you do not wish that, delete this exception notice.
|
|
*
|
|
*/
|
|
|
|
/* NOTE: This file is also used by C code. */
|
|
|
|
#ifndef HB_SERIAL_CH_
|
|
#define HB_SERIAL_CH_
|
|
|
|
#define HB_SERIALIZE_NUMSIZE 0x01
|
|
#define HB_SERIALIZE_OBJECTSTRUCT 0x02
|
|
#define HB_SERIALIZE_COMPRESS 0x04
|
|
#define HB_SERIALIZE_IGNOREREF 0x08
|
|
|
|
#endif /* HB_SERIAL_CH_ */
|