.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Element host first time creation performance.

Posted By:      Posted Date: October 21, 2010    Points: 0   Category :WPF

Hi ,

We have WPF app and sometimes we display windows panel with windows controls. And one of those controls can be again a WPF control, which is hosted in element host.


WPF (MainWindow)







This windows Panel on an average has 2-3 wpf controls. Everytime panel is displayed the initialization of first element host is taking around 250 ms and subsequent element hosts very less around 10 ms. We are disposing panel once it is closed. Per this article if we create an empty element host and keep it alive/visible till the life of app, any subsequent creation of elementhosts takes very little time, which is true and i tested with a sample project. But when i created an empty element host and added to our Main wpf window, it does not help. Which means, when a wndow panel displayed element host inside it still takes around 250 ms. Any ideas whats going on here?



View Complete Post

More Related Resource Links

Performance Tests: Precise Run Time Measurements with System.Diagnostics.Stopwatch

Everybody who does performance optimization stumbles sooner or later over the Stopwatch class in the System.Diagnostics namespace. And everybody has noticed that the measurements of the same function on the same computer can differ 25% -30% in run time. This article shows how single threaded test programs must be designed to get an accuracy of 0.1% - 0.2% out of the Stopwatch class. With this accuracy, algorithms can be tested and compared.

Why does .NET Framework 4 client profile slow down boot time network creation?

I've been running a Windows XP sp3 KVM virtual machine for a long time now, and some recent update made the initial network startup go from a few seconds at boot time to around 90 seconds. Using Add/Remove program to uninstall recent updates points the finger at .NET Framework 4 client profile. With it installed, if I right click on network and ask for properties right after booting, there is a 90 second delay before the network dialog with the list of network interfaces finally appears. In addition, the network drive I have automounted at login is not accessible for the same 90 seconds. As an experiment, I tried going into the device manager and deleting the network interface, and if I reboot after that it takes 90 seconds for the new hardware wizard to appear. All these 90 second delays vanish if I remove this .NET update. The network comes up as soon as the system boots.

CPU Performance over time

Hello trying to get a hold of my cpu useage at 15min intervals starting from 00:00 then 00:15 then 00:30 and so on until 23:45 Cribed this off the interveb which gives it every minute but this is too detailed! DECLARE @ts_now bigint = (SELECT cpu_ticks/(cpu_ticks/ms_ticks)FROM sys.dm_os_sys_info); SELECT TOP(30) SQLProcessUtilization AS [SQL Server Process CPU Utilization],                SystemIdle AS [System Idle Process],                100 - SystemIdle - SQLProcessUtilization AS [Other Process CPU Utilization],                DATEADD(ms, -1 * (@ts_now - [timestamp]), GETDATE()) AS [Event Time] FROM (       SELECT record.value('(./Record/@id)[1]', 'int') AS record_id,             record.value('(./Record/SchedulerMonitorEvent/SystemHealth/SystemIdle)[1]', 'int')             AS [SystemIdle],             record.value('(./Record/SchedulerMonitorEvent/SystemHealth/ProcessUtilization)[1]',             'int')

How to Javascript download one time not every Session speed performance

my Side when open every time javascript file download i want only one time download not every time for web site speed performanceHow to Javascript download one time not every Session speed performance

Performance - page is being loaded for the first time vs SubSequent Request

Hello, I have some serious performance Issues with  Windows controls loading first time on IE Browser then subsequent request's. When ever i open Browser first time , mywebsite takes 7 seconds to load, but on subsequent request  without closing browser it loads with-in 2 seconds.I Knew IIS on first time it re-compiles the process and for subsequent request's  it wont perform and it cahches .I'm looking for better  options to improve performance,  when ever  first time reqest's  comes to web server. On IIS 7  Server,I was using both Dynamic and Static compression enabled.Also,On application pool ,I set "ShutDown Time(Limit)" and "Startup Time(Limit") to 90 (seconds).Here is web.config i disable below to improve performance issues.   <trace enabled="false" pageOutput="false" />    <compilation debug="false"/>   Here is the Server Configuration Windows 2008 ServerIIS 7 64   bit Upto Date patches..Net Framework  2.0,3.0,3.5   Need   inputs to improve performance when user call website for  first time...

Performance of XBAP in .NET 4 degrades after a long idle time.


A few of my clients are using XBAP application running over .net 4 client profile in IE8. The operating system they use is windows XP (service pack 2 or 3) on all their machines. We've had no issues during install of the .net framework or our XBAP application but many of them are complaining that after keeping the xbap open for a long time their computer begins to slow down considerably. This specially happens when program is left open without using it for some time. On my own development system which is a windows 7 machine with full .net framework installed i haven't experienced such issue.

