Efficiency retrieving arrays from the server

Kirk Brooks (5/6/14 12:19AM)
Keith White (5/6/14 3:47PM)
Owen Watson (5/8/14 11:41AM)


Kirk Brooks (5/6/14 12:19 AM)

<CAHY=XkuajD7QdmcdK4SkM5PhJaV67Nh5hGeftDsZ8_tkvbWsoA@mail.gmail.com>

Hi Miyako,

You are so correct about the advantages of using Execute on server,
pointers and COPY ARRAY. I spent a little time this afternoon building a
test suite to look at this and the results are startling.

My methodology is this: write the test method that runs on the client.
After a little playing around settled on using 10 text arrays. Wrote
two
methods to execute on server. One populates the arrays (5000 elements
and
about 200 chars in each cell) and passes them back in a blob, the local
method then unpacks the blob. The other method populates the arrays
then
calls COPY ARRAY to write them to the client arrays passed by pointers.

The local method runs each method for 10 iterations for 1 - 10 arrays
for
100 total passes.

The server I'm testing against is located in a colo in Mt View, running
v13.5 on Windows Server 2003 on about a 6 year old machine. I was the
only
user when the tests were run.

I timed the overall time it took to run the method and have the arrays
available. In the case of using blobs this included unpacking them.

RESULTS
Here are the the averages for a couple of runs.

BLOBS
?1 ?=A0?=A0747.80 ?=A0?761.40
2 ?=A01,337.00 ?1,427.00
3 ?=A02,005.90 ?2,286.30
4 ?=A02,811.20 ?2,877.90
5 ?=A03,391.30 ?3,778.90
6 ?=A03,798.20 ?4,213.40
7 ?=A04,860.90 ?4,674.70
8 ?=A05,906.00 ?6,122.60
9 ?=A07,947.90 ?7,429.30
10 ?=A07,027.80 ?8,065.60

POINTERS
?1 ?=A04.40 ?11.60
2 ?=A05.80 ?=A06.20
3 ?=A09.80 ?=A09.30
4 ?14.60 ?15.70
5 ?21.60 ?20.00
6 ?24.50 ?24.90
7 ?28.60 ?28.00
8 ?31.20 ?32.20
9 ?37.70 ?38.10
10 ?40.20 ?41.20

The lefthand number is how many arrays were transferred.
The values are the average time of ten transfers in ms.

There is really no comparison. So, for those of us who cut our teeth
packing arrays into blobs to move them back and forth between the
server
and client machine it's really time to refactor that code to take
advantage
of Execute on server and pointers.

If anyone would like the test methods I wrote let me know.

--
Kirk Brooks
San Francisco, CA
==3D==3D==3D==3D==3D==3D==3D==3D==3D==3D==3D=

Keith White (5/6/14 3:47 PM)

<11F08ABFEFB7E64E9B0D19D330E14B770C56880F@...

This is interesting stuff, thanks for posting your findings!

I haven't tried using EOS method attribute to build arrays server-side
as I figured 4D wouldn't be able to do it unless I pass a pointer to
each specific array (or use a BLOB return). ?In practice I'd want to
populate arrays using a pointer to an array of pointers. ?We always
define arrays and build an array of pointers to them. ?Although I
haven't tested it, I have doubts that 4D would know to include the 2nd
referenced arrays (ie the ones that contain the data) in the return
payload?

One other point about the EOS attribute is how to monitor the progress
of the (synchronous) server side method - how do others do that? ?=A0We
currently use the Execute on Server function and monitor that
(asynchronous) process via GET PROCESS VARIABLE.

Best regards

Keith White
Synergist Express Ltd, UK.

Owen Watson (5/8/14 11:41 AM)

<CADtfvzXQpMXi+Fa5CyfvPAFGNiZrdbGPqSqG88Ho=8FaDWPaCQ@mail.gmail.com>

Many thanks. I'm running v11, so, as you say, passing pointers in EOS
isn't
possible. Sigh.

Reply to this message

Summary created 5/7/14 at 8:34PM by Intellex Corporation

Comments welcome at: feedback@intellexcorp.com