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

Server-side rendering of Telerik RadEditor is slow.

3 Answers 98 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Tim
Top achievements
Rank 1
Tim asked on 30 Sep 2008, 08:13 PM
Hi,

I'm tracking down some bottlenecks in our product using JetBrains dotTrace product and have found that the RadEditor is taking about 5 seconds to render on the server.

We're using RadEditor.NET2.dll version 7.2.1.0.

Below is some profiling data that I collected.  The format is:

<percentage of time> <method name> - <total time> - <total calls> <fully qualified method name>

Every time a method calls another method, that method is shown below the caller and indented by two spaces.  The result is a tree of method calls.

33.56 % RegisterScriptDescriptors - 19548 ms - 4 calls - Telerik.Web.UI.RadEditor.RegisterScriptDescriptors()
  33.56 % RegisterScriptDescriptors - 19548 ms - 4 calls - System.Web.UI.ScriptManager.RegisterScriptDescriptors(IScriptControl)
    33.56 % RegisterScriptDescriptors - 19548 ms - 4 calls - System.Web.UI.ScriptControlManager.RegisterScriptDescriptors(IScriptControl)
      33.54 % GetScriptDescriptors - 19538 ms - 4 calls - Telerik.Web.UI.RadWebControl.GetScriptDescriptors()   (from System.Web.UI.IScriptControl)
        33.54 % GetScriptDescriptors - 19538 ms - 4 calls - Telerik.Web.UI.RadEditor.GetScriptDescriptors()
          33.54 % GetScriptDescriptors - 19538 ms - 4 calls - Telerik.Web.UI.ScriptRegistrar.GetScriptDescriptors(WebControl)
            31.94 % DescribeComponent - 18607 ms - 4 calls - Telerik.Web.UI.RadWebControl.DescribeComponent(ScriptComponentDescriptor)   (from Telerik.Web.IControl)
              31.94 % DescribeComponent - 18607 ms - 4 calls - Telerik.Web.UI.RadEditor.DescribeComponent(ScriptComponentDescriptor)
                25.27 % Serialize - 14721 ms - 16 calls - System.Web.Script.Serialization.JavaScriptSerializer.Serialize(Object)
                  25.27 % SerializeValue - 14721 ms - 16 calls - System.Web.Script.Serialization.JavaScriptSerializer.SerializeValue(Object, StringBuilder, Int32, Hashtable, SerializationFormat)
                    25.25 % SerializeValueInternal - 14711 ms - 16 calls - System.Web.Script.Serialization.JavaScriptSerializer.SerializeValueInternal(Object, StringBuilder, Int32, Hashtable, SerializationFormat)
                      24.98 % SerializeEnumerable - 14551 ms - 12 calls - System.Web.Script.Serialization.JavaScriptSerializer.SerializeEnumerable(IEnumerable, StringBuilder, Int32, Hashtable, SerializationFormat)
                        24.96 % SerializeValue - 14541 ms - 32 calls - System.Web.Script.Serialization.JavaScriptSerializer.SerializeValue(Object, StringBuilder, Int32, Hashtable, SerializationFormat)
                          24.50 % Serialize - 14271 ms - 32 calls - System.Web.Script.Serialization.JavaScriptSerializer.Serialize(Object, StringBuilder, SerializationFormat)
                            24.50 % SerializeValue - 14271 ms - 32 calls - System.Web.Script.Serialization.JavaScriptSerializer.SerializeValue(Object, StringBuilder, Int32, Hashtable, SerializationFormat)
                              24.50 % SerializeValueInternal - 14271 ms - 32 calls - System.Web.Script.Serialization.JavaScriptSerializer.SerializeValueInternal(Object, StringBuilder, Int32, Hashtable, SerializationFormat)
                                24.50 % SerializeDictionary - 14271 ms - 32 calls - System.Web.Script.Serialization.JavaScriptSerializer.SerializeDictionary(IDictionary, StringBuilder, Int32, Hashtable, SerializationFormat)
                                  24.48 % SerializeValue - 14261 ms - 68 calls - System.Web.Script.Serialization.JavaScriptSerializer.SerializeValue(Object, StringBuilder, Int32, Hashtable, SerializationFormat)
                                    24.46 % SerializeValueInternal - 14250 ms - 68 calls - System.Web.Script.Serialization.JavaScriptSerializer.SerializeValueInternal(Object, StringBuilder, Int32, Hashtable, SerializationFormat)
                                      24.43 % SerializeEnumerable - 14230 ms - 32 calls - System.Web.Script.Serialization.JavaScriptSerializer.SerializeEnumerable(IEnumerable, StringBuilder, Int32, Hashtable, SerializationFormat)
                                        24.41 % SerializeValue - 14220 ms - 264 calls - System.Web.Script.Serialization.JavaScriptSerializer.SerializeValue(Object, StringBuilder, Int32, Hashtable, SerializationFormat)
                                          19.96 % Serialize - 11627 ms - 264 calls - Telerik.Web.UI.EditorConverterBase.Serialize(Object, JavaScriptSerializer)
                                            11.41 % ShouldSkipProperty - 6650 ms - 3680 calls - Telerik.Web.UI.EditorToolConverter.ShouldSkipProperty(PropertyInfo, Object, Object)
                                              5.71 % ShouldSkipProperty - 3325 ms - 3576 calls - Telerik.Web.UI.EditorConverterBase.ShouldSkipProperty(PropertyInfo, Object, Object)
                                                3.04 % IsDefaultValue - 1773 ms - 1868 calls - Telerik.Web.UI.EditorConverterBase.IsDefaultValue(PropertyInfo, Object)
                                                  2.99 % GetCustomAttributes - 1743 ms - 1868 calls - System.Reflection.RuntimePropertyInfo.GetCustomAttributes(Type, Boolean)
                                                    2.97 % GetCustomAttributes - 1732 ms - 1868 calls - System.Reflection.CustomAttribute.GetCustomAttributes(RuntimePropertyInfo, RuntimeType)
                                                      2.96 % GetCustomAttributes - 1722 ms - 1868 calls - System.Reflection.CustomAttribute.GetCustomAttributes(Module, Int32, Int32, RuntimeType, Boolean, IList)
                                                        1.58 % FilterCustomAttributeRecord - 921 ms - 4716 calls - System.Reflection.CustomAttribute.FilterCustomAttributeRecord(CustomAttributeRecord, MetadataImport, Assembly &, Module, MetadataToken, RuntimeType, Boolean, Object [], IList, RuntimeType &, RuntimeMethodHandle &, Boolean &, Boolean &)
                                                          0.52 % ResolveType - 300 ms - 4716 calls - System.Reflection.Module.ResolveType(Int32, Type [], Type [])
                                                            0.19 % get_MetadataImport - 110 ms - 4716 calls - System.Reflection.Module.get_MetadataImport()
                                                              0.09 % GetMetadataImport - 50 ms - 4716 calls - System.ModuleHandle.GetMetadataImport()
                                                                0.00 % op_Explicit - 0 ms - 4716 calls - System.IntPtr.op_Explicit(Void *)
                                                              0.05 % get_ModuleHandle - 30 ms - 4716 calls - System.Reflection.Module.get_ModuleHandle()
                                                                0.02 % op_Explicit - 10 ms - 4716 calls - System.IntPtr.op_Explicit(IntPtr)
                                                            0.07 % GetModuleHandle - 40 ms - 4716 calls - System.Reflection.Module.GetModuleHandle()
                                                              0.02 % get_InternalModule - 10 ms - 4716 calls - System.Reflection.Module.get_InternalModule()
                                                              0.02 % ModuleHandle..ctor - 10 ms - 4716 calls - System.ModuleHandle..ctor(Void *)
                                                              0.02 % op_Explicit - 10 ms - 4716 calls - System.IntPtr.op_Explicit(IntPtr)
                                                            0.05 % ResolveTypeHandle - 30 ms - 4716 calls - System.ModuleHandle.ResolveTypeHandle(Int32, RuntimeTypeHandle [], RuntimeTypeHandle [])
                                                              0.05 % GetMetadataImport - 30 ms - 4716 calls - System.ModuleHandle.GetMetadataImport()
                                                                0.02 % op_Explicit - 10 ms - 4716 calls - System.IntPtr.op_Explicit(Void *)
                                                            0.03 % ConvertToTypeHandleArray - 20 ms - 9432 calls - System.Reflection.Module.ConvertToTypeHandleArray(Type [])
                                                            0.03 % GetRuntimeType - 20 ms - 4716 calls - System.RuntimeTypeHandle.GetRuntimeType()
                                                            0.02 % op_Implicit - 10 ms - 4716 calls - System.Reflection.MetadataToken.op_Implicit(MetadataToken)
                                                          0.24 % IsAssignableFrom - 140 ms - 4716 calls - System.Type.IsAssignableFrom(Type)
                                                            0.12 % CanCastTo - 70 ms - 4716 calls - System.RuntimeType.CanCastTo(RuntimeType, RuntimeType)
                                                              0.03 % CanCastTo - 20 ms - 4716 calls - System.RuntimeTypeHandle.CanCastTo(RuntimeTypeHandle)
                                                              0.02 % GetTypeHandleInternal - 10 ms - 9432 calls - System.RuntimeType.GetTypeHandleInternal()
                                                            0.07 % get_UnderlyingSystemType - 40 ms - 9432 calls - System.RuntimeType.get_UnderlyingSystemType()
                                                          0.21 % AptcaCheck - 120 ms - 1828 calls - System.Reflection.Assembly.AptcaCheck(Assembly)
                                                            0.14 % get_AssemblyHandle - 80 ms - 3656 calls - System.Reflection.Assembly.get_AssemblyHandle()
                                                              0.02 % get_InternalAssembly - 10 ms - 3656 calls - System.Reflection.Assembly.get_InternalAssembly()
                                                              0.02 % AssemblyHandle..ctor - 10 ms - 3656 calls - System.AssemblyHandle..ctor(Void *)
                                                            0.03 % AptcaCheck - 20 ms - 1828 calls - System.AssemblyHandle.AptcaCheck(AssemblyHandle)
                                                              0.00 % op_Explicit - 0 ms - 1828 calls - System.IntPtr.op_Explicit(Void *)
                                                          0.09 % get_Assembly - 50 ms - 3656 calls - System.RuntimeType.get_Assembly()
                                                            0.03 % GetAssemblyHandle - 20 ms - 3656 calls - System.RuntimeTypeHandle.GetAssemblyHandle()
                                                              0.02 % AssemblyHandle..ctor - 10 ms - 3656 calls - System.AssemblyHandle..ctor(Void *)
                                                            0.02 % GetTypeHandleInternal - 10 ms - 3656 calls - System.RuntimeType.GetTypeHandleInternal()


