locked
Windows Runtime Component / JavaScript Performance RRS feed

  • Question

  • Hi,

    In my spare time I have been dabbling in Windows Store applications and recently decided I would take a stab at an HTML5/Javascript game that utilizes a Windows Runtime Component for the middle tier. In essence, much of the game logic was written in C# and the HTML5/Javascript layer handles the game loop, drawing, etc.

    For the last several days I have been battling a Heisenbug, where the performance is great only when the Profiler is attached. After hours and hours of trying to determine the root cause it dawned on me that my access of public Properties from Javascript into the Windows Runtime Component may be to blame. I’m not sure why I thought of it, but low and behold when I replaced the properties with Method calls the performance issues were solved and now the application runs even faster than before.

    This is 100% repeatable, that is, if I change the Method calls back to public properties the issue comes back. Is this a known performance problem that others are aware of, or is this something that is only an issue when accessing managed code from HTML5/Javascript?

    Thanks for your help



    Wednesday, April 3, 2013 12:40 PM

Answers

  • Prashant,

    As suspected, this was an issue which with my code. I am not able to reproduce this issue with a test project. I am still investigating why I see this problem, but it appears to be my code. Thanks for the help.

    Monday, April 8, 2013 1:39 AM

All replies

  • I don't think this has been reported to be an issue. Can you isolate this to a simple repro (create a WinRT C# component that exposes a get/set property and a function that sets the member explicitly and consume that component from WinJS) and share it via SkyDrive? The property getters/setters in C# are actually functions by themselves, so I wonder why you are seeing such an issue. If you can isolate it to a very simple repro, it would be interesting to see the behavior.

    When you mention performance issue, what type of performance issue are you experiencing? Slowness, memory leak, high CPU?

    Thanks,

    Prashant.


    @prashantphadke || Windows Store Developer Solutions #WSDevSol || Want more solutions? See our blog! http://aka.ms/t4vuvz

    Thursday, April 4, 2013 12:49 AM
    Moderator
  • Hi Prashant,

    I'm working on getting a test project up and running.

    Friday, April 5, 2013 2:25 PM
  • Prashant,

    As suspected, this was an issue which with my code. I am not able to reproduce this issue with a test project. I am still investigating why I see this problem, but it appears to be my code. Thanks for the help.

    Monday, April 8, 2013 1:39 AM