help in debugging file.seek, file.read

Prateek surekap at gmail.com
Sun Apr 29 20:54:16 EDT 2007


On Apr 30, 3:20 am, Prateek <sure... at gmail.com> wrote:
> Sorry, I forgot to mention - the RTH line only prints when the time
> taken is > 0.1 second (so that I don't pollute the output with other
> calls that complete normally)

I have some more information on this problem. Turns out the issue is
with buffer syncing.
I was already doing a flush operation on the file after every commit
(which flushes the user buffers).

I added an os.fsync call which fixed the erratic behavior. But the
code is still horribly slow... 122s vs around 100s (without the
fsync).
Since fsync flushes the kernel buffers, I'm assuming this has
something to do with my O/S (Mac OS 10.4.9 Intel - Mac Book Pro
2.33Ghz Core 2 Duo, 2GB RAM).

Can anybody help?




More information about the Python-list mailing list