This is a migrated thread and some comments may be shown as answers.

Slow execution of Actions.InvokeScript

1 Answer 99 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Alex
Top achievements
Rank 1
Alex asked on 11 Jun 2010, 10:41 AM
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?

1 Answer, 1 is accepted

Sort by
0
Cody
Telerik team
answered on 11 Jun 2010, 11:05 PM
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.
Tags
General Discussions
Asked by
Alex
Top achievements
Rank 1
Answers by
Cody
Telerik team
Share this question
or