bill lam wrote:
> John Randall wrote:
>> The verb testjmf does the appends in a jmf file.  The timings increase
>> approximately linearly, giving overall quadratic performance.
>
> I tested and got similar results. furthermore if modified to use amend
>
> f=:(y*1e4)$0
> for_i. i.y do.
> smoutput i, 6!:2 'f=:(i.1e4) ((i*1e4)+i.1e4)}f'
> end.
>
> the timing became constant thus I guess J engine itself is responsible for
> the
> degraded performance in append, but of course I may be wrong.
>

Bill, I think you have hit the nail on the head.  With your modification,
my computer rips through in linear time.

It looks as though the correct strategy is to "format" the array, and then
manage the append through modification and keeping track of how much of
the array you have used, just like C.

While this is less satisfactory than using J idioms, I believe it solves
my immediate performance problems.

Best wishes,

John

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to