MATBUILD/MATPARSE vs Dynamic Array access

82 views
Skip to first unread message

Bruce Willmore

unread,
Aug 2, 2009, 12:38:50 PM8/2/09
to jBASE
Hi everyone:

First off:

jBASE version 4.1.6.20
Operating System: HP-UX 11.13 (I believe. Going from memory on that,
but don't think it'll prove relevant)

In short, I have a subroutine that is invoked by the BlueFinity MVnet
product. The traffic that passes through the BlueFinity product can
easily exceed more than 1 million transactions/day. MVnet provides as
an argument to this surbroutine a dynamic array, which my subroutine
needs to perform repeated extracts from to get the required data.

That said, my question is that when considering an application under
this type of load, is there any benefit to converting the dynamic
array that mvNET is providing to a dimensioned array and back again
using MATPARSE/MATBUILD, or is it best to leave it as a dynamic array?
I should note that the number of attributes in this dynamic array is
currently around 50, and will be rising, as we are being called upon
to perform ever more-complicated decisions using additional data
points.

Or, if there is no real benefit to be gained using MATPARSE/MATBUILD,
is there an optimal method for extracting the needed data from the
Dynamic Array?

Thanks in advance for any advice that you might be able to provide,
Bruce

Jim Idle

unread,
Aug 2, 2009, 1:12:53 PM8/2/09
to jB...@googlegroups.com
Bruce Willmore wrote:
> Hi everyone:
>
> First off:
>
> jBASE version 4.1.6.20
> Operating System: HP-UX 11.13 (I believe. Going from memory on that,
> but don't think it'll prove relevant)
>
> In short, I have a subroutine that is invoked by the BlueFinity MVnet
> product. The traffic that passes through the BlueFinity product can
> easily exceed more than 1 million transactions/day. MVnet provides as
> an argument to this surbroutine a dynamic array, which my subroutine
> needs to perform repeated extracts from to get the required data.
>
> That said, my question is that when considering an application under
> this type of load, is there any benefit to converting the dynamic
> array that mvNET is providing to a dimensioned array and back again
> using MATPARSE/MATBUILD, or is it best to leave it as a dynamic array?
>

It depends on the access patterns. If you traverse the dynamic array
from start to end or end to start, then dynamic array access will
generally be faster (depends a little on the data the array contains).
Use the group search to find lots of posts on this subject in the dim
and distant past.


> I should note that the number of attributes in this dynamic array is
> currently around 50, and will be rising, as we are being called upon
> to perform ever more-complicated decisions using additional data
> points.
>

This isn't really a large enough array to worry about unless a lot of
the individual elements are large and/or you are using random access
patterns and cannot change that. It will almost certainly take longer to
do the MATPARSE/MATBUILD (as using jprof would show you).


> Or, if there is no real benefit to be gained using MATPARSE/MATBUILD,
> is there an optimal method for extracting the needed data from the
> Dynamic Array?
>

Use the data elements in order and not in a random access pattern. If
they are being accessed a lot in random order then first copy them into
temporaries and use those (but be aware that as you add more local
variables to subroutines, the creation and destruction of them on
subroutine enter and exit will start to be expensive; use COMMON
variables to avoid that overhead).

However also note that 1 million transactions per day, while it sounds
like a lot is essentially nothing for a modern computer... that said,
you have an HP system ;-) Unless what you are doing is very complicated,
you should be able to process a million transactions in a few minutes. I
suggest that you will get a lot more performance improvements by using
jprof on your application code than you will by second guessing the
access patterns like this. Concentrate on why time is spent in certain
subroutines or on certain lines of code, file sizes and so on.

Jim

Tony G

unread,
Aug 2, 2009, 8:17:30 PM8/2/09
to jB...@googlegroups.com
Not knowing the internals of how jBASE processes dimensioned vs
dynamic vars, it's always interesting to see Jim's notes on the
topic.

About mv.NET, another way you may be able to optimize your
requests is by spreading the data out in the call to the server.
In other words:

Method 1, what you're probably doing:
- Build an mvItem of 50 attributes.
- Create string from mvItem as request.
- Instantiate result var.
- youraccount.CallProg("PROG",ref request, ref result)
- that calls SUBROUTINE PROG(REQUEST,RESULT)

Method 2
- Build several strings
- youracct.CallProg("PROG",ref s1, ref s2, ref s3...)

Your subroutine will accept multiple dynamic arrays, sort of
pre-parsed for you:
SUBROUTINE PROG(S1,S2,S3,S4,S5,S6,S7)

You can pass up to about 20 arguments but that can be expanded if
required.

HTH
Tony Gravagno
Nebula Research and Development
TG@ remove.pleaseNebula-RnD.com
Nebula R&D is a worldwide distributor for mv.NET and
other Pick/MultiValue products, and provides related
support and development services

Reply all
Reply to author
Forward
0 new messages