Re: How to speed up record I/O?
Simon Coulter <shc-Q/[email protected]> Sun, 3 Jan 2010 07:33:10 +1100
| Newsgroups | gmane.comp.lang.as400.mi |
|---|---|
| Message-ID | <[email protected]> |
On 03/01/2010, at 5:33 AM, Mike Amos wrote:
> My name is Mike Amos and, several years ago, I was reasonably
> proficient
> at MI programming. The past several years, with C/400 and then ILE-
> C, I
> have had no need to use anything other than the provided APIs and MI
> calls supported directly via ILE-C. Today, however, I need to speed up
> read/write - esp. reads - for record IO. I know that the IBM FTP
> program
> does reads much faster than the provided record IO interfaces because
> FTP reads and sends my 300MB test file twice as fast as I can read
> it. I
> have tried every reasonable combination of _Rreadx, read() and fread()
> that I can think of using both native and IFS interfaces and compiler
> options.
>
> I have a few questions:
>
> 1. Has anyone found that MI calls to the IO functions, QSYS/QGETDBx,
> etc. can be safely done using in user state at security level 50?
The programs are system-state, user-domain so they can be called from
user-state programs. However, as far as I know the interfaces to these
programs are not publicly documented. They may be part of the Limited
Availability API suite in which case you'll need to ask IBM for access
to the documentation.
> 2. Does anyone have any experience regarding faster record IO methods
> such as use of RPG, MI or any ideas?
See my responses in the C400-L list.
> 3. Accessing the system table to make the calls is not a problem for
> me,
> but I have not been able to find documentation for the IO control
> block/file control block/other control block definitions needed to set
> up the IO.
You can glean information about the UFCB, the program interface, etc.
from the IRP listing of an OPM program that performs I/O. Not ideal
but often useful however I think in general that it is not necessary
to bypass HLL I/O to increase I/O speed. It is simply a matter of
processing the data correctly using appropriate blocking and I/O
operations.
I note that your comments on C400-L indicate you are opening the file
for update in which case you will never match the speed of FTP which
is using only read for input and write for output, both if which can
be maximally blocked for fastest access.
Regards,
Simon Coulter.
--------------------------------------------------------------------
FlyByNight Software OS/400, i5/OS Technical Specialists
http://www.flybynight.com.au/
Phone: +61 2 6657 8251 Mobile: +61 0411 091 400 /"\
Fax: +61 2 6657 8251 \ /
X
ASCII Ribbon campaign against HTML E-Mail / \
--------------------------------------------------------------------
_______________________________________________
This is the MI Programming on the AS400 / iSeries (MI400) mailing list
To post a message email: MI400-Zwy7GipZuJhWk0Htik3J/[email protected]
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/mi400
or email: MI400-request-Zwy7GipZuJhWk0Htik3J/[email protected]
Before posting, please take a moment to review the archives
at http://archive.midrange.com/mi400.