Technical question about the Core 2 Duo and Mac OS X

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

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 »

New MacBook Pro: memory limit up to 4 GB, LED backlight, speed up to 2.4 GHz, GPU upgrade(?), resolution up to 1920x1200 on 17 inch model, overall performance increase of up to 50% over the first Core Duo model.
Guetti

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

Post by Guetti »

Alessandro Scotti wrote:
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)!
Just out of interest: What does not work as expected with "Find"?
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 »

In some earlier versions of Xcode (and back in its earlier incarnation as Project Builder), the global Find/Replace would occasionally fail when doing partial (manually selected) replacements. This was fixed some time ago.

Alas, at the same time, they changed the "Find Selected Text In Project" from a contextual menu pick to a menu bar sub selection. That means an extra mouse movement.

The first appearance of the distributed build feature was a little shaky. This has been improved dramatically although it still has an occasional hiccup.

--------

Xcode is supposed to get some enhancements in the Leopard release this October, although no one is expecting any dramatic changes as it still relies upon the gcc tool chain. Of much more interest is the rumored change to display resolution independence that will pave the way for very high or ultra high pixel linear counts. The idea is that few would settle for a 120 dots per inch printer, so why would anyone want a 120 DPI display? There are already monitors available for medical imaging applications that handle ten pixels per millimeter (254 DPI) and I'm sure that number can be improved if there's a market demand.
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 »

Guetti wrote:
Alessandro Scotti wrote:
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)!
Just out of interest: What does not work as expected with "Find"?
the finder doesn't find all files. Like if you search for some file it just doesn't find it at all. The only way to find it is open a bash prompt and type:

cd /
find . | grep "filename.haha"

that's the only way to find files with 100% sureness at the mac.

Thanks,
Vincent
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 »

I'm not out for a war either Tord, but let's face it, one major question remains.

A few years ago when i was dealing with some tens of designers and visited them, some of them had dual mac g4's and were complaining loud about its speed, whereas collegues of them had moved away from macos/OSX to dual K7 MP, which was at that time for them like 2-4 times faster at least not to mention up to 4 times cheaper. Some designers were very careful in telling me: "we work at windows"; they needed sometimes 10 minutes to explain why they worked in windows rather than at the mac. That much at the time mac was dominatign that scene. Those times have long gone. I can't remember having seen any laptop-g5.

Apple board been very clever choosing for intel. Now they can also sell laptops. You get the same chip for 1000 euro more yet with a shit compiler and without intel c++.

Let's list objectively a few advantages of Tords way dealing with linux rather than mac:

a) linux is at least 1000 euro a machine cheaper than the mac, especially for laptops. Just open a homepage www.pricewatch.com for example and look for yourself. Ordering from USA only gives some import tax issues in Norway. You have to add 20% for import tax probably (EU wide rules), and you still profit from the huge price difference then of linux vs mac.
b) linux has more tools and toys than mac, and you can use the superior intel c++ compiler for the intel core2 chip.
e) every tool you use works better under linux than at the mac. x-emacs for example gets installed by default at linux, how about the mac?
f) mac is closed source.
g) linux has intel c++ and you can use it for free.
h) my firewall/routing at home gets done by debian. LINUX in short. I can modify the runlevels etc. Have 100% control what the firewall is doing. How about using OS/X as a firewall?

Tord, the real question that i don't understand is: why do you use a mac instead of linux?

Vincent

p.s. that one button mouse from apple IS very bad for people who are close to having RSI, i've heard it from so many people now. They all throw away that mouse from apple and replace it by a pc-mouse.
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.

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 »

diep wrote:
Guetti wrote:
Alessandro Scotti wrote:
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)!
Just out of interest: What does not work as expected with "Find"?
the finder doesn't find all files. Like if you search for some file it just doesn't find it at all. The only way to find it is open a bash prompt and type:

cd /
find . | grep "filename.haha"

that's the only way to find files with 100% sureness at the mac.

Thanks,
Vincent
We were talking about the "Find (=Search)" function in Xcode.
Guetti

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

Post by Guetti »

diep wrote:I'm not out for a war either Tord, but let's face it, one major question remains.

A few years ago when i was dealing with some tens of designers and visited them, some of them had dual mac g4's and were complaining loud about its speed, whereas collegues of them had moved away from macos/OSX to dual K7 MP, which was at that time for them like 2-4 times faster at least not to mention up to 4 times cheaper. Some designers were very careful in telling me: "we work at windows"; they needed sometimes 10 minutes to explain why they worked in windows rather than at the mac. That much at the time mac was dominatign that scene. Those times have long gone. I can't remember having seen any laptop-g5.

Apple board been very clever choosing for intel. Now they can also sell laptops. You get the same chip for 1000 euro more yet with a shit compiler and without intel c++.

Let's list objectively a few advantages of Tords way dealing with linux rather than mac:

a) linux is at least 1000 euro a machine cheaper than the mac, especially for laptops. Just open a homepage www.pricewatch.com for example and look for yourself. Ordering from USA only gives some import tax issues in Norway. You have to add 20% for import tax probably (EU wide rules), and you still profit from the huge price difference then of linux vs mac.
b) linux has more tools and toys than mac, and you can use the superior intel c++ compiler for the intel core2 chip.
e) every tool you use works better under linux than at the mac. x-emacs for example gets installed by default at linux, how about the mac?
f) mac is closed source.
g) linux has intel c++ and you can use it for free.
h) my firewall/routing at home gets done by debian. LINUX in short. I can modify the runlevels etc. Have 100% control what the firewall is doing. How about using OS/X as a firewall?

Tord, the real question that i don't understand is: why do you use a mac instead of linux?

Vincent

p.s. that one button mouse from apple IS very bad for people who are close to having RSI, i've heard it from so many people now. They all throw away that mouse from apple and replace it by a pc-mouse.
I alway use Logitech mice on whatever computer I use, therefore I got rid of the Apple mouse on day one.

a) If you want a brand-name computer, Macs are not always more expensive: http://arstechnica.com/journals/apple.a ... -pc-prices
Not to forget, you can oder a 2.4 Ghz Core 2 duo MacBook Pro, which Sony or Dell don't even offer yet.
b) You can install and run a lot of unix tools on OS X which comes with the (optionally installed) X11 environment.
Concerning the intel compiler, every linux user that I know (including myself) uses gcc. Is there a distro that installs Intel-C++ by default?
c) + d) ?
e) I have a linux and a Mac Desktop, I can't say the linux works better. I spend 95% of the time on the Mac, including all the development (using Xcode). Never used X-Emacs, I have a expensive Logitech mouse and want to use it. There are a lot of powerful editors around for the Mac. I tried Anjuta and Eclipse on linux (what a waste of time).
f) True, but you can use a lot of open source thanks to Darwin. http://developer.apple.com/opensource/index.html
g) Didn't we have this already? The Developper Tools on OSX come with a set of handy tools for debugging, building Interfaces and performance testing (Interface Builder, gdb, Shark and soon Xray, a rewrite of DTrace).
h) The standard firewall of OSX is ipfw.

Well, what else speaks for Mac?
It's just way more fun working on OSX! 8-)
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 »

diep wrote:a) linux is at least 1000 euro a machine cheaper than the mac, especially for laptops.
I just checked the Dutch Apple Store, and found that the price for the cheapest MacBook is 1049 euro. I doubt that you can find a Linux laptop with a 2 GHz Core 2 Duo, 1 GB RAM, 80 GB hard disk space, a good LCD display and a built-in webcam for 49 euros or less.
Just open a homepage www.pricewatch.com for example and look for yourself. Ordering from USA only gives some import tax issues in Norway. You have to add 20% for import tax probably (EU wide rules), and you still profit from the huge price difference then of linux vs mac.
I would also have to pay the price of much bigger risks, because I wouldn't have the same customer rights as I get when I buy a computer from Norway. I am also one of those people who prefer to actually try the computer before I buy it. I would never buy a laptop without testing the keyboard and looking at the display. Walking down to the local Apple store and carrying the machine home is infinitely preferable to ordering something untested from the US and pray that everything will be alright, IMHO.

Besides, as I have mentioned before, price isn't a problem at all to me. I don't mind spending a couple of hundred euros for a computer I am happier with. Paying 500 euros or so every second year for a new laptop isn't really a huge expense.
b) linux has more tools and toys than mac, and you can use the superior intel c++ compiler for the intel core2 chip.
The Intel compiler exists for OS X too, although it is not free. For me it is not worth the money, as I hardly ever program in C/C++ anyway (except my chess program, which I could just send to someone who has the Intel compiler if I had a very strong need for a super-fast binary).
e) every tool you use works better under linux than at the mac.
No, they don't, at least not for my use. I have used both Linux and Mac OS X almost every day since many years, and there is not a single tool I use regularly which works better in Linux.
x-emacs for example gets installed by default at linux, how about the mac?
I don't like XEmacs; I use GNU Emacs 22 on both platforms. Mac OS X ships only with a lame console mode Emacs, but spending a minute downloading and installing the GUI version when I get a new computer isn't a big problem to me.
f) mac is closed source.
Yes. This is only one of your points which carries any great weight for me. I would never look at or play with the source code in any case, but being a strong supporter of free software, using a proprietary OS is a little troublesome.
g) linux has intel c++ and you can use it for free.
Addressed above.
h) my firewall/routing at home gets done by debian. LINUX in short. I can modify the runlevels etc. Have 100% control what the firewall is doing. How about using OS/X as a firewall?
I have no idea - I have only a vague idea of what a firewall is, and even less about routing. There is a control panel for firewall configuration in the system preferences, but whether it gives you the same level of control as you get on your GNU/Linux box, I can't tell. For me, it is of course not important at all.

In general, there is no doubt that Linux gives you more complete control of your computer than OS X, but I, like most users, have no need for that. It is much more important to me to do the most common and basic system administration tasks without any expert knowledge than to have 100% control of everything. Other users have different priorities, of course.
Tord, the real question that i don't understand is: why do you use a mac instead of linux?
Because it offers me all the Unix tools I need, while being much more comfortable to use. I have a bigger selection of multimedia programs, less problems communicating with external hardware like cameras or phones, better power managment facilities, and a much more consistent and streamlined user interface. As I said before, I have used both OSes daily for several years. There is nothing in Linux I miss in OS X, and lots of things in OS X I miss in Linux.

The only point in Linux's favor (from my point of view, of course) is the freedom. Ideologically I would without a doubt prefer using Linux, but OS X is much more pleasant to use for me. Currently, I am not sufficiently idealistic to switch to Linux. Perhaps this will change later.
p.s. that one button mouse from apple IS very bad for people who are close to having RSI, i've heard it from so many people now. They all throw away that mouse from apple and replace it by a pc-mouse.
I have several mice (whether they are "pc-mice" I am not sure, as I don't know what the term means), but I prefer the Apple mouse, mostly because I like the little ball better than the scrolling wheel of most other mice.

I've never had any RSI problems with any mouse. It seems I am not very sensitive to this kind of thing (or perhaps it's just because I usually don't use the mouse very much). All mice which are symmetrical (I hate these asymmetrical mice which can only be used in one hand) and not too big feel comfortable in my hands.

Tord
macchess

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

Post by macchess »

Tord,

Mac OS X 10.4 is 64 bit (and 32 bit). The binaries you build are embedded in a sort of container. You can stuff 32 bit G4 code in, 64 bit G5 code, 32 bit x86 code and 64 bit x86 code. They all appear in a single executable bundle. I did not manage to generate this from the command line, but from XCode 2.4, this works smooth.

Does this mean that Mac OS X the Core 2 duo is 64 bit. Yes and no. Large parts of the system related code as third party code is still 32 bit. If you run an engine for XBoard, it is most likely that you will not have any 32 bit code and everything will be 64 bit code. As for the next release in October, Apple promised that everything would be 64 bit. So you question becomes obsolete by then.

You can also run PPC code on the new Core 2 duo machines, but the raw speed through rosetta will be thrown back to an e.g. 1Ghz G4.

There are still some performance issues with Mac OS X compared to linux in the locking and pthread scheme, but each new release, those issues tend to become less important.

Compiler speeds: Since I moved to GCC 4.0.1, I do not have serious drawbacks compared to other windows machines. The default optimization however is not good enough. I did compile Crafty and with the bench command, I got very good results in comparison with VC 6.0. I did use a custom setting for compilation because crafty out of the box does not have correct tweaks for having maximum performance on Mac OS x with Core 2 duo....
That said, if 5-10% speed difference does mean getting the title,...

Under VC, you can remove exception handling, thread safe libraries, ... that will give you an extra edge pushing the difference to 30%. For me, I need this default options turned off because I make coding errors all the time.

I do run Parallels desktop with my windows development environment but I cannot use the second core. I have to reboot with bootcamp to do performance testing for the second core.

I will not reply on the Mac stuff. I am an avid Mac user and of course everything on Mac is better. Almost :-)
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 »

Tord Romstad wrote:Hello,

I am considering replacing my first-generation Core Duo MacBook with one of the new Core 2 Duo MacBooks (they got a minor speed bump a few days ago). Before I buy, I have a very basic technical question:

I've been told that the AMD 64-bit CPUs require a 64-bit OS in order to run in 64-bit mode. Is the same true for the Intel Core 2 Duo? If yes, is Mac OS X 10.4 a 64-bit OS?

If I can't run my program in 64-bit mode on the Core 2 Duo, I'll wait for OS X 10.5 before buying a new machine.

Tord
I don't know about macos, but absolutely yes to your other question. If the O/S doesn't know about it, how will it know to save r8-r15 among other things, when doing context switches? But it is more basic than that as the processor has to be put into 64 bit mode intentionally by the O/S as it boots. A non-64 bit system won't know to do that...