Mac stamina indicator, please help

Primary tabs

30 posts / 0 new
Last post
Yanone's picture
Offline
Joined: 11 Dec 2007 - 3:19am
Mac stamina indicator, please help
0

Hi everyone,

for a CPU intensive piece of software I’m writing I’m contemplating to integrate an integer value representing the computer’s speed into the code to receive the best fidelity/performance ratio. To see if this returns useful results on your Macs, could you please run this code locally on your computer and post results back here?

Python code

Thank you

Blank's picture
Offline
Joined: 25 Sep 2006 - 2:15pm
0

MacBookPro8,1 4x2.4GHz 768

Hrant H Papazian's picture
Joined: 3 May 2000 - 11:00am
0

Interesting concept!
But why Mac-only?

hhp

Mark Simonson's picture
Offline
Joined: 3 Dec 2001 - 11:00am
0

Here are some more:

MacPro1,1 4x2.66GHz 851

MacBookAir3,2 2x1.86GHz 297

iMac11,3 4x2.8GHz 896

Craig Eliason's picture
Offline
Joined: 19 Mar 2004 - 1:44pm
0

MacBookPro8,2 8x2.0GHz 1280

Yanone's picture
Offline
Joined: 11 Dec 2007 - 3:19am
0

@hrant

This particular code relies on the sysctl command and should work on more UNIXes, I guess. I’m working on a plugin for Glyphs and RoboFont, so Windows is not of interest at the moment.
The last number in the output would be the maximum amount of items the plugin draws into the glyph view before rendering slows down. The more, the better the illustration, the slower. But I don’t want to compromise on snappiness.

Chris Lozos's picture
Offline
Joined: 25 Feb 2004 - 11:00am
0

I get an err message from Terminal running the code.

I am running iMac on Lion:

Hardware Overview:

Model Name: iMac
Model Identifier: iMac12,2
Processor Name: Intel Core i7
Processor Speed: 3.4 GHz
Number of Processors: 1
Total Number of Cores: 4
L2 Cache (per Core): 256 KB
L3 Cache: 8 MB
Memory: 16 GB

Nina Stössinger's picture
Joined: 19 Jun 2006 - 3:01pm
0

MacBookPro8,3 8x2.2GHz 1408

Yanone's picture
Offline
Joined: 11 Dec 2007 - 3:19am
0

Nina wins!

@dezcom:
That's exactly why I was posting this. Could you please share the error message?

Sevag B. Martouni's picture
Joined: 10 Oct 2010 - 2:38am
0

Hi Yanone. This is what I got.

Yanone's picture
Offline
Joined: 11 Dec 2007 - 3:19am
0

Interesting :)
You need to save the file somewhere and then run it in the Terminal thusly: "python stamina.py" given you’re already in the correct directory. If not, "cd" first.

Sevag B. Martouni's picture
Joined: 10 Oct 2010 - 2:38am
0

Voilà — MacBookPro5,3 2x2.66GHz 425

Riccardo Sartori's picture
Joined: 13 Jul 2009 - 4:20am
0

iMac12,2 4x2.7GHz 864

(Python 2.6.1 on Snow Leopard, if it matters)

Pablo Impallari's picture
Offline
Joined: 1 Feb 2010 - 1:12am
0

iMac11,3 4x3.2GHz 1024

Ramiro Espinoza's picture
Offline
Joined: 1 Aug 2002 - 9:32am
0

MacPro5,1 8x2.8GHz 1792

Yanone's picture
Offline
Joined: 11 Dec 2007 - 3:19am
0

Thank you everyone. I think these are more or less useful results.

Paul van der Laan's picture
Joined: 4 Mar 2007 - 8:56am
0

MacPro4,1 16x2.26GHz 2892

Bert Vanderveen's picture
Offline
Joined: 13 Jun 2004 - 8:19am
0

I get
Permission denied

MacPro 3,1 12x3Ghz

Yanone's picture
Offline
Joined: 11 Dec 2007 - 3:19am
0

@Paul: Holy shit! You win.

@Bert Vanderveen: Permission denied on what? Executing stamina.py (either change permissions with "chmod 755 stamina.py" or simply use "python stamina.py") or with executing the sysctl call inside the Python code? The latter would be not so good for me.

Ramiro Espinoza's picture
Offline
Joined: 1 Aug 2002 - 9:32am
0

I protest, Mr. Pvanderlaan submitted after the deadline! :)

Chris Lozos's picture
Offline
Joined: 25 Feb 2004 - 11:00am
0

Yanone: Here is the big-ass message:
---snip

Just dumped the useless stuff after seeing Mark's post

Hrant H Papazian's picture
Joined: 3 May 2000 - 11:00am
0

Paul, exactly what kind of type design are you doing? ;-)

hhp

Reynir Heiðberg Stefánsson's picture
Joined: 19 Nov 2010 - 11:15am
0

@dezcom – Yuck! Obviously, bash is acting as if stamina.py was a shell script instead of passing the script to the Python interpreter as it should. Workaround: 'python stamina.py'.

Aside: Tried running stamina.py on a Linux box, but since it does not have the sysctl program, the result was predictably limited.

Mark Simonson's picture
Offline
Joined: 3 Dec 2001 - 11:00am
0

Chris, it looks like you're trying to run it directly in the terminal, maybe by pasting code? Try doing this instead:

1. At the terminal prompt, type "python " including the space, but not the quotes, and don't hit return yet.
2. Drag the "stamina.py" file onto the terminal window. (This enters the path to the script.)
3. Now hit return. (Be sure Terminal is the front-most app when you do this.)

Mark Simonson's picture
Offline
Joined: 3 Dec 2001 - 11:00am
0

BTW, you can run scripts like this directly from text editors such as Textmate and BBEdit. The results are displayed in a new window.

Craig Eliason's picture
Offline
Joined: 19 Mar 2004 - 1:44pm
0

BTW, you can run scripts like this directly from text editors such as Textmate and BBEdit

I actually ran it from within FontLab!

Chris Lozos's picture
Offline
Joined: 25 Feb 2004 - 11:00am
0

Thanks, Mark! That was it!

Here is the result after following Mark's directions:

iMac12,2 8x3.4GHz 2176

Paul van der Laan's picture
Joined: 4 Mar 2007 - 8:56am
0

Happy to see that my FontLab is crashing fastest! :o)

Bert Vanderveen's picture
Offline
Joined: 13 Jun 2004 - 8:19am
0

Mark’s tip did the trick! Result:
MacPro3,1 8x3.0GHz 1920

Jabez's picture
Offline
Joined: 24 Jul 2007 - 11:38pm
0

MacBookPro6,2 4x2.4GHz 768