Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Apr 25th, 2005, 9:22 AM   #21
Moldz
Programmer
 
Moldz's Avatar
 
Join Date: Feb 2005
Posts: 54
Rep Power: 4 Moldz is on a distinguished road
Why not profile the programs? Check out the profile module, it should give you plenty of info on how to measure the programs.
Moldz is offline   Reply With Quote
Old Apr 25th, 2005, 11:14 AM   #22
Berto
Programming Guru
 
Join Date: Aug 2004
Posts: 1,022
Rep Power: 6 Berto is on a distinguished road
Send a message via AIM to Berto Send a message via MSN to Berto
yeah but the program is being run on the same machine so speed of processor is irrelevant if doing in copntrolled enviroment.
Berto is offline   Reply With Quote
Old Apr 25th, 2005, 11:52 AM   #23
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
The number of instructions would be calculated like this (I think):
variable = function("Something" + str(num))
         ^    ^                 ^  ^
         |    |                 |  |
I count four instructions here - assignment to a variable, two function calls, and string concatenation.
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Old Apr 25th, 2005, 12:02 PM   #24
Berto
Programming Guru
 
Join Date: Aug 2004
Posts: 1,022
Rep Power: 6 Berto is on a distinguished road
Send a message via AIM to Berto Send a message via MSN to Berto
ah but how many instructions does the function calls take?
Berto is offline   Reply With Quote
Old Apr 25th, 2005, 12:21 PM   #25
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
I was just thinking that myself, actually. Shall we just say "who cares"?
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Old Apr 26th, 2005, 3:48 AM   #26
Berto
Programming Guru
 
Join Date: Aug 2004
Posts: 1,022
Rep Power: 6 Berto is on a distinguished road
Send a message via AIM to Berto Send a message via MSN to Berto
yeah but the problem with that is someone could write a custom function that takes less instructions then a library one but we cant tell :/
Berto is offline   Reply With Quote
Old Apr 26th, 2005, 2:04 PM   #27
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
True... how about "functions don't count"?
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Old Apr 26th, 2005, 8:46 PM   #28
hydroxide
Programmer
 
Join Date: Apr 2005
Posts: 73
Rep Power: 4 hydroxide is on a distinguished road
Why not just number of non-whitespace characters?

x ="""
code goes here
"""
print len([c for c in x if not c.isspace()]) # the lower the better.

--OH.

Last edited by hydroxide; Apr 26th, 2005 at 8:51 PM.
hydroxide is offline   Reply With Quote
Old Apr 27th, 2005, 1:51 PM   #29
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
That could work too, but you'd end up with stupidly-named variables. Apart from that, it's not bad.
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 10:22 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC