Welcome back. We're going to talk about selecting languages. Occasionally, one will hear from an old-school designer, not me, saying that design is language independent. Nothing that is stated in the design should indicate a language preference or an operating system preference. Some may still share that view. But in the light of two things, performance and security, the language-independent view of design is falling by the wayside. In fact, as I write this talk, I am shuttling between the document that I'm writing and a matrix multiplication performance test for my computer architecture class, multiplying 2496 by 4096 matrices to obtain a third. I've done this in C++, C#, and Java to determine performance differences. This project has actually been going on for several weeks, and the results are interesting. Language does make a difference in performance, but sometimes in unexpected ways. For example, some languages, like C and C++, through flexibility, give you the ability to allocate large chunks of memory in non-optimal ways. Also, the optimizations performed by compilers can be hugely beneficial, but only available in certain languages. Here's a snapshot of some of the results of the matrix multiply problem in various languages and compilers and optimization modes. Times are in seconds. For Java, using the NetBeans compiler, the execution time was 1632 seconds. For C# using Visual Studio, 1520 seconds for the un-optimized debug mode. And in the release version of the optimized mode for Visual Studio, 1040 seconds. This, of course, is not a guarantee that all software tasks will exhibit the same tendencies. Depending upon what the task demands and what compiler optimizations are present or not, and depending upon what optimizations the actual CPU can perform, your results may vary. All these runs were done on the same 2-core Intel Core i7 processor. One interesting aspect studied in this project is the effect of CPU temperature. Intel processors have temperature sensors and are able to increase the clock rate, thereby increasing power consumption and heat production, if there is adequate thermal headroom. You can see this from the performance graphic. The CPU is rated at 1.8 GHz, but at the moment was running at nearly 2.8 GHz. The bottom line here is that if performance is crucial to your project, the design of the server and of the server installation is important. Besides performances, languages also have a security aspect to them. C and C++ are languages which can manipulate pointers, which can provide a larger attack surface for creative hackers. Java and C#, which don't necessarily suffer from these problems, suffer from others. Both languages, Java and C#, compile to intermediate code, Java bytecode or Microsoft Intermediate Language. And these are interpreted by virtual machines. In the case of Java, it's the Java Virtual Machine or JVM. In the case of C#, it's the .NET framework. The reason that this is important is, while your compiled code in C or C++ generates machine languages that is executed directly by the processor. The virtual machines inject tens of thousands of lines of code between your application and the processor. Bug rates are linear by lines of code, even for well-seasoned code. So it stands to reason that C# and Java may have security flaws under the covers that you don't even know about until they're either patched, assuming you read the patch notes, or until you've been hacked. The bottom line is, choose your language carefully. And there's good reason to argue that language does matter in the design phase. In our next talk, we'll look at operating systems and their role in performance and security, and why the design phase should not be OS independent. See you next time.