Question on periods in strings

Philip Bloom pbloom at crystald.com
Thu Mar 12 15:42:26 EDT 2009


Thanks.  I now know the cause of this, the suggestion to fling it in a few languages made it obvious.  All of them were sharing the issue.  Specifically that Trend MicroOffice Scan was the stalling factor, which was significantly boosting write times and if the write had any periods it would send it way off into the moon.  So yeah, the antivirus program was the culprit.

  Python was interestingly less affected than C# which saw a 15 times slowdown from the same effect.

Anyhow, sorry for bothering the list on what is clearly not a python problem, but thanks as well for helping lead me to the bottom of this mystery.


 -----Original Message-----
From: python-list-bounces+pbloom=crystald.com at python.org [mailto:python-list-bounces+pbloom=crystald.com at python.org] On Behalf Of Gabriel Genellina
Sent: Thursday, March 12, 2009 12:42 AM
To: python-list at python.org
Subject: Re: Question on periods in strings

En Wed, 11 Mar 2009 23:42:45 -0200, Philip Bloom <pbloom at crystald.com>  
escribió:

> Thanks for the welcome :)
>
> You're right.  Here's with the missed line (I was cutting out commented  
> parts).  Hopefully these are all cut/paste-able.
>
> #test A
> #runs in 5.8 seconds.
> from datetime import datetime
> testvar2='9a00'
> startTime = datetime.now()
> filehandle=open('testwriting.txt','w')
> for var in range(10000000):
>     filehandle.write(testvar2)
> filehandle.close()
> print (datetime.now() - startTime)
>
>
> #test B
> [using '9.00' -- otherwise identical]
>
> I do use the same filename, but I've run the tests in different orders  
> and it's made no difference.  Repeatedly running the same test results  
> in the same numbers with only minor fluctuations (as would be expected  
> from cache issues).  Ten runs in a row of Test B all result in about 11  
> seconds each.  Ten runs in a row of Test A all result in about 6 seconds  
> each.

I could not reproduce this. You've got better hardware than mine,  
certainly (I had to remove a 0 to get reasonable times) but I got almost  
identical results with both versions. I've tested also with 3.0 (and I had  
to take another 0 off!) with the same results.
I have no idea why you see a difference. Unless the antivirus is  
interfering, or you have some crazy driver monitoring disk activity and  
the dot triggers something...
Try using a different language - I'd say this is totally unrelated to  
Python.

-- 
Gabriel Genellina

--
http://mail.python.org/mailman/listinfo/python-list

______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________

______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________



More information about the Python-list mailing list