<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - JavaScriptCore performance is very bad on Windows"
   href="https://bugs.webkit.org/show_bug.cgi?id=146448">146448</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>JavaScriptCore performance is very bad on Windows
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>WebKit
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>528+ (Nightly build)
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Windows 7
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>Major
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P2
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>JavaScriptCore
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>webkit-unassigned&#64;lists.webkit.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>ewmailing&#64;gmail.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=255809" name="attach_255809" title="How to build JSCore for Windows">attachment 255809</a> <a href="attachment.cgi?id=255809&amp;action=edit" title="How to build JSCore for Windows">[details]</a></span>
How to build JSCore for Windows

I’ve been trying to use JavaScriptCore as an embedded scripting language for a video game engine. I’ve been using it on multiple platforms. During my testing, I’ve discovered that the JavaScriptCore Windows performance is very slow. I wanted to alert you in hopes there is something that can be done to fix it.


I’ve been getting help on building JavaScriptCore for Windows from a few people in the community. My current build is as of a couple of weeks ago. However, I’ve been seeing the same performance characteristics from a build from a little over a year ago.

To prove to you that this is a problem to just JavaScriptCore on Windows, and not a general Windows problem, nor a problem with my code, I have done the following:

- I ran the program on Windows, OS X, Linux, iOS, Android, and Raspberry Pi (Linux).
- I wrote comparable programs in C and Lua and also ran these on all platforms.
- Additionally, I was able to run on the same hardware (dual boot) for Windows/Linux.

So here is the quick summary:

                   Ubuntu 12.04 LTS (64-bit)                       Windows 8.1 (64-bit)
===========================================================
C                     5600 sprites                                              27000 sprites
Lua                  3100 sprites                                             12000 sprites
JSCore            2400 sprites                                              120 sprites

This was on an Intel Core i5-3570K &#64; 3.40 GHz with Intel 4000 HD graphics. The reason for the big jump in Windows performance is mostly due to the Intel graphics drivers being poor on Linux. However, that 120 sprites is not a typo. Whereas everything else was faster on Windows in this case, JSCore is a magnitude slower.

My numbers for the other operating systems tend to follow sensible trends. Windows/JSCore is an outlier. And other programs I’ve run also show JavaScriptCore on Windows has performance problems.

You can see this summary with the programs running in a short video I put together and uploaded to YouTube:
<a href="https://youtu.be/UDyI1cckDJI">https://youtu.be/UDyI1cckDJI</a>



I have uploaded pre-built binaries of my test program. JavaScriptCore is dynamically linked in all cases, so it is easy to swap in another build of JSCore if you want to try things. There is a file called config.txt in each bundle that lets you change the number of sprites. (I did not sign the OS X binaries with my Developer ID because I figured you might want to change the config.txt.) Also, the Lua and JavaScript scripts are in plain text and can be easily modified.


And for clarity: All my test programs here are 64-bit versions. I have not actually benchmarked 32-bit except on ARM devices.


Windows 7 and up (x64) 
Zip:
<a href="http://playcontrol.net/tempdownload/WebKit/MinimalSDLSpriteBenchmarkC.zip">http://playcontrol.net/tempdownload/WebKit/MinimalSDLSpriteBenchmarkC.zip</a>
<a href="http://playcontrol.net/tempdownload/WebKit/MinimalSDLSpriteBenchmarkLua.zip">http://playcontrol.net/tempdownload/WebKit/MinimalSDLSpriteBenchmarkLua.zip</a>
<a href="http://playcontrol.net/tempdownload/WebKit/MinimalSDLSpriteBenchmarkJavaScript.zip">http://playcontrol.net/tempdownload/WebKit/MinimalSDLSpriteBenchmarkJavaScript.zip</a>
Installer:
<a href="http://playcontrol.net/tempdownload/WebKit/MinimalSDLSpriteBenchmarkC-1.0.0-win64.exe">http://playcontrol.net/tempdownload/WebKit/MinimalSDLSpriteBenchmarkC-1.0.0-win64.exe</a>
<a href="http://playcontrol.net/tempdownload/WebKit/MinimalSDLSpriteBenchmarkLua-1.0.0-win64.exe">http://playcontrol.net/tempdownload/WebKit/MinimalSDLSpriteBenchmarkLua-1.0.0-win64.exe</a>
<a href="http://playcontrol.net/tempdownload/WebKit/MinimalSDLSpriteBenchmarkJavaScript-1.0.0-win64.exe">http://playcontrol.net/tempdownload/WebKit/MinimalSDLSpriteBenchmarkJavaScript-1.0.0-win64.exe</a>

OS X 10.9 and up
<a href="http://playcontrol.net/tempdownload/WebKit/MinimalSDLSpriteBenchmarkC.app.zip">http://playcontrol.net/tempdownload/WebKit/MinimalSDLSpriteBenchmarkC.app.zip</a>
<a href="http://playcontrol.net/tempdownload/WebKit/MinimalSDLSpriteBenchmarkLua.app.zip">http://playcontrol.net/tempdownload/WebKit/MinimalSDLSpriteBenchmarkLua.app.zip</a>
<a href="http://playcontrol.net/tempdownload/WebKit/MinimalSDLSpriteBenchmarkJavaScript.app.zip">http://playcontrol.net/tempdownload/WebKit/MinimalSDLSpriteBenchmarkJavaScript.app.zip</a>

Linux (x64 Ubuntu 12.04 LTS a.k.a Steam Runtime)
<a href="http://playcontrol.net/tempdownload/WebKit/MinimalSDLSpriteBenchmarkC-0.1.1-Linux.tar.gz">http://playcontrol.net/tempdownload/WebKit/MinimalSDLSpriteBenchmarkC-0.1.1-Linux.tar.gz</a>
<a href="http://playcontrol.net/tempdownload/WebKit/MinimalSDLSpriteBenchmarkLua-0.1.1-Linux.tar.gz">http://playcontrol.net/tempdownload/WebKit/MinimalSDLSpriteBenchmarkLua-0.1.1-Linux.tar.gz</a>
<a href="http://playcontrol.net/tempdownload/WebKit/MinimalSDLSpriteBenchmarkJavaScript-0.1.1-Linux.tar.gz">http://playcontrol.net/tempdownload/WebKit/MinimalSDLSpriteBenchmarkJavaScript-0.1.1-Linux.tar.gz</a>



I also made the repos to my programs available:

<a href="https://bitbucket.org/blurrr/minimalspritebenchmarkc">https://bitbucket.org/blurrr/minimalspritebenchmarkc</a>
<a href="https://bitbucket.org/blurrr/minimalspritebenchmarklua">https://bitbucket.org/blurrr/minimalspritebenchmarklua</a>
<a href="https://bitbucket.org/blurrr/minimalspritebenchmarkjavascript">https://bitbucket.org/blurrr/minimalspritebenchmarkjavascript</a>

However, it probably won’t be of much use without my SDK because without it, you’ll need to compile all the dependencies yourself and figure out the build system. If you need a copy of my SDK, let me know. 


I'm also attaching my write up of how to build JavaScriptCore for Windows (64-bit). The existing instructions had problems and with the help of a few in the community, I was able to get through it and the document is what I came up with.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>