Typophile

Mac stamina indicator, please help

yanone

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

MacBookPro8,1 4x2.4GHz 768

Interesting concept!
But why Mac-only?

hhp

Here are some more:

MacPro1,1 4x2.66GHz 851

MacBookAir3,2 2x1.86GHz 297

iMac11,3 4x2.8GHz 896

MacBookPro8,2 8x2.0GHz 1280

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

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

MacBookPro8,3 8x2.2GHz 1408

Nina wins!

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

Hi Yanone. This is what I got.

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.

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

iMac12,2 4x2.7GHz 864

(Python 2.6.1 on Snow Leopard, if it matters)

iMac11,3 4x3.2GHz 1024

MacPro5,1 8x2.8GHz 1792

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

MacPro4,1 16x2.26GHz 2892

I get
Permission denied

MacPro 3,1 12x3Ghz

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

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

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

Just dumped the useless stuff after seeing Mark's post

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

hhp

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

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

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

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

I actually ran it from within FontLab!

Thanks, Mark! That was it!

Here is the result after following Mark's directions:

iMac12,2 8x3.4GHz 2176

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

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

MacBookPro6,2 4x2.4GHz 768

Captured from web.archive.org on 15 Feb 2013. view this capture