The strings are delivered within messages.
In practice typical lengths of a string will be between 1k and 2kb.
The average number of such strings within a message may be around
20,000 - (0.1% cases > 1million)

The following demonstrates the advantage of ;: over ;.

data=: 5000 1000$'+4.31:A+-:H+-:H+4.30:A+4.32:A+4.25:A+4.25'

cut =: 4&{.@(<;._1)@(':'&,);._1@('+'&,)

sm =: (2;sc;pp)&;:  NB. 2 means return array of offets and indexes
(instead of boxes).

then
6!:2'cut"1 data'
5.75279

6!:2'sm"1 data'
0.243648

Such a pity that I cant use  ;: .

As before
pp=: '+:' i. a.
sc=: 8 3 2 $ ". (0 : 0) -. CRLF
3 1 0 0 0 0
1 2 5 1 3 0
1 2 5 2 4 2
2 1 5 1 4 0
2 1 5 1 4 0
1 2 7 2 6 1
1 2 7 2 6 0
1 1 7 0 7 0
)

Thanks again....
David


Raul Miller wrote: <Mon Jan 22 21:32:16 HKT 2007>
....

In "real life", are you processing much larger chunks
of data?

R.E. Boss wrote: <Mon Jan 22 19:44:32 HKT 2007>
....
Using ;:  is at least 10 times quicker than using cut (;.) - because
On what evidence is this statement based?
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to