Hello,
Some of you already have noticed that their sites are working slower in Google Chrome since they have updated to version 26.
We did some debugging and research and found out that the problem is in the browser itself and it is not caused by our controls in the pages. In short, if you have a quotation mark or an apostrophe inside input element in your page, and you do PostBack, the Chrome gets really slow when changing the innerHTML property of the DOM elements after the page loads again.
The issue can be replicated using this sample code without using our controls:
Simply run the code, click the Post Back button and then click Check Speed to see how much slower gets the execution of label.innerHTML = i;
In the serialized Client State of our controls, we use JSON to serialize some properties of controls that they need to be persisted and send from client to server, for example: {"enabled":true,"emptyMessage":""} could be such string, it contains quotes and is kept inside hidden input in the page. So after the post back the innerHTML will get slower due to this bug in Chrome.
Since in our code, there are a lot of places where innerHTML is used to change the content of an element(for example when navigating RadCalendar this is called around 30 times, one for each day of the month), you will experience some delay/lag when you do such client side operations.
Note that this issue is happening even if you don't have inputs with quotes inside them, but in less degree. For example in Firefox the test function above works in 60ms and in Chrome in 80ms. After the PostBack, in Firefox continues to run in 60ms, but in Chrome it takes 9 seconds if there is input with quote, and 400ms if there is not. So in both cases there is problem in the Chrome.
Also if you have more items in the DOM tree, the problem will be more visible. For example if you remove the asp:Calendar in the sample above, it will run much faster.
We will continue to investigate if there is something that we can do, and we hope Google to fix the issue in their browser as soon as possible. If you have more information or any suggestions we will be glad to hear them.
Some of you already have noticed that their sites are working slower in Google Chrome since they have updated to version 26.
We did some debugging and research and found out that the problem is in the browser itself and it is not caused by our controls in the pages. In short, if you have a quotation mark or an apostrophe inside input element in your page, and you do PostBack, the Chrome gets really slow when changing the innerHTML property of the DOM elements after the page loads again.
The issue can be replicated using this sample code without using our controls:
<
asp:ScriptManager
runat
=
"server"
></
asp:ScriptManager
>
<
asp:TextBox
runat
=
"server"
ID
=
"text1"
Text
=
"'"
></
asp:TextBox
>
<
asp:Calendar
runat
=
"server"
></
asp:Calendar
>
<
script
type
=
"text/javascript"
>
function test()
{
var start = (new Date()).getTime();
var label = document.getElementById("<%= label1.ClientID%>");
for (var i = 0 ; i <
10000
; i++)
{
label.innerHTML
= i;
}
var end = (new Date()).getTime();
alert(end - start);
}
</script>
<
asp:Label
runat
=
"server"
ID
=
"label1"
></
asp:Label
>
<
asp:Button
runat
=
"server"
Text
=
"Post Back"
/>
<
asp:Button
runat
=
"server"
Text
=
"Check Speed"
OnClientClick
=
"test(); return false;"
/>
Simply run the code, click the Post Back button and then click Check Speed to see how much slower gets the execution of label.innerHTML = i;
In the serialized Client State of our controls, we use JSON to serialize some properties of controls that they need to be persisted and send from client to server, for example: {"enabled":true,"emptyMessage":""} could be such string, it contains quotes and is kept inside hidden input in the page. So after the post back the innerHTML will get slower due to this bug in Chrome.
Since in our code, there are a lot of places where innerHTML is used to change the content of an element(for example when navigating RadCalendar this is called around 30 times, one for each day of the month), you will experience some delay/lag when you do such client side operations.
Note that this issue is happening even if you don't have inputs with quotes inside them, but in less degree. For example in Firefox the test function above works in 60ms and in Chrome in 80ms. After the PostBack, in Firefox continues to run in 60ms, but in Chrome it takes 9 seconds if there is input with quote, and 400ms if there is not. So in both cases there is problem in the Chrome.
Also if you have more items in the DOM tree, the problem will be more visible. For example if you remove the asp:Calendar in the sample above, it will run much faster.
We will continue to investigate if there is something that we can do, and we hope Google to fix the issue in their browser as soon as possible. If you have more information or any suggestions we will be glad to hear them.