what is the fastest way to serialize a temp-table?

I want to serialize a dynamic temp-table so I can pass it at run time not knowing its definition at compile time.

JSON/XML are obvious choices but I neither want the bloat nor does it have to be human readable.

Any suggestions? Optional compression would be icing on the cake but I could take care of this later.

Thanks,
Tom
 

Stefan

Well-Known Member
You can also pass it as TABLE-HANDLE. Since this is 'native' I would expect this to be fastest.

If serializing via XML, look at the XML attributes for temp-tables allowing you to use cryptic one letter XML attributes and mark fields as being attributes.
 

tamhas

ProgressTalk.com Sponsor
I would do some testing to see what the real issues are. Table-handle will end up passing the table in "native" form ... some things will understand that, some won't. Make sure to check parameters for limiting the amount of schema information sent since you could easily find that the defaults produce something larger than XML! Once upon a time Greg Higgins did some tests in which he could serialize a TT to XML, pass that, and deserialize to a TT *faster* than passing the TT in native form, but I think that was before the schema limiting parameters.

Also, unless you write something in C or whatever that knows how a TT is stored, remember that any serialization that you do which individually accesses each record and handles each field of each record is going to be a lot of ABL instructions for a TT of any size. Even without the instructions to stringify the fields and pack them in some way, I'll bet this will be so much slower than WRITE-XML that you will be tickled pink to accept the message bloat.
 
In my stomp projects I use xml-write + gzip + uuencode to transfer data through mq.
It is fast enough actually.
It takes about 2-3 minutes to write 500-700mb file containing 1mln record in temp-table.
After gzip/uuencode I have 20-30mb file to transfer through network.
 
Top