This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Laurens
Recipients Laurens, eric.smith
Date 2011-02-04.10:40:17
SpamBayes Score 4.5339936e-09
Marked as misclassified No
Message-id <1296816018.7.0.98439320731.issue11114@psf.upfronthosting.co.za>
In-reply-to
Content
Correction: the problem also exists in version 3.1. I created a benchmark program an ran it on my machine (iMac, snow leopard 10.6), with the following results:

------------------------------------------
2.6.6 (r266:84292, Dec 30 2010, 09:20:14) 
[GCC 4.2.1 (Apple Inc. build 5664)]
result: 0.0009 s.
------------------------------------------
2.7.1 (r271:86832, Jan 13 2011, 07:38:03) 
[GCC 4.2.1 (Apple Inc. build 5664)]
result: 0.0008 s.
------------------------------------------
3.1.3 (r313:86882M, Nov 30 2010, 09:55:56) 
[GCC 4.0.1 (Apple Inc. build 5494)]
result: 9.5682 s.
------------------------------------------
3.2rc2 (r32rc2:88269, Jan 30 2011, 14:30:28) 
[GCC 4.2.1 (Apple Inc. build 5664)]
result: 8.3531 s.

Removing the line containing "tell" gives the following results:

------------------------------------------
2.6.6 (r266:84292, Dec 30 2010, 09:20:14) 
[GCC 4.2.1 (Apple Inc. build 5664)]
result: 0.0007 s.
------------------------------------------
2.7.1 (r271:86832, Jan 13 2011, 07:38:03) 
[GCC 4.2.1 (Apple Inc. build 5664)]
result: 0.0006 s.
------------------------------------------
3.1.3 (r313:86882M, Nov 30 2010, 09:55:56) 
[GCC 4.0.1 (Apple Inc. build 5494)]
result: 0.0093 s.
------------------------------------------
3.2rc2 (r32rc2:88269, Jan 30 2011, 14:30:28) 
[GCC 4.2.1 (Apple Inc. build 5664)]
result: 0.0007 s.


(Apparently, reading a file became a lot faster from 3.1 to 3.2.)

Conclusion: Execution of file.tell() makes the program about 10000 times slower.

Remark: the file mdutch.txt is a dummy text file containing 1000 lines with one word on each line.
History
Date User Action Args
2011-02-04 10:40:18Laurenssetrecipients: + Laurens, eric.smith
2011-02-04 10:40:18Laurenssetmessageid: <1296816018.7.0.98439320731.issue11114@psf.upfronthosting.co.za>
2011-02-04 10:40:18Laurenslinkissue11114 messages
2011-02-04 10:40:17Laurenscreate