Intel c compiler amd
![intel c compiler amd intel c compiler amd](https://documentation.sigma2.no/_images/optgain.png)
![intel c compiler amd intel c compiler amd](https://www.intel.com/content/dam/develop/public/us/en/images/diagrams-infographics/diagram-oneapi-dpc-c-compiler-16x9.png)
This is the reason we see a 4 core/8 thread Intel CPU beating convincing a 4 module 8 core AMD chip. That is most what compilers do, choose between all the options to work out which byte to emit. If you profile the gcc compiler you'll see the reason, huge numbers of branch mispredictions from the CPU. Yet in most games and calculation heavy apps the benefits from Haswell are disappointingly low, <10% the grand majority of the time even with the additional calculation port. One of the big things that Haswell beefed up was its branch predictor and its cache, two things we would seriously expect to improve a program with a lot of branches. Really good branch prediction and prediction calculation really help compilers along. Optimisers are especially branch heavy, they go through the abstract syntax tree looking for a match for their optimising pattern, which is a lot of comparisons with a no answer and a few yes ones. I have written quite a few compilers and I its a lot of branch code. Basically every character goes through multiple branches in order to determine what it is so that syntax and language semantics can be checked. You lexer takes a character/word and then compares it against a list of possibilities to determine its type, then emits that token and the parser will take the token and compare it against all the possibilities it has and choose based on the type of it what direction to take. Have you ever written a compiler? Its almost all branches. Erlang for example is another language I saw almost no multithreading on. Then at link time these are actually combined and the availability is checked fully, but while this works for c/c++ it doesn't work for many other languages. C++ compiles do multithread well because the compiles of individual files can be done separately as the files each declare (via header files) what is available. Certain plugins with Maven can help a little with parallel tests and such but its not a language that deals with parallel compilation in general, anything targeting the JVM struggles to get parallel behaviour. Java uses a few threads but doesn't scale out to 8 or so cores.
![intel c compiler amd intel c compiler amd](https://i0.wp.com/blogs.embarcadero.com/wp-content/uploads/2021/01/newcpp124during-6769875.png)
If you compile a scala project with scalac its single threaded so as the project gets larger it just gets slower. Click to expand.It really does depend on the language.