Mac stamina indicator, please help

yanone's picture

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

MacBookPro8,1 4x2.4GHz 768

hrant's picture

Interesting concept!
But why Mac-only?

hhp

Mark Simonson's picture

Here are some more:

MacPro1,1 4x2.66GHz 851

MacBookAir3,2 2x1.86GHz 297

iMac11,3 4x2.8GHz 896

eliason's picture

MacBookPro8,2 8x2.0GHz 1280

yanone's picture

@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.

dezcom's picture

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's picture

MacBookPro8,3 8x2.2GHz 1408

yanone's picture

Nina wins!

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

sevag's picture

Hi Yanone. This is what I got.

yanone's picture

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's picture

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

riccard0's picture

iMac12,2 4x2.7GHz 864

(Python 2.6.1 on Snow Leopard, if it matters)

PabloImpallari's picture

iMac11,3 4x3.2GHz 1024

Ramiro Espinoza's picture

MacPro5,1 8x2.8GHz 1792

yanone's picture

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

pvanderlaan's picture

MacPro4,1 16x2.26GHz 2892

Bert Vanderveen's picture

I get
Permission denied

MacPro 3,1 12x3Ghz

yanone's picture

@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

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

dezcom's picture

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

Just dumped the useless stuff after seeing Mark's post

hrant's picture

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

hhp

Té Rowan's picture

@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

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

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

eliason's picture

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

I actually ran it from within FontLab!

dezcom's picture

Thanks, Mark! That was it!

Here is the result after following Mark's directions:

iMac12,2 8x3.4GHz 2176

pvanderlaan's picture

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

Bert Vanderveen's picture

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

jabez's picture

MacBookPro6,2 4x2.4GHz 768

Syndicate content Syndicate content