{"id":1335,"date":"2016-02-12T07:21:27","date_gmt":"2016-02-12T12:21:27","guid":{"rendered":"https:\/\/blogs.mathworks.com\/loren\/?p=1335"},"modified":"2016-08-26T10:40:25","modified_gmt":"2016-08-26T15:40:25","slug":"run-code-faster-with-the-new-matlab-execution-engine","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/loren\/2016\/02\/12\/run-code-faster-with-the-new-matlab-execution-engine\/","title":{"rendered":"Run Code Faster With the New MATLAB Execution Engine"},"content":{"rendered":"<div class=\"content\"><!--introduction--><p>Today I'd like to introduce you to a guest blogger, Dave Bergstein, who is a MATLAB Product Manager here at MathWorks. Today, Dave will be discussing the new MATLAB execution engine.<\/p><!--\/introduction--><h3>Contents<\/h3><div><ul><li><a href=\"#d838d353-da18-4483-8ce4-a59a4c58a5ec\">Redesigned Execution<\/a><\/li><li><a href=\"#36009952-0f69-4674-b65a-0003da271671\">What It Means For You: Better Performance, Quality, and Extensibility<\/a><\/li><li><a href=\"#a10b1355-2da4-47e8-87b9-bac247d0b6a6\">What is JIT Compilation?<\/a><\/li><li><a href=\"#ce91c1dc-31f0-4bf2-a536-8a5e2c24a665\">Example Improvement<\/a><\/li><li><a href=\"#4469f18c-2d8c-4c29-ae0b-488cbbd2a5a4\">Improving Performance<\/a><\/li><li><a href=\"#01708d85-b77f-4851-ba72-0f2b94e2be90\">Results<\/a><\/li><li><a href=\"#92fb138a-4818-4377-8027-a588a75f9656\">How Fast is Your Code?<\/a><\/li><\/ul><\/div><h4>Redesigned Execution<a name=\"d838d353-da18-4483-8ce4-a59a4c58a5ec\"><\/a><\/h4><p>In R2015b we changed the way all MATLAB code is executed with the introduction of the new MATLAB execution engine. The improved architecture runs MATLAB programs faster and provides a platform for future enhancements. And these benefits come without requiring changes to your code.<\/p><p>See what some customers are saying about the new execution engine:<\/p><p> <span style=\"padding-left: 50px; display:block\"> <i><b>\"I work\r\nwith a wide variety of clients and spend time helping many of them speed\r\nup their existing MATLAB code.  I was very excited then to see how much\r\nthe new execution engine helps performance. One client reported that a\r\nkey performance-critical process now runs twice as fast in R2015b,\r\nproviding a significant positive impact on their daily\r\noperations.\"<\/b><\/i> <\/span> <span style=\"padding-left: 100px;\r\ndisplay:block\"> Yair Altman <br> MATLAB expert and author of the book\r\nAccelerating MATLAB Performanc (CRC Press) <\/span> <\/p><p> <span style=\"padding-left: 50px; display:block\"> <i><b>\"The new\r\nMATLAB execution engine in R2015 halved the execution time of our MATLAB\r\ncode.\"<\/b><\/i> <\/span> <span style=\"padding-left: 100px; display:block\">\r\nRobert Danforth <br> Director -\u201c Engineering, Analytical Modeling & Test\r\nLabs, Kohler Co. <\/span> <\/p><p> <span style=\"padding-left: 50px; display:block\"> <i><b>\"My apps -\u201c\r\n1D and 2D finite volume for heat transfer and fluid flow -\u201c perform\r\nsignificantly better -\u201c about 35% better.  Good job!\"<\/b><\/i> <\/span>\r\n<span style=\"padding-left: 100px; display:block\"> Enrico Nobile <br>\r\nProfessor of Thermodynamics and Heat Transfer, Dept. of Engineering and\r\nArchitecture, University of Trieste, ITALY <\/span> <\/p><h4>What It Means For You: Better Performance, Quality, and Extensibility<a name=\"36009952-0f69-4674-b65a-0003da271671\"><\/a><\/h4><p>The new execution engine was designed with performance in mind from the beginning. The following are some specific language areas with the most significant improvements:<\/p><div><ul><li><b>Function Calls:<\/b> Function call overhead is greatly reduced; there is no longer an appreciable performance penalty for organizing code into many small functions.<\/li><li><b>Object-Oriented Features:<\/b> Many object-oriented operations execute faster.<\/li><li><b>Element-Wise Math Operations:<\/b> Many element-wise math operations execute faster.<\/li><\/ul><\/div><p>A number of factors account for the speedup in these areas and others, including improved just-in-time (JIT) compilation of MATLAB code. Redesigning the execution engine was also a time to revisit and resolve old language imperfections and bugs, improving quality. And it was an opportunity to design the engine for extensibility, facilitating future enhancements and new features to come.<\/p><h4>What is JIT Compilation?<a name=\"a10b1355-2da4-47e8-87b9-bac247d0b6a6\"><\/a><\/h4><p>The new MATLAB execution engine can JIT compile all MATLAB code and this is an important factor in how it executes code faster. Programming languages like C++ are so-called compiled languages. C++ code goes through a compile step initiated by the author. This compile step generates machine code which executes directly on the target hardware. And compilers can often optimize the generated code to help applications execute faster.<\/p><p>Interpreted languages are executed command-by-command by an interpreter program and don't require an explicit compile step. For engineers and scientists working interactively with their data, it can be very helpful to execute commands this way, altering the sequence of commands as they work. Although this style of execution can be very effective for exploring ideas, it can be slow when executing blocks of code.<\/p><p>MATLAB provides the best of both worlds by compiling MATLAB code on-the-fly, or just-in-time. MATLAB code is compiled whether it be in classes, functions, scripts, or simply at the command line. There is no explicit compile step for the user to initiate and MATLAB code can be executed in blocks as small as one line at a time. The MATLAB JIT compiler generates native machine level code that is optimized for the MATLAB code being executed and for the specific hardware platform.<\/p><p>MATLAB has employed JIT compilation since release R13 in 2002. The original JIT compiler was designed as a supplement to the MATLAB interpreter, and supported a limited subset of the language. The new execution engine was designed with a focus on JIT compilation, where JIT compilation is an integral part of the engine and able to compile the entire MATLAB language.<\/p><h4>Example Improvement<a name=\"ce91c1dc-31f0-4bf2-a536-8a5e2c24a665\"><\/a><\/h4><p>This example gives a sense of the benefit of the new JIT compiler. It demonstrates a difference between the previous JIT compiler and the new JIT compiler which can compile all MATLAB code.<\/p><p>The function <tt>test1<\/tt> calls the function <tt>foo1<\/tt> in a for-loop which performs a straightforward computation using the looping variable <tt>ii<\/tt>. The function <tt>foo1<\/tt> first checks its input value and can issue an error using the <tt><a href=\"https:\/\/www.mathworks.com\/help\/matlab\/ref\/error.html\">error<\/a><\/tt> command if the input is out of range. The error confidition won't occur in this example, but such input checking is a common practice that helps when functions get reused.<\/p><pre class=\"codeinput\"><span class=\"keyword\">function<\/span> Test1\r\nx = zeros(1,1e6);\r\n<span class=\"keyword\">for<\/span> ii = 1:1e6\r\n    x(ii) = foo1(ii);\r\n<span class=\"keyword\">end<\/span>\r\n<span class=\"keyword\">end<\/span>\r\n\r\n<span class=\"keyword\">function<\/span> y = foo1(x)\r\n<span class=\"keyword\">if<\/span> (x&lt;0)\r\n    error(<span class=\"string\">'x must be positive'<\/span>);\r\n<span class=\"keyword\">end<\/span>\r\ny = 2*x.^2+3*x+4;\r\n<span class=\"keyword\">end<\/span>\r\n<\/pre><p>I recorded the following times for <tt>Test1<\/tt> using the <tt><a href=\"https:\/\/www.mathworks.com\/help\/matlab\/ref\/timeit.html\">timeit<\/a><\/tt> command on my laptop [1]:<\/p><div><ul><li><tt>Test1<\/tt> with R2015a: 1.7887 seconds<\/li><li><tt>Test1<\/tt> with R2015b: 0.0435 seconds<\/li><\/ul><\/div><p>The new execution engine is more than 40 times faster executing this example!<\/p><p>Next, consider what happens when we make a slight change to the test. <tt>Test2<\/tt> is the same as <tt>Test1<\/tt> except that it calls <tt>foo2<\/tt> which issues the possible error through another function.<\/p><pre class=\"codeinput\"><span class=\"keyword\">function<\/span> Test2\r\nx = zeros(1,1e6);\r\n<span class=\"keyword\">for<\/span> ii = 1:1e6\r\n    x(ii) = foo2(ii);\r\n<span class=\"keyword\">end<\/span>\r\n<span class=\"keyword\">end<\/span>\r\n\r\n<span class=\"keyword\">function<\/span> y = foo2(x)\r\n<span class=\"keyword\">if<\/span> (x&lt;0)\r\n    displayError;\r\n<span class=\"keyword\">end<\/span>\r\ny = 2*x.^2+3*x+4;\r\n<span class=\"keyword\">end<\/span>\r\n\r\n<span class=\"keyword\">function<\/span> displayError\r\nerror(<span class=\"string\">'x must be positive'<\/span>);\r\n<span class=\"keyword\">end<\/span>\r\n<\/pre><p>I recorded the following times for <tt>Test2<\/tt> using the <tt><a href=\"https:\/\/www.mathworks.com\/help\/matlab\/ref\/timeit.html\">timeit<\/a><\/tt> command:<\/p><div><ul><li><tt>Test2<\/tt> with R2015a: 3.8667 seconds<\/li><li><tt>Test2<\/tt> with R2015b: 0.0430 seconds<\/li><\/ul><\/div><p>With R2015a <tt>Test2<\/tt> takes twice as long to run as <tt>Test1<\/tt> did (3.8667 seconds vs 1.7887 seconds). The reason for the slowdown is that the added code complexity limits the ability of the previous JIT compiler to compile the code. With R2015b the execution time between <tt>Test1<\/tt> and <tt>Test2<\/tt> is nearly the same, demonstrating the ability of the new execution engine to JIT compile all MATLAB code. The result is that <tt>Test2<\/tt> executes nearly 90 times faster with the new execution engine in R2015b.<\/p><h4>Improving Performance<a name=\"4469f18c-2d8c-4c29-ae0b-488cbbd2a5a4\"><\/a><\/h4><p>MATLAB spends some amount of time compiling the code. The time to compile is typically small relative to the time to execute the code. And when code is run repeatedly in a MATLAB session without being cleared, you get the greatest benefit since the code only needs to be compiled once. Examples of running code repeatedly are for-loops or rerunning unmodified MATLAB files. Knowing this, consider the following ways to improve the performance of your code:<\/p><div><ol><li>Avoid using <tt>clear all<\/tt> since it clears the compiled code. Use <tt>clear<\/tt> instead when you want to just clear your data and avoid re-incurring the time MATLAB spends compiling.<\/li><li>Modularize your code into multiple files so that when you make edits, it reduces the amount of code that gets recompiled on the next run. Modularizing code into separate functions and classes can also help improve code readability, reusability, and maintainability.<\/li><\/ol><\/div><h4>Results<a name=\"01708d85-b77f-4851-ba72-0f2b94e2be90\"><\/a><\/h4><p>We collected and tested 76 performance-sensitive user applications to evaluate the performance of the new engine. The programs tested range in size from a few dozen lines of code to hundreds of lines of code and cover applications from device simulation to finance. The histogram below shows the number of applications (or tests) that ran some amount faster or slower in MATLAB 15b compared to 15a. From the histogram you can see that there is strong shift to the right, indicating faster performance. These applications ran on average 40% faster with the new execution engine. And over a dozen of the applications ran at least twice as fast.<\/p><p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/loren\/2016\/histogram.png\" alt=\"\"> <\/p><h4>How Fast is Your Code?<a name=\"92fb138a-4818-4377-8027-a588a75f9656\"><\/a><\/h4><p>Test your code with the redesigned MATLAB execution engine by downloading and installing R2015b. You'll be taking advantage of the MATLAB execution engine as soon as you start running your code. For tips on improving code performance, see <a href=\"https:\/\/www.mathworks.com\/help\/matlab\/matlab_prog\/techniques-for-improving-performance.html\">Techniques for Improving Performance<\/a> . To learn more about assessing the performance of your code, see <a href=\"https:\/\/www.mathworks.com\/help\/matlab\/matlab_prog\/measure-performance-of-your-program.html\">Measure Performance of Your Program<\/a> . And share with us how your code executes with the new execution engine by leaving a note <a href=\"https:\/\/blogs.mathworks.com\/loren\/?p=1335#respond\">here<\/a>!<\/p><p>[1] For a great discussion of timing code, see <a href=\"https:\/\/blogs.mathworks.com\/loren\/2015\/12\/23\/its-about-time\/\">Loren's Dec blog post<\/a> .<\/p><script language=\"JavaScript\"> <!-- \r\n    function grabCode_641bc98ddcd14702ace2d1c5950d5a96() {\r\n        \/\/ Remember the title so we can use it in the new page\r\n        title = document.title;\r\n\r\n        \/\/ Break up these strings so that their presence\r\n        \/\/ in the Javascript doesn't mess up the search for\r\n        \/\/ the MATLAB code.\r\n        t1='641bc98ddcd14702ace2d1c5950d5a96 ' + '##### ' + 'SOURCE BEGIN' + ' #####';\r\n        t2='##### ' + 'SOURCE END' + ' #####' + ' 641bc98ddcd14702ace2d1c5950d5a96';\r\n    \r\n        b=document.getElementsByTagName('body')[0];\r\n        i1=b.innerHTML.indexOf(t1)+t1.length;\r\n        i2=b.innerHTML.indexOf(t2);\r\n \r\n        code_string = b.innerHTML.substring(i1, i2);\r\n        code_string = code_string.replace(\/REPLACE_WITH_DASH_DASH\/g,'--');\r\n\r\n        \/\/ Use \/x3C\/g instead of the less-than character to avoid errors \r\n        \/\/ in the XML parser.\r\n        \/\/ Use '\\x26#60;' instead of '<' so that the XML parser\r\n        \/\/ doesn't go ahead and substitute the less-than character. \r\n        code_string = code_string.replace(\/\\x3C\/g, '\\x26#60;');\r\n\r\n        copyright = 'Copyright 2016 The MathWorks, Inc.';\r\n\r\n        w = window.open();\r\n        d = w.document;\r\n        d.write('<pre>\\n');\r\n        d.write(code_string);\r\n\r\n        \/\/ Add copyright line at the bottom if specified.\r\n        if (copyright.length > 0) {\r\n            d.writeln('');\r\n            d.writeln('%%');\r\n            if (copyright.length > 0) {\r\n                d.writeln('% _' + copyright + '_');\r\n            }\r\n        }\r\n\r\n        d.write('<\/pre>\\n');\r\n\r\n        d.title = title + ' (MATLAB code)';\r\n        d.close();\r\n    }   \r\n     --> <\/script><p style=\"text-align: right; font-size: xx-small; font-weight:lighter;   font-style: italic; color: gray\"><br><a href=\"javascript:grabCode_641bc98ddcd14702ace2d1c5950d5a96()\"><span style=\"font-size: x-small;        font-style: italic;\">Get \r\n      the MATLAB code <noscript>(requires JavaScript)<\/noscript><\/span><\/a><br><br>\r\n      Published with MATLAB&reg; R2015b<br><\/p><\/div><!--\r\n641bc98ddcd14702ace2d1c5950d5a96 ##### SOURCE BEGIN #####\r\n%% Run Code Faster With the New MATLAB Execution Engine\r\n% Today I'd like to introduce you to a guest blogger, Dave Bergstein, who\r\n% is a MATLAB Product Manager here at MathWorks. Today, Dave will be\r\n% discussing the new MATLAB execution engine.\r\n%\r\n\r\n%% Redesigned Execution\r\n% In R2015b we changed the way all MATLAB code is executed with the\r\n% introduction of the new MATLAB execution engine. The improved\r\n% architecture runs MATLAB programs faster and provides a platform for\r\n% future enhancements. And these benefits come without requiring changes to\r\n% your code.\r\n% \r\n% See what some customers are saying about the new execution engine:\r\n%\r\n% <html> <span style=\"padding-left: 50px; display:block\"> <i><b>\"I work\r\n% with a wide variety of clients and spend time helping many of them speed\r\n% up their existing MATLAB code.  I was very excited then to see how much\r\n% the new execution engine helps performance. One client reported that a\r\n% key performance-critical process now runs twice as fast in R2015b,\r\n% providing a significant positive impact on their daily\r\n% operations.\"<\/b><\/i> <\/span> <span style=\"padding-left: 100px;\r\n% display:block\"> Yair Altman <br> MATLAB expert and author of the book\r\n% Accelerating MATLAB Performanc (CRC Press) <\/span> <\/html>\r\n%\r\n% <html> <span style=\"padding-left: 50px; display:block\"> <i><b>\"The new\r\n% MATLAB execution engine in R2015 halved the execution time of our MATLAB\r\n% code.\"<\/b><\/i> <\/span> <span style=\"padding-left: 100px; display:block\">\r\n% Robert Danforth <br> Director -\u201c Engineering, Analytical Modeling & Test\r\n% Labs, Kohler Co. <\/span> <\/html>\r\n%\r\n% <html> <span style=\"padding-left: 50px; display:block\"> <i><b>\"My apps \u00e2\u20ac\u201c\r\n% 1D and 2D finite volume for heat transfer and fluid flow \u00e2\u20ac\u201c perform\r\n% significantly better \u00e2\u20ac\u201c about 35% better.  Good job!\"<\/b><\/i> <\/span>\r\n% <span style=\"padding-left: 100px; display:block\"> Enrico Nobile <br>\r\n% Professor of Thermodynamics and Heat Transfer, Dept. of Engineering and\r\n% Architecture, University of Trieste, ITALY <\/span> <\/html>\r\n%\r\n\r\n%% What It Means For You: Better Performance, Quality, and Extensibility\r\n% The new execution engine was designed with performance in mind from the\r\n% beginning. The following are some specific language areas with the most\r\n% significant improvements:\r\n% \r\n% * *Function Calls:* Function call overhead is greatly reduced; there is\r\n% no longer an appreciable performance penalty for organizing code into\r\n% many small functions.\r\n% * *Object-Oriented Features:* Many object-oriented operations execute\r\n% faster.\r\n% * *Element-Wise Math Operations:* Many element-wise math operations\r\n% execute faster.\r\n%\r\n% A number of factors account for the speedup in these areas and others,\r\n% including improved just-in-time (JIT) compilation of MATLAB code.\r\n% Redesigning the execution engine was also a time to revisit and resolve\r\n% old language imperfections and bugs, improving quality. And it was an\r\n% opportunity to design the engine for extensibility, facilitating future\r\n% enhancements and new features to come.\r\n\r\n%% What is JIT Compilation?\r\n% The new MATLAB execution engine can JIT compile all MATLAB code and this\r\n% is an important factor in how it executes code faster. Programming\r\n% languages like C++ are so-called compiled languages. C++ code goes\r\n% through a compile step initiated by the author. This compile step\r\n% generates machine code which executes directly on the target hardware.\r\n% And compilers can often optimize the generated code to help applications\r\n% execute faster.\r\n%\r\n% Interpreted languages are executed command-by-command by an interpreter\r\n% program and don't require an explicit compile step. For engineers and\r\n% scientists working interactively with their data, it can be very helpful\r\n% to execute commands this way, altering the sequence of commands as they\r\n% work. Although this style of execution can be very effective for\r\n% exploring ideas, it can be slow when executing blocks of code.\r\n%\r\n% MATLAB provides the best of both worlds by compiling MATLAB code\r\n% on-the-fly, or just-in-time. MATLAB code is compiled whether it be in\r\n% classes, functions, scripts, or simply at the command line. There is no\r\n% explicit compile step for the user to initiate and MATLAB code can be\r\n% executed in blocks as small as one line at a time. The MATLAB JIT\r\n% compiler generates native machine level code that is optimized for the\r\n% MATLAB code being executed and for the specific hardware platform.\r\n%\r\n% MATLAB has employed JIT compilation since release R13 in 2002. The\r\n% original JIT compiler was designed as a supplement to the MATLAB\r\n% interpreter, and supported a limited subset of the language. The new\r\n% execution engine was designed with a focus on JIT compilation, where JIT\r\n% compilation is an integral part of the engine and able to compile the\r\n% entire MATLAB language.\r\n\r\n%% Example Improvement\r\n% This example gives a sense of the benefit of the new JIT compiler. It\r\n% demonstrates a difference between the previous JIT compiler and the new\r\n% JIT compiler which can compile all MATLAB code.\r\n%\r\n% The function |test1| calls the function |foo1| in a for-loop which\r\n% performs a straightforward computation using the looping variable |ii|.\r\n% The function |foo1| first checks its input value and can issue an error\r\n% using the |<https:\/\/www.mathworks.com\/help\/matlab\/ref\/error.html error>|\r\n% command if the input is out of range. The error confidition won't occur\r\n% in this example, but such input checking is a common practice that helps\r\n% when functions get reused.\r\n%\r\nfunction Test1\r\nx = zeros(1,1e6);\r\nfor ii = 1:1e6\r\n    x(ii) = foo1(ii);\r\nend\r\nend\r\n\r\nfunction y = foo1(x)\r\nif (x<0)\r\n    error('x must be positive');\r\nend\r\ny = 2*x.^2+3*x+4;\r\nend\r\n\r\n%%\r\n% I recorded the following times for |Test1| using the\r\n% |<https:\/\/www.mathworks.com\/help\/matlab\/ref\/timeit.html timeit>| command\r\n% on my laptop [1]:\r\n%\r\n% * |Test1| with R2015a: 1.7887 seconds\r\n% * |Test1| with R2015b: 0.0435 seconds\r\n%\r\n% The new execution engine is more than 40 times faster executing this\r\n% example!\r\n%\r\n% Next, consider what happens when we make a slight change to the test.\r\n% |Test2| is the same as |Test1| except that it calls |foo2| which issues\r\n% the possible error through another function.\r\nfunction Test2\r\nx = zeros(1,1e6);\r\nfor ii = 1:1e6\r\n    x(ii) = foo2(ii);\r\nend\r\nend\r\n\r\nfunction y = foo2(x)\r\nif (x<0)\r\n    displayError;\r\nend\r\ny = 2*x.^2+3*x+4;\r\nend\r\n\r\nfunction displayError\r\nerror('x must be positive');\r\nend\r\n%% \r\n% I recorded the following times for |Test2| using the\r\n% |<https:\/\/www.mathworks.com\/help\/matlab\/ref\/timeit.html timeit>| command:\r\n%\r\n% * |Test2| with R2015a: 3.8667 seconds\r\n% * |Test2| with R2015b: 0.0430 seconds\r\n% \r\n% With R2015a |Test2| takes twice as long to run as |Test1| did (3.8667\r\n% seconds vs 1.7887 seconds). The reason for the slowdown is that the added\r\n% code complexity limits the ability of the previous JIT compiler to\r\n% compile the code. With R2015b the execution time between |Test1| and\r\n% |Test2| is nearly the same, demonstrating the ability of the new\r\n% execution engine to JIT compile all MATLAB code. The result is that\r\n% |Test2| executes nearly 90 times faster with the new execution engine in\r\n% R2015b.\r\n\r\n%% Improving Performance\r\n% MATLAB spends some amount of time compiling the code. The time to compile\r\n% is typically small relative to the time to execute the code. And when\r\n% code is run repeatedly in a MATLAB session without being cleared, you get\r\n% the greatest benefit since the code only needs to be compiled once.\r\n% Examples of running code repeatedly are for-loops or rerunning unmodified\r\n% MATLAB files. Knowing this, consider the following ways to improve the\r\n% performance of your code:\r\n% \r\n% # Avoid using |clear all| since it clears the compiled code. Use |clear|\r\n% instead when you want to just clear your data and avoid re-incurring the\r\n% time MATLAB spends compiling.\r\n% # Modularize your code into multiple files so that when you make edits,\r\n% it reduces the amount of code that gets recompiled on the next run.\r\n% Modularizing code into separate functions and classes can also help\r\n% improve code readability, reusability, and maintainability.\r\n% \r\n%\r\n%% Results\r\n% We collected and tested 76 performance-sensitive user applications to\r\n% evaluate the performance of the new engine. The programs tested range in\r\n% size from a few dozen lines of code to hundreds of lines of code and\r\n% cover applications from device simulation to finance. The histogram below\r\n% shows the number of applications (or tests) that ran some amount faster\r\n% or slower in MATLAB 15b compared to 15a. From the histogram you can see\r\n% that there is strong shift to the right, indicating faster performance.\r\n% These applications ran on average 40% faster with the new execution\r\n% engine. And over a dozen of the applications ran at least twice as fast.\r\n% \r\n% <<histogram.png>>\r\n% \r\n%\r\n%% How Fast is Your Code?\r\n% Test your code with the redesigned MATLAB execution engine by downloading\r\n% and installing R2015b. You'll be taking advantage of the MATLAB execution\r\n% engine as soon as you start running your code. For tips on improving code\r\n% performance, see\r\n% <https:\/\/www.mathworks.com\/help\/matlab\/matlab_prog\/techniques-for-improving-performance.html\r\n% Techniques for Improving Performance> . To learn more about assessing the\r\n% performance of your code, see\r\n% <https:\/\/www.mathworks.com\/help\/matlab\/matlab_prog\/measure-performance-of-your-program.html\r\n% Measure Performance of Your Program> . And share with us how your code\r\n% executes with the new execution engine by leaving a note\r\n% <http:\/\/blogs\/mathworks\/com\/loren\/?p=1355#respond here>!\r\n\r\n%%\r\n% [1] For a great discussion of timing code, see\r\n% <https:\/\/blogs.mathworks.com\/loren\/2015\/12\/23\/its-about-time\/ Loren's Dec\r\n% blog post> .\r\n%\r\n##### SOURCE END ##### 641bc98ddcd14702ace2d1c5950d5a96\r\n-->","protected":false},"excerpt":{"rendered":"<div class=\"overview-image\"><img decoding=\"async\"  class=\"img-responsive\" src=\"https:\/\/blogs.mathworks.com\/images\/loren\/2016\/histogram.png\" onError=\"this.style.display ='none';\" \/><\/div><!--introduction--><p>Today I'd like to introduce you to a guest blogger, Dave Bergstein, who is a MATLAB Product Manager here at MathWorks. Today, Dave will be discussing the new MATLAB execution engine.... <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/loren\/2016\/02\/12\/run-code-faster-with-the-new-matlab-execution-engine\/\">read more >><\/a><\/p>","protected":false},"author":39,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[40,58],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/posts\/1335"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/users\/39"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/comments?post=1335"}],"version-history":[{"count":7,"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/posts\/1335\/revisions"}],"predecessor-version":[{"id":2025,"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/posts\/1335\/revisions\/2025"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/media?parent=1335"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/categories?post=1335"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/tags?post=1335"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}