On Sun, 2004-12-19 at 23:43, Jp Calderone wrote:
> On Sun, 19 Dec 2004 23:12:27 -0500, Adam DePrince <[EMAIL PROTECTED]> wrote:
> > [snip]
> >
> > Of course, to take advantage of this requires that writev be exposed. I
> > have an implementation of writev.
Adam DePrince <[EMAIL PROTECTED]> writes:
> I want to include it because POSIX has a single OS call that
> conceptually maps pretty closely to writelines.
I just want to point out that on some systems, POSIX is a
compatability layer, not an OS layer. On those systems, the
implement
Adam DePrince wrote:
[snip great explanation]
I want to include it because POSIX has a single OS call that
conceptually maps pretty closely to writelines. writev can be faster
because you don't have to do memory copies to buffer data in one place
for it -- the OS will do that, and can some
it looks like file.writelines makes a call
> to 'fwrite' for each item in the iterable given. Your code, if I read
> it right, makes a call to 'writev' for each item in the iterable.
No, my code makes a call to writev for every nth iterable, where n is
usually 1024.
if I read
it right, makes a call to 'writev' for each item in the iterable.
I looked at the fwrite() and writev() docs and read your comments, but I
still couldn't quite figure out what makes 'writev' more efficient than
'fwrite' for the same size buffer... Mi
map(file.write, mydata)
>
> which I would write as:
>
> file.writelines(mydata)
>
> Could you explain a little more what your intent is here?
file.writelines( seq ) and map( file.write, seq ) are the same; the
former is syntactic sugar for the later.
Writev is a neat
On Sun, 2004-12-19 at 23:43, Jp Calderone wrote:
> On Sun, 19 Dec 2004 23:12:27 -0500, Adam DePrince <[EMAIL PROTECTED]> wrote:
> > [snip]
[snip]
to free the memory, of course.
>
> The support of iterators is a cool idea, but I'm not sure
> it is actually useful. Consider the case where not
Adam DePrince wrote:
Many other programmers have faced a similar issue; cStringIO,
''.join([mydata]), map( file.write, [mydata]) are but some attempts at
making this process more efficient by jamming the components to be
written into a sequence.
I'm obviously misunderstanding something because I ca
On Sun, 19 Dec 2004 23:12:27 -0500, Adam DePrince <[EMAIL PROTECTED]> wrote:
> [snip]
>
> Of course, to take advantage of this requires that writev be exposed. I
> have an implementation of writev. This implementation is reasonably
> smart, it "unrolls" only so
d be a substantial benefit.
Perusing through the posix module reveals that the posix writev call is
not exposed. Writev is the POSIX answer to this problem for very
similar reasons. The ability to expose a list of strings to be
outputted to the hardware level would allow for the exploita
10 matches
Mail list logo