473,503 Members | 2,173 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

print time comparison: IDLE versus terminal on ultra 20

sam
hi all,

i continue to footle around on my spanking new ultra 20 (1.8GHz /
Opteron Model 144), gradually trying to get to grips with python and
unix both.

the slow print time in IDLE had already struck me as rather odd.
running programs with heavy print requirements from the terminal was a
major discovery though, printing being so fast as to make everything
appear at once except in the case of literally thousands of items to be
printed.

test case:

import time

time1 = time.time()
for i in range(100):
print 'go get \'em, son!'
time2 = time.time()

print time2-time1
in IDLE:
4.433 seconds

in terminal:
0.001 seconds

a difference of between 3 and 4 orders of magnitude is rather striking.
anyone know what's going on here? is it a python, a unix thing, or
something else?

sam

Oct 8 '06 #1
5 1837
sam wrote:
in IDLE:
4.433 seconds
IDLE is designed for tinkering, not fast handling of non-trivial amounts
of output (it runs your program in a separate process and pipes data
to the interactive window over the network. and the interactive seems
to be redrawing the display for every line that arrives...)

but on the other hand, IDLE runs your sample script in less than 0.5
seconds on my cheap Windows box. complain to Sun ;-)

</F>

Oct 8 '06 #2
sam
i was actually experimenting on windows on my own pc before the
workstation arrived, and IDLE printed a lot faster on windows than in
solaris for me too.

i would indeed complain to sun if i had ever got the impression that
anyone over there ever knew what was going on... : )
but on the other hand, IDLE runs your sample script in less than 0.5
seconds on my cheap Windows box. complain to Sun ;-)

</F>
Oct 8 '06 #3
On my Ultra 20 box, the test program takes 0.00039982 secs in a
terminal window and 0.236839 secs in IDLE, i.e. about 600x slower.
This is ActivePython 2.4.3 for Solaris 10 on a 2+ GHz Opteron.

A partial explanation for the difference in run time between terminal
and IDLE is that IDLE uses thru a Tkinter/Tcl/Tk window which
postprocesses the output, like colorizing, etc.

/Jean Brouwers

PS) On MacOS X 10.3.9 and a 400 MHz G4 the terminal time is 0.172556
secs and IDLE takes between 4.04731 and 4.87804 secs (depending on the
options selected) or 24-28x longer . This is Python 2.4.3, IDLE 1.1.3
and Tcl/Tk 8.4.13 as distributed with MacOS X.
sam wrote:
hi all,

i continue to footle around on my spanking new ultra 20 (1.8GHz /
Opteron Model 144), gradually trying to get to grips with python and
unix both.

the slow print time in IDLE had already struck me as rather odd.
running programs with heavy print requirements from the terminal was a
major discovery though, printing being so fast as to make everything
appear at once except in the case of literally thousands of items to be
printed.

test case:

import time

time1 = time.time()
for i in range(100):
print 'go get \'em, son!'
time2 = time.time()

print time2-time1
in IDLE:
4.433 seconds

in terminal:
0.001 seconds

a difference of between 3 and 4 orders of magnitude is rather striking.
anyone know what's going on here? is it a python, a unix thing, or
something else?

sam
Oct 8 '06 #4
sam
i forgot to mention that i'm running a version of python 2.3 (think
it's 2.3.5), as that's what was installed and i'm not hooked up to the
internet with the ultra 20 yet. that may account for some of the
difference.

sam

Oct 9 '06 #5
With the binaries /usr/sfw/bin/python and /usr/sfw/bin/idle the results
are 0.002279 resp. 0.222831 secs for the same print test.

The Python version is 2.3.3 and IDLE version 1.0.2 on the same Ultra 20
Opteron box running Solaris 10.

/Jean Brouwers


sam wrote:
i forgot to mention that i'm running a version of python 2.3 (think
it's 2.3.5), as that's what was installed and i'm not hooked up to the
internet with the ultra 20 yet. that may account for some of the
difference.

sam
Oct 10 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
7363
by: Ashot | last post by:
This is sort of both Python and Vim related (which is why I've posted to both newsgroups). Python related: ---------------------- I have been frustrated for quite some time with a lack of a...
17
3968
by: los | last post by:
Hi, I'm trying to create a program similar to that of Google's desktop that will crawl through the hard drive and index files. I have written the program and as of now I just put the thread to...
1
4120
by: Craig S | last post by:
I've implemented most of the Terminal Services API in C# 2.0 (as documented here: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/termserv/termserv/wtsquerysessioninformation.asp )...
33
7372
by: ram.ragu | last post by:
hi i have problem to calculate idle time of cpu and if idle time is more then i have to shut down the system. can anyone tell me the idea to so that please
9
4838
by: James Wong | last post by:
Hi, I use the RichTextBox in my program. It will use different language in this RichTextBox (chinese and english characters), and it set the "DualFont" and use different fonts. By the way, how...
7
5681
by: =?gb2312?B?yMvR1MLkyNXKx8zs0cSjrM37vKvM7NHEsru8+7z | last post by:
Who could explain the follow issue ? ¦¤ Traceback (most recent call last): File "<stdin>", line 1, in <module> UnicodeEncodeError: 'gbk' codec can't encode character u'\x80' in position 0: il...
8
1712
by: news.microsoft.com | last post by:
PHP versus Microsoft ASP.net - A Straightforward Comparison "I do ask that you read this article with an open mind, and consider that it is quite possible that PHP is no better or worse...
13
3177
by: damonwischik | last post by:
I'd like to print out a unicode string. I'm running Python inside Emacs, which understands utf-8, so I want to force Python to send utf-8 to sys.stdout. From what I've googled, I think I need...
3
2578
by: Only-Trouble | last post by:
Hi all I am running openSUSE 10.3 I am learning python on my own, it seems like the system has already installed a python IDLE The question is how to invoke it? Thanks Only-Trouble
0
7205
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7287
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7349
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7008
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7467
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5022
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4688
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3168
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
399
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.