Re: HLA Lib
- From: "vid512@xxxxxxxxx" <vid512@xxxxxxxxx>
- Date: 19 Mar 2007 15:06:44 -0700
Perhaps you missed the fact that the delimiters character set can beallright then
user-defined.
i just did. the lowmost functions seemed to be done pretty fast. But4. have you been thinking about speed of your routines a little bit? ISure, take a look at the conversion routines.
know it isn't the most important stuff, but still some border is
required.
the higher level functions suffered from lot of abstraction there, for
example separate predicting number of digits before padding, and
separate conversion.
fileio.eof is ugly, no doubt. If you can suggest better code that
works in *all* cases, I'll be more than happy to use it. Every
optimization I've tried in the past has failed on one case or another.
i believe :)
i was solving this for very long for FASMLIB until some good state.
General answer is: utilize your own read buffering for file.
Not to mention the fact that if someone's code is being slowed down by
calling fileio.eof, that should be a red flag that they should be
doing blocked I/O and using fileio.read to grab a large percentage of
the file at once. Better yet, they ought to be using memory-mapped I/
O. fileio.eof (and the associated item-at-a-time I/O) is really great
for knocking out quick and dirty programs (e.g., beginning student
projects), but this isn't the programming paradigm to use for high-
performance programming.
yes, that is exactly your case.
The fileio package does not do any buffering, on input or output.
That's the bottom line. Buffering opens up a whole host of additional
problems that I don't want to have to deal with (like handling what
happens when the program aborts for one reason or another and "hot"
buffers are laying around).
you see, we agree on this :)
Sure, all this could be handled, but that
would involve having HLA emit some code behind the user's back to
execute whenever the program quits, and surely you've seen the
reaction to that kind of stuff around here. With the single exception
of exception handling, the HLA stdlib does not require any startup or
cleanup code. I want to keep it that way. Again, if someone wants
buffering, they can use memory-mapped files (or fileio.read) and use
the conv.* library to do their processing.
some init and finishing codes are a must-have for solid design
library. How are you going to implement heap for linux without it? It
doesn't have to be hidden, you can force user to always call it :)
???
stdin.readln will raise the EOF exception if you insist on reading
beyond the EOF. If you're writing filter programs that generally take
file data on the stdin, you can handle EOF that way. If you *really*
want to use generic fileio functions on stdin, just call
stdin.handle() and use the resulting handing as the parameter to the
fileio functions. stdin is mainly intended for console-like input.
but other functions regarding stdin seem to act as if stdin shouldn't
never give EOF. for example stdin._geti_ fails to read number if it's
last thing in redirected file.
.
- Follow-Ups:
- Re: HLA Lib
- From: randyhyde@xxxxxxxxxxxxx
- Re: HLA Lib
- References:
- HLA Lib
- From: vid512@xxxxxxxxx
- Re: HLA Lib
- From: randyhyde@xxxxxxxxxxxxx
- Re: HLA Lib
- From: vid512@xxxxxxxxx
- Re: HLA Lib
- From: randyhyde@xxxxxxxxxxxxx
- HLA Lib
- Prev by Date: Re: cFASM (calling FASM as a C function)
- Next by Date: Re: HLA Lib
- Previous by thread: Re: HLA Lib
- Next by thread: Re: HLA Lib
- Index(es):
Relevant Pages
|