Hi

I have several complexe structures to store (multiplateform path information, color rgb/hatching/dash, xyz vector, unicode 4bytes strings etc.) and also simple data (long, double etc.)

I am building a class easy to maintain and easy to use, that store any of my data type as a byte array (c4_BytesProp). This is easyer for me to pack/unpack all kind of data in the same manner, and have always the same data type in my metakit. Especially I can easily manage endian, encoding etc.. for each part of the complex structures.

I wonder if the c4_View.Select() function have good enough performances with bytes, compared to using simple data like c4_StringProp.

I experience slow process in this function, and wonder if this is because of the 
c4_BytesProp type.
This is the kind of actions that seems slow to me :

c4_View       view=storage->GetAs("mytable[vector:B,position:B]");
c4_Row        row;
c4_BytesProp prp("vector");
prp(row)=c4_Bytes(buf,(long)buflen,true);//make a copy
c4_View selection=view.Select(row);

After profiling my app, I found that 90% if the time is spent on c4_FilterSeq::Match() while it is only 20% of the work to do (after selecting rows, I do a lot of things).

Time function + children (%):

99,2    art_geocod::make_it_all) (geocod.obj)
96,6    art_geocod::search() (geocod.obj)
96,5    art_db::select_start(class art_db_record const *,short) (adb.obj)
91,8    c4_View::Select(class c4_RowRef const &) (view.obj)
91,8    f4_CreateFilter(class c4_Sequence &,class c4_Cursor,class c4_Cursor) 
(derived.obj)
91,8    c4_FilterSeq::c4_FilterSeq(class c4_Sequence &,class c4_Cursor,class 
c4_Cursor) (derived.obj)
88,7    c4_FilterSeq::Match(int,class c4_Sequence &,int const *,int const *) 
(derived.obj)
38,4    c4_Handler::Compare(int,class c4_Bytes const &) (handler.obj)
34,2    c4_Handler::GetBytes(int,class c4_Bytes &,bool) (handler.obj)
31      c4_FormatB::Get(int,int &) (format.obj)
16,6    c4_Column::FetchBytes(long,int,class c4_Bytes &,bool) (column.obj)
15,5    f4_CompareFormat(char,class c4_Bytes const &,class c4_Bytes const &) 
(format.obj)
9,6     c4_ColIter::Next(void) (column.obj)
6,4     c4_Bytes::operator=(class c4_Bytes const &) (table.obj)
4,8     c4_Bytes::c4_Bytes(void const *,int,bool) (table.obj)
etc.....


Time function alone (%):


15,5    f4_CompareFormat(char,class c4_Bytes const &,class c4_Bytes const &) 
(format.obj)
12      c4_FilterSeq::Match(int,class c4_Sequence &,int const *,int const *) 
(derived.obj)
11,6    c4_FormatB::Get(int,int &) (format.obj)
9,6     c4_ColIter::Next(void) (column.obj)
7       c4_Column::FetchBytes(long,int,class c4_Bytes &,bool) (column.obj)
6,4     c4_Bytes::operator=(class c4_Bytes const &) (table.obj)
5,9     c4_Handler::Compare(int,class c4_Bytes const &) (handler.obj)
4,8     c4_Bytes::c4_Bytes(void const *,int,bool) (table.obj)
4,6     c4_Handler::GetBytes(int,class c4_Bytes &,bool) (handler.obj)
3,7     c4_HandlerSeq::NthHandler(int) (i)
2,8     c4_Sequence::Buffer(void) (viewx.obj)
etc.....

I suspect f4_CompareFormat, c4_FilterSeq::Match and c4_FormatB::Get to be particularly slow with BytesProp... Am I right ? or would it be the same with string ??

(PS: my bytes arrays are never bigger than 110 bytes)

Thanks for any information

--
Riccardo Cohen

Articque
Les Roches
37230 Fondettes
France
email = [EMAIL PROTECTED]
web = http://www.articque.com
tel: +33 02 47 49 90 49
fax: +33 02 47 49 91 49

_______________________________________________
metakit mailing list  -  [EMAIL PROTECTED]
http://www.equi4.com/mailman/listinfo/metakit

Reply via email to