New to Typophile? Accounts are free, and easy to set up.
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?
Thank you
8 Feb 2012 — 11:22am
MacBookPro8,1 4x2.4GHz 768
8 Feb 2012 — 12:13pm
Interesting concept!
But why Mac-only?
hhp
8 Feb 2012 — 12:20pm
Here are some more:
MacPro1,1 4x2.66GHz 851
MacBookAir3,2 2x1.86GHz 297
iMac11,3 4x2.8GHz 896
8 Feb 2012 — 1:03pm
MacBookPro8,2 8x2.0GHz 1280
8 Feb 2012 — 2:47pm
@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.
8 Feb 2012 — 3:06pm
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
8 Feb 2012 — 3:13pm
MacBookPro8,3 8x2.2GHz 1408
8 Feb 2012 — 3:18pm
Nina wins!
@dezcom:
That's exactly why I was posting this. Could you please share the error message?
8 Feb 2012 — 3:28pm
Hi Yanone. This is what I got.
8 Feb 2012 — 3:33pm
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.
8 Feb 2012 — 3:54pm
Voilà —
MacBookPro5,3 2x2.66GHz 4258 Feb 2012 — 3:55pm
iMac12,2 4x2.7GHz 864
(Python 2.6.1 on Snow Leopard, if it matters)
8 Feb 2012 — 8:36pm
iMac11,3 4x3.2GHz 1024
9 Feb 2012 — 1:05am
MacPro5,1 8x2.8GHz 1792
9 Feb 2012 — 2:17am
Thank you everyone. I think these are more or less useful results.
9 Feb 2012 — 3:45am
MacPro4,1 16x2.26GHz 2892
9 Feb 2012 — 4:11am
I get
Permission denied
MacPro 3,1 12x3Ghz
9 Feb 2012 — 4:48am
@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.
9 Feb 2012 — 9:26am
I protest, Mr. Pvanderlaan submitted after the deadline! :)
9 Feb 2012 — 11:29am
Yanone: Here is the big-ass message:
---snip
Just dumped the useless stuff after seeing Mark's post
9 Feb 2012 — 10:20am
Paul, exactly what kind of type design are you doing? ;-)
hhp
9 Feb 2012 — 10:53am
@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.
9 Feb 2012 — 10:56am
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.)
9 Feb 2012 — 11:02am
BTW, you can run scripts like this directly from text editors such as Textmate and BBEdit. The results are displayed in a new window.
9 Feb 2012 — 11:11am
I actually ran it from within FontLab!
9 Feb 2012 — 11:25am
Thanks, Mark! That was it!
Here is the result after following Mark's directions:
iMac12,2 8x3.4GHz 2176
9 Feb 2012 — 2:11pm
Happy to see that my FontLab is crashing fastest! :o)
13 Feb 2012 — 1:20am
Mark’s tip did the trick! Result:
MacPro3,1 8x3.0GHz 1920
13 Feb 2012 — 1:37am
MacBookPro6,2 4x2.4GHz 768