Software Archive
Read-only legacy content
17061 Discussions

Best CPU for intensive programming and comprarisions with Integers with VS.Net

Pedro_A_
Beginner
734 Views

Hi.

I'm in a company working in software that involves a lot of managing and operating with integers, it also requires constant comparisions between them. (jagged arrays full of integers that must be browsed quite a lot, comparing and operating them) Right now we are coding with <b>VS2013.Net C#<\b> (I know is not the best but... I can't choose). What might happen is that we change later on to make a small library with some core coding in C++ and other compiler, but thats a maybe far in the future...

My questions is, in this scenario with VS.Net:
How I choose the best CPU?
Should I look for one specific type of instructions like SSE?
There is any masure in processors specification that is specially useful to identify best CPU?

I've checked this specifications http://ark.intel.com/products/75123/Intel-Core-i7-4770K-Processor-8M-Cache-up-to-3_90-GHz but cant find where to look at that.

Hope someone can help, thanks in advance.

0 Kudos
9 Replies
Bernard
Valued Contributor I
734 Views

The CPU mentioned by you will easily suit your needs.It has 7 execution ports and support for AVX2 ISA.For example Port0 and Port1 can execute vector int  ALU operation concurrently and Port6 can calculate branch prediction. 

0 Kudos
Bernard
Valued Contributor I
734 Views

Regarding proper utilization of those computing resources by managed C# code it will be dependent on the JIT .NET compiler.

0 Kudos
Bernard
Valued Contributor I
734 Views

@Pedro

Try to profile the same code written in C++ and in C# and compare the results.Sometimes JIT compilation could be faster because of run-time optimization which is not possible in the case of the native code.

0 Kudos
zalia64
New Contributor I
734 Views

As a rule of the thumb, high level languages DO NOT utilize the CPU well. And high-level algorithms DO NOT utilize the most obvious speed boost, namely multi-core. I would bet that using 4 cores would increase your speed two folds, at least. But the cost in programmer's time....

High-level makes your code easier to understand, and is less error prone. You pay with speed. You pay with a bloated code. But who cares? Wordstar editor ( 1970-1985) used 27 KB, with inline help. Word uses more then 100 MB of code. The Incredible Machine game was stored on a single disk, 360 KB.  Current games use a single DVD , 4.7 GB of code.

Either you use the high-level C# and enjoy the ease of programming, or you insert complicated SSE mnemonics - gaining some speed, loosing the clarity of the code. You can't have them both.

If speed is a real issue, I suggest the proven 'Finish first, Optimize later' method:

(A) Define your most time-consuming operations. (B) Put them into separate routines. Simple ones, 'compare two arrays', 'combine two arrays', nothing complicated. Calling a routine (Call/Return) costs a few cycles, less then a sub-optimal IF/THEN/ELSE.  (C) Write those routines in C, C#, X.net, whatever. (D) Build a library of those routines, and link it to your applications. (E) Finish your application, and test it.

Profile your application. How many times routine A was called? how long did it take? Use Intel tools (or others').

Now start replacing each routine, one by one,  with a highly optimized version: only those that are worth it.  Test by comparing the results of 'old version' to the 'new version', on real big data-sets:  the comparison is automatic, for 'exactly the same' . Any inequality means a bug.  Preferably, use C (lower level) or better - ASM with SSE.

And the optimal CPU? Don't waste your time fighting it with the acquisitions department. Just insist on a good one.  Within half a year you will have a new, better CPU, 30% quicker. The fight may take longer.

 

0 Kudos
Bernard
Valued Contributor I
734 Views

@zalia64

Nice answer,but you really cannot compare the the game technology based on VESA VGA standard probably non-accelerated by the hardware to today's game which are steadily approaching 4K resolution.

0 Kudos
Adrian_Stevens
Beginner
734 Views

If you're looking for a simple high level answer:

I wouldn't worry too much about the instruction sets unless you're specifically coding against them.  And you'll be well covered with with any core i7.

What I would keep in mind when shopping around is the cache size per processor for in memory execution speed (along with clock speed of course).

And if you're looking for work efficiency, SSDs make a big difference for compilation time vs a traditional hard-drive in my experience.

0 Kudos
zalia64
New Contributor I
734 Views

>>And if you're looking for work efficiency, SSDs make a big difference for compilation time vs a traditional hard-drive in my experience.

I find that compilation time (and the forced coffee break) is the opportunity to re-think my whole coding strategy.  Would removing them improve over-all development time? I am not so sure... :)  

0 Kudos
Pedro_A_
Beginner
734 Views

Hi.

Thanks everyone for your replys, are full of valuable tips and advices.

You confirm what I feared, that VS won't get much from instructions. Zalia the approach you mentioned 'Finish first, Optimize later' is the one I'm trying, I'm making everything in libraries.dll, and If in the end time is a big problem I'll create new dll in a better language. As iliyapolak sais I'll use a profiler. By the way an SSD is a must :).

There is still no easy answer to CPU question.
-Ivi bridge. Too expensive, too much W and AVX 1.0. On the other hand they've got great GHz, more cache & Memory speed. Also Socket 2011 probably will be more expensive...
- 4790 Haswell and specially 4790K Devil's Canyon seems the best offer. Similar to other i7 1150, but a bit faster in GHz.

If I can find a i7 4790K at a similar price in the chart (350$) I think I'll buy it. Hahaha, unfortunately I can't find it in Spanish shops. Lanched in EEUU recently I guess it will take some time to hit our shops.

 

0 Kudos
Bernard
Valued Contributor I
734 Views

>>> 4790 Haswell and specially 4790K Devil's Canyon seems the best offer. Similar to other i7 1150, but a bit faster in GHz>>>

I would choose this CPU definitely over older IvyBridge generation.

Regarding SSD tell me how large is the source code? How many thousands lines of code and source/header files? To speedup the compilation phase you can use multithreaded compilation.

0 Kudos
Reply