Slow execution of Actions.InvokeScript

2 posts, 0 answers
  1. Alex
    Alex avatar
    8 posts
    Member since:
    May 2009

    Posted 11 Jun 2010 Link to this post

    We are looking to use WebAii for performance testing.

    Part of the requirement is to send multiple objects to a ui using a function in Javascript.

    However repeated calls using code below is only sending a maximum of 15 requests per second, which is too slow to be helpful for performance testing.

    WebAii code
                for (int x = 1; x <= 100; x++)
                {
                   Actions.InvokeScript(string.Format("test('{0} ')", x));
                }

    calls this :
    function test(sendValue) {
                if (Plugin == null) {
                    Plugin = document.getElementById("SilverlightControl");
                }
                Plugin.Content.MainPage.UpdateText(sendValue);
            }



    In comparison we can run the same loop in raw JavaScript and send 100's of messages per second to Silverlight.

    comparison JavaScript code
                for (i = 1; i <= 100; i++) {
                    test(i + " ");
                }

    Is the WebAii test being speed restricted?
  2. Cody
    Admin
    Cody avatar
    3354 posts

    Posted 11 Jun 2010 Link to this post

    Hello Alex,

    No, there are no artificial speed limits put in place in the WebAii framework. Unfortunately the InvokeScript function is just inherently slow due to the number of hoops it has to jump through to get the job done. Multiple context switches, security checks and data serialization/deserialization have to be performed by the OS between the framworks .NET code and the JavaScript engine running inside the browser.

    Sincerely yours,
    Cody
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Back to Top