creating size-limited tar files

Andrea Crotti andrea.crotti.0 at gmail.com
Wed Nov 14 21:43:59 CET 2012


On 11/14/2012 04:33 PM, Dave Angel wrote:
> Well, as I said, I don't see how the particular timing has anything to
> do with the rest of the thread.  If you want to do an ls within a Python
> program, go ahead.  But if all you need can be done with ls itself, then
> it'll be slower to launch python just to run it.
>
> Your first timing runs python, which runs two new shells, ls, and cat.
> Your second timing runs ls and cat.
>
> So the difference is starting up python, plus starting the shell two
> extra times.
>
> I'd also be curious if you flushed the system buffers before each
> timing, as the second test could be running entirely in system memory.
> And no, I don't know offhand how to flush them in Linux, just that
> without it, your timings are not at all repeatable.  Note the two
> identical runs here.
>
> davea at think:~/temppython$ time ls -lR ~ | cat > /dev/null
>
> real	0m0.164s
> user	0m0.020s
> sys	0m0.000s
> davea at think:~/temppython$ time ls -lR ~ | cat > /dev/null
>
> real	0m0.018s
> user	0m0.000s
> sys	0m0.010s
>
> real time goes down by 90%, while user time drops to zero.
> And on a 3rd and subsequent run, sys time goes to zero as well.
>

Right I didn't think about that..
Anyway the only thing I wanted to understand is if using the pipes in 
subprocess is exactly the same as doing
the Linux pipe, or not.

And any idea on how to run it in ram?
Maybe if I create a pipe in tmpfs it might already work, what do you think?


More information about the Python-list mailing list