I checked for resource usage of the application but there is no significant increase in memory usage. The CPU consumption however becomes quite high, which I suspect is the reason for degradation of performance during these episodes. If this was a single case i would have ignored it for some glitch on their system but this is happening on many machines and I suspect this has got something to do with .net framework on xp machines.

I don't see any reason for why this should be happening. Is there any documented bug, report related to this ? Are there any compatibility issues of .net 4 with other common programs running in xp?  Do you have any idea on why this could be happening ? What kind of data should i provide you s

"Could not find default endpoint element that references contract " @ Expression Blend @ Design Time


so, in Expression Blend, and only there, during design time i get an error:

"System.InvalidOperationException was unhandled by user code

Could not find default endpoint element that references contract 'GBAUploadService.IGBAUploadService' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this contract could be found in the client element."

this doesn't happen in Visual Studio 2010, and of course the service itself works flawlessly.

any ideas?


the code triggering the exception is part of a ObjectDataProvider, which consumes a web service in code-behind:


  public class FileGroupsDataProvider
    public BaseUploadJob[] GetFileGroups()
      if (Assembly.GetEntryAssembly() != null)
        using (GBAUploadServiceClient gbaUploadServiceClient = new GBAUploadServiceClient())
          BaseUploadJob[] baseUploadJobs = gbaUploadServiceClient.GetFileGroups();
          return baseUploadJobs;
      return null;

Programmatic Host Creation


I'm trying very hard to get a solution out the door where I can spin up multiple instances of a service using the same assembly.  I have the following service definition in my config file, which is working great:

      <service behaviorConfiguration="AuthBehavior"
        <endpoint address="http://localhost:8733/gateway/test1" behaviorConfiguration="RESTAuth"
          binding="webHttpBinding" contract="example.IAuthorizer" name="RESTEndpoint" />
            <add baseAddress="http://localhost:8733/gateway/default/" />

Round off time to the nearest minute

How would you round this up to the nearest minute? There isn't a built in function to do this so you have to use a little bit of maths to get there. There are 60 seconds in a minute. We already have 38 seconds on the clock. So we need to add on 60 - 38 = 22 more seconds.

ASP.NET Best Practices for High Performance Applications

This article lists the techniques that you can use to maximize the performance of your ASP.NET applications. It provides common issues, design guidelines, and coding tips to build optimal and robust solutions.

Top .NET Performance Problems and how to avoid them

Every time I work with one of our .NET customers to help them with managing their application performance I come across the same problems as seen with other clients before: lots of ADO.NET queries, many hidden exceptions in core or 3rd party .NET libraries, slow 3rd party components, inefficient custom code

High-Performance .NET Application Development & Architecture

It has always been a goal of project architects to plan an effective strategy from the ground up in regards to an new application. All relevant factors are taken into consideration with respect to the application, from its design and layout to a functional website infrastructure. Pre-.NET strategies and design guidelines still effective now were developed with Microsoft's DNA (Distributed interNet Application) platform. This model successfully served the purpose of architecting N(any number of)-Tier (levels) applications. In its basic sense, as in most robust, distributed applications, you'll architect 3 main layers or Tiers: presentation, business rules and data access.

How to improve the performance of ASP.NET MVC web applications

It is an in depth analysis of a Digg-like site and how it went from serving (on a test machine) 6 req/sec to 390 req/sec.

The biggest gain, 74 req/sec to 390 req/sec happened when he introduced data caching and another 25 req/sec where gained when he introduced the compilation of LINQ queries.

High Performance ASP.NET - Speeding Up ASP.NET Pages

have been writing a series of blog posts, which I have named High Performance ASP.NET Websites Made Easy! There is no rhyme or reason to the order of these posts and certainly can be read in any order:

Developing High Performance and Scalable ASP.NET Websites
Avoid Chatty Interfaces Between the Tiers in Your ASP.NET Web Application
ASP.NET Page Profiling - Page Tracing - High Performance and Scalable ASP.NET Websites Made Easy
Web Applications: N-Tier vs. N-Layer - Benefits and Trade-Offs
Query Analyzer - Sql Server Database Indexes and Execution Plans

Improving Application Performance in .Net

Application performance has always been a concern for Web Application developers. This article contains guidelines and tips for maximizing application performance in ASP.NET.

Tips to Improve Your ASP.NET Web site performance

ASP.NET has been developed with lots of features which makes developer life easy. Start from ViewState, PostBack, Server Controls , User Controls and etc. All of them can make your web development experience fun and easy, but improper use of them can cause your site performance slowdown. Most of the controls generate overhead to the client and server. Therefore in this article, I I will list out about things you can do and don't to improve your ASP.NET website performance.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend