40
$\begingroup$

My current computer is a MacBook Air, the mid-2011 version: 4 GB RAM, 1.7 GHz Intel dual core. It runs Mathematica 9 smoothly, but a bit too slowly for my taste. I use Mathematica almost exclusively for complicated graphics-intensive calculations, e.g., high-res animations of implicit surfaces (ContourPlot3D sees lots of action around here). Supposing that my main objective is an increase in Mathematica's speed (within the stated field of use), what things should I look for in a new computer?

I can sort of guess that I should go for the largest amount of RAM and the fastest CPU (and maybe GPU) within my budget. But what exactly is the relative importance of these factors? Given a choice between an expensive unit with very fast CPU and a moderate amount of RAM, and a cheap unit with moderately fast CPU and tons of RAM, which should I choose?

What kind of speed-up can I reasonably expect, going from Mathematica on my current computer to Mathematica on a newer (off-the-shelf) unit? Is it even worth the trouble and the money to buy a new computer for Mathematica?

Sorry if this question doesn't come across as the most intelligent question in the world, but I'm a bit of an airhead when hardware-related stuff is concerned.

$\endgroup$
  • $\begingroup$ The answer depends on what sorts of problems you will be solving. For some, parallel processing (typically with four processors) can achieve a speed-up of three or so. Thus, a four-core CPU might make good sense. Since memory is cheap, get 8 Gig in any case. $\endgroup$ – bbgodfrey Dec 20 '14 at 0:00
  • $\begingroup$ This is an interesting Q given the lack of benchmarks. I'm also intersted in the Mac Pro but can only justify it if it's going to substantially improve execution time and can do ParallelCombine etc across multi-cores. $\endgroup$ – alancalvitti Dec 20 '14 at 0:24
  • $\begingroup$ GPU may be important especially if you plan to use CUDA or OpenCL. But it really is a very broad question which I don't believe has a unique answer. $\endgroup$ – Jens Dec 20 '14 at 1:16
  • $\begingroup$ possible duplicate of Hardware Performance Metrics for Mathematica $\endgroup$ – user9660 Dec 20 '14 at 4:03
  • 1
    $\begingroup$ In my subjective opinion the front end works much smoother on a mac. You might want to keep the macbook air for the front end and run the kernel elsewhere? $\endgroup$ – chris Dec 20 '14 at 9:34
28
$\begingroup$

Let me give you a start by sharing some insights. This all is purely subjective. When I buy a new computer, then I take some time to study the state of the art regarding hardware. You will never know everything because there are just too much topics, too much details and just too much to read, but with some research you can get a pretty good idea. Last time when I did this for my own pc was about 2 years ago. Here is my benchmark from today in Mathematica 10.0.2 (with overclocked settings in BIOS):

Mathematica graphics

Let me tell you upfront: You buy this kind of benchmark with money. There is no way of cleverly choosing cheap hardware and getting a super computer. The problem is that the dependency between money and computational power is not linear but highly exponential. It always follows this kind of graph:

Mathematica graphics

So when you buy the second best processor which is already very very good, then buying the best one will probably cost you much much more, although the speed increase is not really noticeable. So when you have a fixed budget, you should keep this in mind because you probably can save some money at one place and spend it in another one, where the impact on the overall power of your system is higher.

When you do much with graphics, then you should definitely care about the graphics card. The rendering of 3d graphics is done with OpenGL and runs completely in the graphics card. Although the creation of the graphics doesn't! For me, the choice here was always simple because I started with NVidia when they introduced CUDA and used it ever since. OK, one time I was forced because the Apple guys switched to ATI once.

Graphics cards are expensive; they usually cost much more than your mainboard. The German NVidia page gives you a pretty good overview what the GeForce series cost. If you want to compare them, then look out for number of CUDA cores and how much RAM they have. Note that NVidia cards are usually built by others. So you will find the same card (say Geforce GTX 980) from different vendors like MSI, ASUS, Gainward, ZOTAC, etc. They can differ in some details. I usually use ASUS because I often use ASUS mainboards. But I guess this just like the belief in god and has not really an impact.

The second big pack comes as triple: CPU, RAM, Mainboard. This is because the mainboard needs to have the correct socket for the CPU, and CPU and mainboard need to support the RAM size and type you want. I usually start by deciding what CPU I want. Intel CPU's are my favorite for two reasons: When I program something in C/C++, then I use the Intel Compiler, which works best with their own CPU's. Additionally, Mathematica uses the Intel libraries for numerical algorithms too. Choosing the CPU is probably the hardest part, because there are zillion of different types and revisions which differ not only in the frequency and number of cores and threads, but additionally in things like L1/L2/L3 cache sizes, when they were build, etc... What you probably want is a quad-core (which has 8 hyperthreads). If your budget is high enough, you could look out for the i7 series. In my two year old pc I have a i7-2700K 3.5GHz x 8 which still rocks.

For the mainboards, I usually go for a gamer product because they often support features like overclocking. The important parts of a mainboard are the chipsets that do the work. I know that my Maximus IV Extreme-Z mainboard has an Intel chipset but whether this really is necessary, I have no idea.

If you choose RAM, then I would suggest at least 8GB. I'm doing data processing very often and I have to work with 3d data. With such stuff, you can fill a large amount of RAM very quickly. That is why I chose 32GB back then. Two points: (i) Usually, you don't need that much, but on the other hand (ii) even 32GB are sometimes not enough.

Regarding hard-drive: When your budget allows it, then buy 2 hard-drives. One SSD where you install the operating system and one big normal hard-drive for your data. You will be surprised what a difference this makes because one of the (often underestimated) bottlenecks is the transfer of data from the hard-drive to the RAM during startup.

As a final note: If you don't want to build your computer from pieces but rather like to buy a complete system, then just go for a good gamer pc. They usually have exactly the properties of a very good computer, because, well, they need to be power-horses to run today's games.

$\endgroup$
  • $\begingroup$ You have an unlocked K series CPU -- why don't you run a higher multiplier? $\endgroup$ – Mr.Wizard Dec 20 '14 at 5:55
  • 1
    $\begingroup$ @Mr.Wizard Never needed it since other things need way more time than I could get back by tweaking the overclocking (e.g. me thinking or watching p*rn is one slowing factor). I turned it on for you and uploaded a new benchmark which came from 4.6GHz. $\endgroup$ – halirutan Dec 20 '14 at 6:30
  • $\begingroup$ That's more like it. That CPU is the big brother to mine so it should be faster. I think you'll find 4.6GHz quite stable; I use an offset voltage of +0.1v by the way. $\endgroup$ – Mr.Wizard Dec 20 '14 at 6:40
  • 1
    $\begingroup$ Consumer cards (GeForce) are hobbled quite badly though when it comes to CUDA performance. You get similar (but unlocked) hardware with different drivers for a multiple of the price with under the Quadro brand name which is specifically designed for enterprise use. $\endgroup$ – Yves Klett Dec 20 '14 at 7:50
  • 1
    $\begingroup$ @Mr.Wizard for older GeForce models you could make the Quadro drivers work after a fashion but last time I took a closer look (about three years ago) there were purportedly hardware blocks in place. You can still do CUDA, but not with the same number of cores that are available for rendering. Again, info may be dated, but Quadros are still ridiculously expensive, so I expect no substantial changes. $\endgroup$ – Yves Klett Dec 20 '14 at 17:32
20
$\begingroup$

Mathematica comes with benchmarking tools to help you with this problem. For example, the code below gives me a report...

Needs["Benchmarking`"]
BenchmarkReport[]

enter image description here

...which is helpful in justifying why I am asking for a new computer for Christmas.

$\endgroup$
  • $\begingroup$ Never knew that. I just did a benchmark for my own system. I have been wanting a new laptop for a long time. But I am a poor student. Most of the time, I just use the server from my university. $\endgroup$ – Chen Stats Yu Dec 20 '14 at 2:19
  • $\begingroup$ So does this mean that Mathematica runs the fastest on Linux? My report also shows Linux at the top, followed by OS X, and then followed by Windows. $\endgroup$ – Shredderroy Dec 20 '14 at 3:05
  • 3
    $\begingroup$ @Shredderroy No, in fact Linux people seem to have a lot more problems with Mathematica than users of either OS X or Windows. As you can see the hardware is different; they just happened to have Linux with that hardware. Focus on the hardware. (+1 for this answer, I didn't know about this either.) $\endgroup$ – C. E. Dec 20 '14 at 3:13
  • 1
    $\begingroup$ (-1) This fails on my machine: Negative values not allowed Any ideas? $\endgroup$ – Dr. belisarius Dec 20 '14 at 5:48
  • 1
    $\begingroup$ @belisarius while Mr.Wizard and Halirutan battle it out for biggest CPU on the block, we can fight for the low end. I ran the full benchmark on the RPi once, and it takes about 60 minutes. $\endgroup$ – bobthechemist Dec 20 '14 at 14:51
11
$\begingroup$

I have found that Mathematica responds most to raw CPU clock speed. More functions are parallelized in recent versions but my non-hyperthreading i5-2500K CPU (released Q1 2011) still seems to outperform many newer and more expensive units because of the clock. I usually run at 4.6GHz for quiet stability but with the fan and voltage cranked up I can run at 4.8GHz as I did for this benchmark:

enter image description here

(I get 2.06 in the 4.6GHz configuration.)

After that I would rate RAM as important as Mathematica can easily consume a lot but that is probably more specific to the kind of data and problems one works on.

$\endgroup$
  • $\begingroup$ The clock speed relationship seems to be consistent with what I found on the RPi as well, (obviously, the effect is a relative one). $\endgroup$ – bobthechemist Dec 20 '14 at 14:41
  • $\begingroup$ The performances of Mr.Wizard's or Halituran's machines are difficult to beat. Just for comparison, I use a 13" Retina Macbook Pro (type Late 2013) with 2.8 GHZ Intel Core i7 CPU (2 cores, 4 hyperthreads) and 16 GB SSD. The Mathematica 10.0.2 Benchmark[] yields a performance of 1.426 . $\endgroup$ – Romke Bontekoe Dec 21 '14 at 11:59
  • $\begingroup$ 4.8GHz is a very large overclock, and the maximum case temperature for this product is rather low at only 72°C. Are you using water cooling? It's interesting that Intel is not going to use the on-die voltage regulator in future products. It was a valiant attempt (150MHz switching regulator is surely not easy to get working!), but apparently did not deliver the benefits hoped for. Presumably this will mean that the power density in Skylake will be somewhat lower. I also heard that Intel is moving toward permanently soldered processors, which may not be a bad thing, IMO. $\endgroup$ – Oleksandr R. Apr 27 '15 at 12:25
  • $\begingroup$ @Oleksandr I haven't looked at the state of affairs since 2011 and perhaps it has had a resurgence but water cooling fell out of favor with the introduction of heat pipe coolers for all but special applications. The 2500K is only a 95W TDP chip which is no more than e.g. the earlier Kentsfield chips that could also be overclocked with fan-on-heat-pipe coolers. My 4.6GHz clock can be achieved quietly; I could probably drive the chip to 4.9-5.0GHz on air with higher speed fans if I did not mind it sounding like a hairdryer as other people have done that. (continued) $\endgroup$ – Mr.Wizard Apr 27 '15 at 18:37
  • $\begingroup$ @Oleksandr I expect that the top full-time overclocks are still achieved with a phase change system (refrigeration compressor) but I wouldn't want the cost or complexity. I'll have to read about the permanently soldered processors. $\endgroup$ – Mr.Wizard Apr 27 '15 at 18:39
7
$\begingroup$

I have been using Mathematica on a Mac since late 2006 and have enjoyed the experience. Recently, I had my older Macbook Pro (mid 2009 model) replaced due to graphics card failure. Mathematica ran perfectly fine on the older hardware. I now have a 15" Macbook Pro with Intel Core i7, 2.8 GHz, 16 Gb RAM running Yosemite. I also have a NVIDIA GeForce GT 750M graphics card, because I use the Mathematica GPU capabilities quite a lot. I must say I like the performance on the new system.

These are my benchmark results... enter image description here

Based on a comment made by @Mr.Wizard, I ran the benchmarks three more times using a single kernel and got the same result each time (2.22). I may not be answering @Mr.Wizard's question directly, because I will need to generate code to run tests for shorter durations and limited threads counts.

So, I am sticking with the internal Mathematica benchmark routines. I ran the tests using more kernels to take advantage of the intrinsic parallelization of Mathematica. This most likely is not a good Apple to Apple comparison to the other systems listed...

Results using two kernels (LaunchKernels[2] prior to running the BenchmarkReport[]). I got the following results (2.87): enter image description here

To follow up I ran the same benchmarks using 4 kernels ( LaunchKernels[4] ). The results are (4.51): enter image description here

$\endgroup$
  • 1
    $\begingroup$ BTW, nice gravatar! $\endgroup$ – Yves Klett Dec 24 '14 at 16:41
  • $\begingroup$ That high a benchmark from only 2.8GHz surprises me! Does this chip actually run higher than that under short loads or with a limited number of threads? $\endgroup$ – Mr.Wizard Dec 24 '14 at 20:13
  • $\begingroup$ Thank you @YvesKlett, I found it somewhere from some post or example using the ListPointPlot3D. Seemed good for the MMA SE. ListPointPlot3D[ Table[Table[(4 Pi - t) {Cos[t + s Pi/2], Sin[t + s Pi/2], 0} + {0, 0, 2 t}, {t, 0, 4 Pi, .01}], {s, 4}], Filling -> Bottom, ColorFunction -> Function[{x, y, z}, Hue[z]], BoxRatios -> Automatic, FillingStyle -> Directive[LightGreen, Thick, Opacity[.1]], Axes -> None, Boxed -> False] $\endgroup$ – Joseph Dec 24 '14 at 20:14
  • $\begingroup$ @Mr.Wizard I am not certain, I will check it out and report back. $\endgroup$ – Joseph Dec 24 '14 at 20:17
  • $\begingroup$ @Mr.Wizard: By 2.8GHz I think Joseph means i7 4900MQ. It can turbo boost up to 3.8GHz. My 4800MQ get similar results and I know it boosts to highest frequency (3.7GHz for me) under full load. Whether and how long the CPU can stay at highest frequency depends on the heat dissipation of the laptop. $\endgroup$ – Yi Wang Dec 24 '14 at 22:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.