dbTalk Databases Forums  

Universe 10.1 WRITESEQ Slows down after multiple files created

comp.databases.pick comp.databases.pick


Discuss Universe 10.1 WRITESEQ Slows down after multiple files created in the comp.databases.pick forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Big kahuna
 
Posts: n/a

Default Universe 10.1 WRITESEQ Slows down after multiple files created - 08-15-2011 , 07:13 PM






Hi,

We have a function that selects and writes out 3000 records at a time
to multiple CSV files. The selection of the 3000 records is done in
one function and then another function is called to write out the
selected records (using WRITESEQ). The process slows dramatically
over time. As you can see the first File of 3000 records takes 6
minutes to write and the last 53 minutes.

It's almost like there is a memory leak. Any ideas as to what might
be going on here?

Thanks
Steve


CSVFile Created Time Duration
1 9:05:00 a.m. 0:06
2 9:11:00 a.m. 0:08
3 9:19:00 a.m. 0:14
4 9:33:00 a.m. 0:23
5 9:56:00 a.m. 0:36
6 10:32:00 a.m. 0:41
7 11:13:00 a.m. 0:48
8 12:01:00 p.m. 0:53
9 12:54:00 p.m. 0:59
10 1:53:00 p.m. 1:08
11 3:01:00 p.m. 1:45

Reply With Quote
  #2  
Old   
Ed Sheehan
 
Posts: n/a

Default Re: Universe 10.1 WRITESEQ Slows down after multiple files created - 08-16-2011 , 09:37 AM






Shot in the dark:

Depending on how much memory is being used by the records being written, it
seems possible that if these records are using different variable names, and
not being reused for the next batch, you could end up memory bound, with
these set of records taking up more and more space for their storage. The
first thing I would try is reuse the variable names when done with each
batch.

Ed

"Big kahuna" <steve.muller (AT) tauranga (DOT) govt.nz> wrote

Quote:
Hi,

We have a function that selects and writes out 3000 records at a time
to multiple CSV files. The selection of the 3000 records is done in
one function and then another function is called to write out the
selected records (using WRITESEQ). The process slows dramatically
over time. As you can see the first File of 3000 records takes 6
minutes to write and the last 53 minutes.

It's almost like there is a memory leak. Any ideas as to what might
be going on here?

Thanks
Steve


CSVFile Created Time Duration
1 9:05:00 a.m. 0:06
2 9:11:00 a.m. 0:08
3 9:19:00 a.m. 0:14
4 9:33:00 a.m. 0:23
5 9:56:00 a.m. 0:36
6 10:32:00 a.m. 0:41
7 11:13:00 a.m. 0:48
8 12:01:00 p.m. 0:53
9 12:54:00 p.m. 0:59
10 1:53:00 p.m. 1:08
11 3:01:00 p.m. 1:45

Reply With Quote
  #3  
Old   
Scott Ballinger
 
Posts: n/a

Default Re: Universe 10.1 WRITESEQ Slows down after multiple files created - 08-16-2011 , 12:53 PM



Steve,

I would think there is something definitely wrong there; you are
saying that under the best of circumstances it takes 6 minutes to
write out 3000 records via writeseq?! Wow- how big are those records??
Unless those CSV records are being written to a USB drive (or a
floppy!) or via the internets to a remote site, I would expect a
process such as that to finish in seconds, not minutes. My guess is
that your UV basic program is doing something the hard way.

/Scott Ballinger
Pareto Corporation
Edmonds WA USA
206 713 6006

On Aug 15, 5:13*pm, Big kahuna <steve.mul... (AT) tauranga (DOT) govt.nz> wrote:
Quote:
Hi,

We have a function that selects and writes out 3000 records at a time
to multiple CSV files. *The selection of the 3000 records is done in
one function and then another function is called to write out the
selected records (using WRITESEQ). *The process slows dramatically
over time. *As you can see the first File of 3000 records takes 6
minutes to write and the last 53 minutes.

It's almost like there is a memory leak. *Any ideas as to what might
be going on here?

Thanks
Steve

CSVFile Created Time * *Duration
1 * * * * * * * *9:05:00 a.m. * 0:06
2 * * * * * * * *9:11:00 a.m. * 0:08
3 * * * * * * * *9:19:00 a.m. * 0:14
4 * * * * * * * *9:33:00 a.m. * 0:23
5 * * * * * * * *9:56:00 a.m. * 0:36
6 * * * * * * * 10:32:00 a.m. * 0:41
7 * * * * * * * 11:13:00 a.m. * 0:48
8 * * * * * * * 12:01:00 p.m. * 0:53
9 * * * * * * * 12:54:00 p.m. * 0:59
10 * * * * * * *1:53:00 p.m. * *1:08
11 * * * * * * *3:01:00 p.m. * *1:45

Reply With Quote
  #4  
Old   
wjhonson
 
Posts: n/a

Default Re: Universe 10.1 WRITESEQ Slows down after multiple files created - 08-16-2011 , 03:51 PM



On Aug 15, 5:13*pm, Big kahuna <steve.mul... (AT) tauranga (DOT) govt.nz> wrote:
Quote:
Hi,

We have a function that selects and writes out 3000 records at a time
to multiple CSV files. *The selection of the 3000 records is done in
one function and then another function is called to write out the
selected records (using WRITESEQ). *The process slows dramatically
over time. *As you can see the first File of 3000 records takes 6
minutes to write and the last 53 minutes.

It's almost like there is a memory leak. *Any ideas as to what might
be going on here?

Thanks
Steve

