Technical question about the Core 2 Duo and Mac OS X

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

Tord Romstad
Posts: 1808
Joined: Wed Mar 08, 2006 9:19 pm
Location: Oslo, Norway

Re: Technical question about the Core 2 Duo and Mac OS X

Post by Tord Romstad »

hgm wrote:This estimate is for the same (32-bit) binary. For 64-bit you get an extra acceleration, which of course strongly depends on how much 64-bit arithmetic you do compared to 32-bit stuff. For the 64-bit stuff itself it could be more than a factor 2.
Thanks, that sounds a lot better! Apparently my program gains about 30% when moving from 32-bit to 64-bit, so based on your numbers I can expect a total speedup of around 1.08 x 1.2 x 1.3 = 1.6848 when going from the 2 GHz Core Duo to the 2.16 GHz Core 2 Duo. Not bad.

Tord
Tord Romstad
Posts: 1808
Joined: Wed Mar 08, 2006 9:19 pm
Location: Oslo, Norway

Re: Technical question about the Core 2 Duo and Mac OS X

Post by Tord Romstad »

sje wrote:The day will eventually come when Apple will say "no more 32 bit support" and so the Core Solo/Core Duo machines will no longer have OS level software maintenance while the Core 2 Duo and later models will still be on the train.
Yes, certainly, but this will happen so far into the future that I don't care at all.
Also, the Mac Pro Book is expected to be updated in a week or so.
I know, but unless they release a new and smaller model, I am not interested. The 15" MBP is far too big to be usable as a portable computer, IMHO. Nevertheless, I will wait and see what is released the next couple of weeks. I have no very urgent need of a new computer.

Tord
User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 7:43 pm

Re: Technical question about the Core 2 Duo and Mac OS X

Post by sje »

I have three G3 Macs (2000 Powerbook, 2000 iMac, and a 2002 iBook) that all will become somewhat unsupported soon. These machines are still quite useful to me and it's an annoyance that Apple is pushing too hard for owners to get new machinery.

The new MBP is supposed to be lighter than the current model although probably not any smaller. I have the current (October 2006) model and there's no portability problems for me. Admittedly, I don't travel much anymore, but when I do the MBP isn't really much more to carry than the old 12 inch iBook. This is especially true after the notebook carrying bag for either is loaded with an extra battery, pens, papers, CD-ROM blanks, etc.

I still use the 12 inch iBook, though. In fact, I recently got new battery for it (its fourth one) along with a Bluetooth adapter.

There is the persistent rumor of an extra thin 12 inch MBP running flash only and with an LED backlight and no optical drive. I'm sure the price will be quite high.
diep
Posts: 1822
Joined: Thu Mar 09, 2006 11:54 pm
Location: The Netherlands

Re: Technical question about the Core 2 Duo and Mac OS X

Post by diep »

Tord Romstad wrote:
hgm wrote:This estimate is for the same (32-bit) binary. For 64-bit you get an extra acceleration, which of course strongly depends on how much 64-bit arithmetic you do compared to 32-bit stuff. For the 64-bit stuff itself it could be more than a factor 2.
Thanks, that sounds a lot better! Apparently my program gains about 30% when moving from 32-bit to 64-bit, so based on your numbers I can expect a total speedup of around 1.08 x 1.2 x 1.3 = 1.6848 when going from the 2 GHz Core Duo to the 2.16 GHz Core 2 Duo. Not bad.

Tord
OS/X 64 bits has the gcc 4.0.1 inside it's notorious crappy beginners x-code compiler for os/x 10.4.9, which is the latest version currently.

That is a joke of a compiler for good chips like K8 and Core2.

There goes 30% performance...

GCC is especially bad for 64 bits code optimizations. Don't compare yourself to crafty; crafty is open source, they all managed to optimize a tad for crafty. If you're using a bit different datastructure, then 64 bits goes very bad.

In my case, some sample programs in 64 bits were 50% faster with visual c++ net2005 with pgo than latest gcc with pgo. That was tested at opteron. At core2 it's even worse.

GCC is very ugly bad there, especially if you prefer generic code rather than program out very tiny thing.

Especially try to avoid the 128 bits defines that GCC offers, a nice idea it is, but it is so so ugly bad in optimizing them.

At core2 laptops pgo from visual c++ net2005 gives diep 20+% speedup, versus 11.3% for AMD-k8. GCC again is at the wrong side there of the medal.

Vincent

p.s. about OS/X:

OS/X needs better debuggers, a better source code editor, such as multiedit is a great one for windoze, and they need to trash all their stupid mouses and keyboards, especially that 1-button mouse is a joke now that 99% of planet is used to rightbutton click a lot with mouse, besides that their 1 button mouses are causing a bunchlot of RSI problems more than normal mouses do, and resizing windows is a disaster as you need each time move your mouse to the right bottom corner instead that on every edge of the window you can resize. In GENERAL users always have their mouse a bit left in windows anyway, so resizing in the right bottom corner doesn't make sense anyway.

Also gcc 4.0.1 is just too much of a joke for such nice processors, and it is beyond any help of improvement.

And for all that you pay 30% more than PC equivalents.

Only take that macbookpro i'd say if you get it for free.
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Technical question about the Core 2 Duo and Mac OS X

Post by bob »

diep wrote:
Tord Romstad wrote:
hgm wrote:This estimate is for the same (32-bit) binary. For 64-bit you get an extra acceleration, which of course strongly depends on how much 64-bit arithmetic you do compared to 32-bit stuff. For the 64-bit stuff itself it could be more than a factor 2.
Thanks, that sounds a lot better! Apparently my program gains about 30% when moving from 32-bit to 64-bit, so based on your numbers I can expect a total speedup of around 1.08 x 1.2 x 1.3 = 1.6848 when going from the 2 GHz Core Duo to the 2.16 GHz Core 2 Duo. Not bad.

Tord
OS/X 64 bits has the gcc 4.0.1 inside it's notorious crappy beginners x-code compiler for os/x 10.4.9, which is the latest version currently.

That is a joke of a compiler for good chips like K8 and Core2.

There goes 30% performance...

GCC is especially bad for 64 bits code optimizations. Don't compare yourself to crafty; crafty is open source, they all managed to optimize a tad for crafty. If you're using a bit different datastructure, then 64 bits goes very bad.
That's silly. I've changed Crafty several times with respect to the data structures, the way I generate moves, and so forth. No way compiler people are continually studying every change I make so that they can optimize the thing better. In fact, I am no longer using rotated bitboards, so are they going to start optimizing magic move generation now???


In my case, some sample programs in 64 bits were 50% faster with visual c++ net2005 with pgo than latest gcc with pgo. That was tested at opteron. At core2 it's even worse.

GCC is very ugly bad there, especially if you prefer generic code rather than program out very tiny thing.

Especially try to avoid the 128 bits defines that GCC offers, a nice idea it is, but it is so so ugly bad in optimizing them.

At core2 laptops pgo from visual c++ net2005 gives diep 20+% speedup, versus 11.3% for AMD-k8. GCC again is at the wrong side there of the medal.

Vincent

p.s. about OS/X:

OS/X needs better debuggers, a better source code editor, such as multiedit is a great one for windoze, and they need to trash all their stupid mouses and keyboards, especially that 1-button mouse is a joke now that 99% of planet is used to rightbutton click a lot with mouse, besides that their 1 button mouses are causing a bunchlot of RSI problems more than normal mouses do, and resizing windows is a disaster as you need each time move your mouse to the right bottom corner instead that on every edge of the window you can resize. In GENERAL users always have their mouse a bit left in windows anyway, so resizing in the right bottom corner doesn't make sense anyway.

Also gcc 4.0.1 is just too much of a joke for such nice processors, and it is beyond any help of improvement.

And for all that you pay 30% more than PC equivalents.

Only take that macbookpro i'd say if you get it for free.
Tord Romstad
Posts: 1808
Joined: Wed Mar 08, 2006 9:19 pm
Location: Oslo, Norway

Re: Technical question about the Core 2 Duo and Mac OS X

Post by Tord Romstad »

Hello Vincent,

Thanks for your input. Your advice is good, but doesn't really apply to me: My needs, goals, preferences and style of work simply differ so much from yours that the points you make, although mostly correct, have no relevance to me.

Some further remarks below, but let me first say that I don't want this thread to become an OS war. Religious OS wars are silly, for a number of reasons. There is no OS which is right for everyone; it depends on your needs, preferences and experience, and on what people around you use. Also, none of the popular operating systems are anywhere close to perfect, nor even very good. People who praise some specific OS for being phenomenally good are either ignorant, unimaginative, or dishonest. Linux, Windows and OS X all suck, although the degree of their suckiness depends on what area you focus on.

Windows is not an option for me, because I rely heavily on all sorts of Unix software, both professionally and privately, and because using Windows would alienate me from everybody around me (I live in a very backwards world, where Windows computers hardly exist). Mac OS X, Linux and FreeBSD are the only realistic options. Because I hate making my hands dirty by compiling things myself, maintaining my computer, or hunting for drivers for new hardware, using Mac OS X is currently most convenient.

From a chess programming point of view, switching to Windows wouldn't buy me anything except a bigger number of sparring partners and slightly less time spent on testing (because the better compiler would enable me to reduce the time controls somewhat). Because computer chess is neither the only nor the most important use for my computer, this doesn't matter much.

Another point is that the Windows world doesn't need a decent free chess program as much as the Mac OS X world. Windows has Arena and Winboard, Mac OS X currently has no decent free chess program at all, and even the commercial options leave a lot to be desired compared to their Windows counterparts. It is therefore much more worthwile to spend my efforts on a Mac program.

Regarding the specific points you make:
  • It is without a doubt true that the Microsoft compiler is faster than GCC, but who cares? My program is open source, so everyone is free to compile it on the compiler they want.
  • I agree that XCode is awful, but as I detest IDEs and never use IDEs debuggers when writing in C/C++, I don't care. I don't really debug my program at all. If something doesn't work and it is not obvious why it doesn't work, it is a sure sign that my code has grown too complex, and it's time to rewrite and simplify. I realize that most people probably consider this a strange way of working, but I am not a programmer and can't work the way you other guys do. Unless I have a completely interactive and immersive environment, where the program, the compiler and the debugger are one and the same (as in SmallTalk, Lisp or Factor), trying to debug a program makes me feel physically ill. Good tools don't help. Avoiding bugs in the first place is the only approach which work for me.
  • I have no desire to use any other text editor than GNU Emacs. Emacs has numerous weaknesses and annoyances (the biggest two for me is Emacs Lisp and the lack of multithreading), but it has other features I can't live without: It is free, cross-platform, and doesn't require a GUI. There are also a lot of packages and libraries I depend upon in my work (ange-ftp, SLIME, paredit, gnus, ...), and on top of this I have lots of customizations and Elisp code of my own, written to make Emacs behave exactly as I want it. In theory, it would certainly be possible to achieve a similar level of productivity with some other editor, but it would require months or years of effort, for no useful purpose.
  • Mac OS X has supported multiple mouse buttons for more than a decade, and all the desktop Macs on the market today are delivered with a two-button mouse in the default configurations (to be completely precise, the mouse has no buttons at all, but it detects which half of the mouse you press). By default, both mouse buttons have the same function (because this is claimed to be less confusing for non-technical users), but the right button can be enabled from the system preferences. The trackpads on the laptops have only a single button, but you can do the equivalent of a right click by tapping with two fingers instead of one. You can also scroll (vertically, horizontally or diagonally) by dragging two fingers on the trackpad. To me, this works better than a trackpad with two or three buttons. YMMV, as always.
  • It is true that resizing windows is more inconvenient in OS X (with the default settings and no hacks installed) than in Windows. On the other hand, other common operations like accessing menus or switching between programs or windows is faster and easier in OS X. I personally resize windows extremely rarely, and access menus or switch between programs quite often. For other users, it is of course different.
And for all that you pay 30% more than PC equivalents.
Not here in Norway. With some effort, I could probably find a similarly speced Windows of Linux laptop which is cheaper than the MacBook, but nothing which is 30% cheaper. And in any case, computers are always cheap. The expensive thing is to afford a house to contain them. :wink:
Only take that macbookpro i'd say if you get it for free.
I wouldn't even take it for free - it's too big for me, as pointed out elsewhere in the thread. I prefer the normal MacBook.

Tord
Guetti

Re: Technical question about the Core 2 Duo and Mac OS X

Post by Guetti »

Tord Romstad wrote:Hello Vincent,

Thanks for your input. Your advice is good, but doesn't really apply to me: My needs, goals, preferences and style of work simply differ so much from yours that the points you make, although mostly correct, have no relevance to me.

Some further remarks below, but let me first say that I don't want this thread to become an OS war. Religious OS wars are silly, for a number of reasons. There is no OS which is right for everyone; it depends on your needs, preferences and experience, and on what people around you use. Also, none of the popular operating systems are anywhere close to perfect, nor even very good. People who praise some specific OS for being phenomenally good are either ignorant, unimaginative, or dishonest. Linux, Windows and OS X all suck, although the degree of their suckiness depends on what area you focus on.
This reminds me of this:

http://www.youtube.com/watch?v=K2eHogj9CVE

:twisted:
Guetti

Re: Technical question about the Core 2 Duo and Mac OS X

Post by Guetti »

Tord Romstad wrote:
  • I agree that XCode is awful, ...
Jesus, what do all you people have against Xcode? I find it quite useable, even though I don't need all it's features.
Alessandro Scotti

Re: Technical question about the Core 2 Duo and Mac OS X

Post by Alessandro Scotti »

Guetti wrote:Jesus, what do all you people have against Xcode? I find it quite useable, even though I don't need all it's features.
Well I use it all the time too, but I agree with the "awful" comment and actually l have something much worse in mind! It is by far the buggiest and less intuitive environment I have used in the past few years, not even "Find" works as it should (a bug that I signaled to Apple a long time ago and is still not patched)!
User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 7:43 pm

Re: Technical question about the Core 2 Duo and Mac OS X

Post by sje »

I note that the online Apple Store is down for updating as I type this -- the new MacBook Pro models should be announced within an hour or so.