Is there anything I can do to improve performance?

I tried to log this under IE 7 but got a JavaScript error:
   Line: 4459
   Error: '_f.get_contentArea()' is null or not an object.

3 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 02 Oct 2008, 08:57 AM
Hi Tim,

There was a slow loading problem on the server in version 7.1.2 of RadEditor due to a modification in the RadControls\Editor\Dialogs\blank.html file.

If you experience this problem on your side, you can easily fix it by opening the RadControls\Editor\Dialogs\blank.html file and replace its content with

<root></root>

Save the file.

The problem is fixed in version 7.2.1 but please make sure that you are not using v7.1.2 or
the RadControls\Editor\Dialogs\blank.html contains content different from "<root></root>".


Best regards,
Rumen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Tim
Top achievements
Rank 1
answered on 02 Oct 2008, 03:54 PM
Thank you for your informative response Rumen.

After more investigation, using the module viewer pane in Visual Studio, I've found that it is the Telerix.Web.UI.dll (version 2008.02.0723.35) that is actually being loaded.  I'm sorry for giving you wrong information before.

Is the advice you gave before applicable to this assembly?  

By the way, I made the changes to blank.html but did not see any speed improvment.

Thanks again!

Tim
0
Rumen
Telerik team
answered on 06 Oct 2008, 09:07 AM
Hi Tim,

The answer in my previous reply applies only to RadEditor Classic, because you have not specified that you are using also RadEditor for ASP.NET AJAX.

The serverside time it takes for the editor to render is bigger in RadEditor for ASP.NET AJAX (Telerik.Web.UI.dll) compared to RadEditor Classic (RadEditor.Net2.dll), because the RadEditor Prometheus is built on top of the MS AJAX framework.

The MS AJAX framework uses the .NET reflection mechanism for dynamic introspection of properties to build the initialization string that gets sent to the clientside to initialize the clientside counterpart of the control.
Reflection is different than running compiled code by about 10 times. However, this cannot be changed, as it is the way MS AJAX framework works.

The result is, that it will not be possible to make editor server-rendering significantly faster.

The MS AJAX framework provides a number of very useful features and has great built-in functionality that allows the Prometheus suite to have reduced codebase and a large feature set across all Prometheus controls.
Thus, after weighing the pros and cons, choosing the MS AJAX framework was a conscious choice and the overall response from users have been very positive. By using MS AJAX we were also able to reduce the loading time of RadEditor Prometheus on the client by 80%, and that has also been acknowledged by many performance-concerned users.

Best regards,
Rumen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Editor
Asked by
Tim
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Tim
Top achievements
Rank 1
Share this question
or