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

Poor Performance, Heavy use of reflection By RadControls

4 Answers 506 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Keith Tingle
Top achievements
Rank 1
Keith Tingle asked on 20 Oct 2008, 05:11 PM
I am currently profiling our ASP.NET web application which is built on Telerik ASP.NET AJAX controls, an Oracle 10g database, and MS LDAP server (ADAM).

I was shocked by the results of my first run with the profiler. Even though this is a small web form that makes several calls to Oracle and to LDAP in the code behind.., the Telerik.Web.UI.RadAjaxControl represents 77+% of our page processing time! In other words the Telerik controls take longer to render HTML than our backend takes to run several SQL & LDAP queries to geographically remote servers.

Looking more deeply revealed that the DecribeComponent() method invokes the reflective method 'GetCustomAttribute' almost 500 times per page request!

Profiler Results

I am trying to understand why an ajax framework would need to make heayweight reflective calls like this, is there anyway to disable this use of relection without porting to a different set of controls?





4 Answers, 1 is accepted

Sort by
0
Nikolay Rusev
Telerik team
answered on 23 Oct 2008, 01:35 PM
Hi Keith,

RadControls for ASP.NET AJAX are built on top of the ASP.NET AJAX Framework. To have any ASP.NET server side control ajax enabled using ASP.NET AJAX Framework, your control should implement IScriptControl interface. Because of this fact each RadControl implements IScriptControl interface. This interface has two methods GetScriptDescriptor and GetScriptReferences. On Page.PreRender your ajax enabled control should be registered as script control, on Page.Render the control should “describe” itself for the client object.  You can find detailed information about this on the links below:

As I can see from the screen dump you send us, most time consuming operations are related with the methods inherited from IScriptControl interface.

Unfortunately we are aware of this and as far as this is limitation of the framework we are looking forward to a better solution.


Sincerely yours,
Nikolay
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Jason Clark
Top achievements
Rank 1
answered on 04 Jan 2009, 07:59 PM
I have also saw this in a profile we did on a test interface of a new app we're building.  At this point we're questioning if we can go ahead with Telerik controls on the front end of a high traffic web interface.   DescribeComponent which intern calls GetCustomAttribute is absolutely terrible for performance, that method is flagged as one of the worst to call when using reflection.   I realize that this may be due to your reliance on the ajax framework, but surely you can do something about this?  Can you not cache these calls at all?
0
Nikolay Rusev
Telerik team
answered on 07 Jan 2009, 04:28 PM
Hello Jason,

Telerik controls for ASP.NET AJAX are absolutely adequate on the front end of a high traffic web interface. Of course you can find a dozen examples on how to optimize RadControls when using huge amount of data. The links below shows few of them:
Boosting Performance with LINQ
Heavy data load/viewstate optimization
HTTP Compression for your ASP.NET AJAX applications
Optimize your ASP.NET data entry validation

Kind regards,
Nikolay
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Jason Clark
Top achievements
Rank 1
answered on 07 Jan 2009, 05:38 PM
NikR,

I'm sure for the common sites out there, they are perfectly fine.   However, when you are building something that lets say is a SaaS product you need to ensure your as light as you can be on server processing time to maximize server / user ratio.   The reflection calls inside DescribeComponent are very very ugly under heavy load.   When removing the controls and just using some plain old js controls performance went up almost three fold.    I have a open support ticket and it's a known issue that looks like will be addressed soon.

Thanks
Tags
General Discussions
Asked by
Keith Tingle
Top achievements
Rank 1
Answers by
Nikolay Rusev
Telerik team
Jason Clark
Top achievements
Rank 1
Share this question
or