CSVFile Created Time * *Duration
1 * * * * * * * *9:05:00 a.m. * 0:06
2 * * * * * * * *9:11:00 a.m. * 0:08
3 * * * * * * * *9:19:00 a.m. * 0:14
4 * * * * * * * *9:33:00 a.m. * 0:23
5 * * * * * * * *9:56:00 a.m. * 0:36
6 * * * * * * * 10:32:00 a.m. * 0:41
7 * * * * * * * 11:13:00 a.m. * 0:48
8 * * * * * * * 12:01:00 p.m. * 0:53
9 * * * * * * * 12:54:00 p.m. * 0:59
10 * * * * * * *1:53:00 p.m. * *1:08
11 * * * * * * *3:01:00 p.m. * *1:45

Let's see the code.

Reply With Quote
  #5  
Old   
Frank Winans
 
Posts: n/a

Default Re: Universe 10.1 WRITESEQ Slows down after multiple files created - 08-16-2011 , 04:23 PM



"Scott Ballinger" wrote
Quote:
Steve,

I would think there is something definitely wrong there; you are
saying that under the best of circumstances it takes 6 minutes to
write out 3000 records via writeseq?! Wow- how big are those records??
Unless those CSV records are being written to a USB drive (or a
floppy!) or via the internets to a remote site, I would expect a
process such as that to finish in seconds, not minutes. My guess is
that your UV basic program is doing something the hard way.

Yeah, if you're that hard up, you might try brute force and ignorance;
a) write one record to tom.txt
b) invoke a dos subshell {In D3 this would be like}
execute "!TYPE TOM.TXT >> TOM_N_JERRY.TXT" capturing bucket
c) rinse and repeat
Which in general is a dead slow way to do it, but you're already there,
man...

Reply With Quote
  #6  
Old   
Big kahuna
 
Posts: n/a

Default Re: Universe 10.1 WRITESEQ Slows down after multiple files created - 08-17-2011 , 07:10 PM



Hi, the function in question is a generic function for writing data to
a CSV file.

It get's called from a main function that selects:
- the records to be exported from the Universe file
- the dictionaries to include in the export
- the CSV export file name and path

These are passed through to the DSK.EXPORTCSV function as parameters.

The basic process is:

loop through Universe file selecting 3000 records at a time
call DSK.EXPORTCSV to export the current group of 3000 records
repeat

Reply With Quote
  #7  
Old   
wjhonson
 
Posts: n/a

Default Re: Universe 10.1 WRITESEQ Slows down after multiple files created - 08-18-2011 , 12:03 PM



On Aug 17, 5:10*pm, Big kahuna <steve.mul... (AT) tauranga (DOT) govt.nz> wrote:
Quote:
Hi, the function in question is a generic function for writing data to
a CSV file.

It get's called from a main function that selects:
- the records to be exported from the Universe file
- the dictionaries to include in the export
- the CSV export file name and path

These are passed through to the DSK.EXPORTCSV function as parameters.

The basic process is:

loop through Universe file selecting 3000 records at a time
* call DSK.EXPORTCSV to export the current group of 3000 records
repeat
The exact specific details will be important.
Please post the actual code.

Reply With Quote
  #8  
Old   
x
 
Posts: n/a

Default Re: Universe 10.1 WRITESEQ Slows down after multiple files created - 08-18-2011 , 08:32 PM



Steve,
By the sound of it something is wrong with the code. There is no code
to browse through, probably too many lines of code to publish. I
don't think that "select 3000 records" is as simple as it sounds nor
the call to DSK.EXPORTCSV is necessary for a mere WRITESEQ. Not
knowing anything about your code I would try to isolate the hog
first. Run the process without the call to DSK.EXPORTCSV and see how
the calls are spaced in time. If the selection time increases as you
go, most likely the select is done over and over from the beginning of
things, reparsing previously processed records. If the calls to
DSK.EXPORTCSV are equally spaced then look how your called routine
builds its data. It may use WRITESEQ to output but it may first read
in memory the existing data, update it, then write it etc. Check also
for possible COMMON variables that may get updated with tons of
information whenever you call your routine or other variables in your
main program that may hold growing lists of records etc.

Lucian

Reply With Quote
  #9  
Old   
Big kahuna
 
Posts: n/a

Default Re: Universe 10.1 WRITESEQ Slows down after multiple files created - 08-21-2011 , 03:29 PM



Thanks Lucian,

You are correct, there are too many lines of code to publish. The
DSK.RUNCSV function for example, converts Multivalue characters to
Linefeed characters for tabular output in the Word Merge etc.

I will give your testing approach a go and see if I can isolate the
problem.

Thanks again for your suggestions

Steve

On Aug 19, 1:32*pm, x <lucian_p... (AT) yahoo (DOT) com> wrote:
Quote:
Steve,
By the sound of it something is wrong with the code. *There is no code
to browse through, probably too many lines of code to publish. *I
don't think that "select 3000 records" is as simple as it sounds nor
the call to DSK.EXPORTCSV is necessary for a mere WRITESEQ. *Not
knowing anything about your code I would try to isolate the hog
first. *Run the process without the call to DSK.EXPORTCSV and see how
the calls are spaced in time. *If the selection time increases as you
go, most likely the select is done over and over from the beginning of
things, reparsing previously processed records. If the calls to
DSK.EXPORTCSV are equally spaced then look how your called routine
builds its data. *It may use WRITESEQ to output but it may first read
in memory the existing data, update it, then write it etc. *Check also
for possible COMMON variables that may get updated with tons of
information whenever you call your routine or other variables in your
main program that may hold growing lists of records etc.

Lucian

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.