.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

Still about slow initialization time in WCF

Posted By:      Posted Date: September 29, 2010    Points: 0   Category :WCF


A few days ago I was having problems with client WCF initialization time. I though I had solved the problem by removing the automatic proxy detection option but it seems like there are still some computers where the 1st call takes way to much time (and in those cases, the proxy configuration options are ok). So, I've profiled the application and I've noticed that it takes most of the time on the RealProxy.PrivateInvoke method:


42,92% Authenticate - 8113 ms - 1 call - Mercados.WinForms.Security.MercadosUserManager.Authenticate(String, String)   (from Mercados.WinForms.Security.IUserManager)
  18,39% PrivateInvoke - 3477 ms - 1 call - System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData &, Int32)
  13,80% ChannelFactory<TChannel>..ctor - 2608 ms - 1 call - System.ServiceModel.ChannelFactory<TChannel>..ctor(String)
  10,19% CreateChannel - 1926 ms - 1 call - System.ServiceModel.ChannelFactory<TChannel>.CreateChannel()
  0,39% Dispose - 74 ms - 1 call - System.ServiceModel.ChannelFactory.Dispose()   (from System.IDisposable)
  0,00% ObtemRoles - 0 ms - 1 call - Mercados.WinForms.Security.MercadosUserManager.ObtemRoles(TipoUtilizador)
  0,00% get_Credentials - 0 ms - 2 calls - System.ServiceModel.ChannelFactory.get_Credentials()

View Complete Post

More Related Resource Links

Slow page load during a list query one time during the day


We have a monitoring tool set to check to see if the home pages for our 3 web apps load in under 60 seconds every 10 minutes.  All 3 web apps load in under 3 seconds on every 10 minute check except for one exception.  One check every day one of the web app's home page takes longer than 60 seconds to load.  This happens at 11:45PM when there is very little user usage on the environment.  The characteristics of this page are as follows: The only thing on the page is a list view web part which was added by the browser.  The page has not been customized with SPD or code at all.  The list that it pulls is a simple links list that has 281 items on it.  The view pulls all 281 items and displays them in sets of 100.  I cannot find any associated event in the server events and/or SharePoint ULS logs nor are there any daily sharepoint timer jobs running at that time.  Our full index happens at midnight with incremental happening hourly.  Our enviroment is 2 WFEs, 1 App/indexer and we have a separate SQL cluster backend.  

Could someone lead me possibly in the direction I should take next in my troubleshooting?   

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.

Slow load time of custom assembly on x64 compared to x86.

I am developing an application that automatically generates assemblies using the CSharpCodeProvider (.Net Framework 3.5).  These assemblies contain a single class with a very large number of local variables and methods.  After compilation I create an instance of this class (using Activator.CreateInstance) to be used elsewhere in the application.  When the application is deployed on a 32-bit system (tested on Win 7 Prof 32-bit and on Win XP) the CreateInstance method returns after 1 or 2 seconds, i.e. it first JITs the assembly before creating the instance.  However, on a 64-bit system (tested on Win 7 Home 64-bit, Win Server 2003 64-bit and Win Server 2008 64-bit) CreateInstance takes up to 5 minutes to return. Is there any reason why it would be that much slower on a 64-bit machine? I have tried many different options when compiling, such as setting the platform to x64, using the /optimize flag, etc, but none of these have made a difference. I also tried calling PrepareMethod on all the method in the class.  When I do this in the 32-bit environment, it takes approximately 10 seconds.  In the 64-bit environment it takes more than 3 minutes. As a last resort I tried ngen before constructing the object, but this made no difference in the execution time.

Slow BinaryReader Position Change Time


Hello, I have a question about basically a laggy position change time with a large file (actually, in this case I'm using a 20GB or so disk drive).  Basically what I'm doing is writing my own class that uses the CreateFile function to read raw data from a local disk drive, and then have an extract file class that allows me to seek to blocks (the file system is FAT) that the file occupies, then read the data, piece it together, etc.  I noticed though, that when extracting an 800KB file, it took about 10 seconds to do the process, and the main cause was that changing my reader's position took anywhere from 250 milliseconds to one complete second.

The short version: When extracting a file using my own classes, it took way longer than it should have, and the cause is changing the IO's position.


The code is exactly as you'd probably imagine:

for (int i = 0; i < f.BlocksOccupied.Length - 1; i++)
          br.BaseStream.Position = m.GetBlockOffset(f.BlocksOccupied[i], f.PartInfo);
So what I am asking is if there is any way to speed up the process of moving my posit

Slow on data retrieval for the every 1st time


Hi all,

I had developed a POS system which connected to a local database (MS SQL SERVER EXPRESS 2005).

I'm facing an issue whereby after the cashier key in barcode, the description, price per unit will be displayed very slow for the every FIRST time. The susequent items will be very fast.

This happen when the system is idle for sometime. If continuous use, will not have this issue.

Any advise or setting i can do to improve this performance issue?




Active X Control slow to load first time



I have an Active X control, which when first called or loaded in my asp.net application, is really slow to load. However, after the first load, it is really quick!!

My question is this, "How do I make my Active X control, when first called, load much faster? Is there away to preload the active x to the page so when it is used or called, it doesn't take so long to load?"

I have checked to see whether my active x is being called correctly by my javascript code, and it does. All my Active X does is to make a call to Outlook and to set some user properties. Not much.

Please help, but it has been doing my head in for days.

What makes a time series so slow to deploy and process?


I'm trying to use a SQL Server 2008 time series model.

I have 2,241 Customers x 27 Attributes x 365 days worth of data:

ForDate, CustID, Score, A1 ... A27

I want to predict Score.  ForDate and CustID are my keys.  A1 - A27 are my inputs and Score is set to PredictOnly.  Can somebody give me some insight into exactly what the algorithm is doing?

From looking at a status message it appears this model is on track to run about 8 weeks before I can see something?  Am I interpreting this correctly?  This was the status message after four hours...

Status: Learning Time Series tree for 'Score (3404)' in main model (200 of 62749)...

Is there anything I can do to speed this along?   For example Score is a double ...

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.

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.

Date and Time Functions in SQLSERVER

Date and time functions allow you to manipulate columns and variables with DATETIME and SMALLDATETIME data types.

1 DATEPART Function
2 DATENAME Function
3 DAY, MONTH, and YEAR Functions
5 DATEADD Functions
6 DATEDIFF Function
7 More SQL Server Functions

Data Types - Date and Time in SqlServer

Date and time values can be stored with either the DATETIME or SMALLDATETIME data type. The difference between the two is that SMALLDATETIME supports a smaller range of dates and does not give the same level of precision when accounting for time. The DATETIME data type can hold values from January 1st of 1753 to December 31st of 9999. The time is stored to the 1 three hundredths of a second and each value takes up 8 bytes of storage. The SMALLDATETIME data type can hold values between January 1st 1900 and June 6th of 2079. The time is tracked to the minute and each value takes up 4 bytes of storage. The majority of business applications can live happily with SMALLDATETIME, however, if you are in an environment where each second matters or you need to make estimates to the distant future (or past) then you have to resort to DATETIME. If you fail to specify the time when inserting a value into a DATETIME or SMALLDATETIME column, a default of midnight is used. If you fail to specify the date portion the default of January 1, 1900 is used.

How to programmatically add controls to Windows forms at run time by using Visual C#

Create a Windows Forms Application
Start Visual Studio .NET or Visual Studio 2005 or a later version, and create a new Visual C# Windows Application project named WinControls. Form1 is added to the project by default.
Double-click Form1 to create and view the Form1_Load event procedure.
Add private instance variables to the Form1 class to work with common Windows controls. The Form1 class starts as follows:

.NET 4 Web Application Startup Time

I was chatting with Jonathan Hawkins and some of the folks on the ASP.NET team about performance and Jonathan mentioned the startup time for large ASP.NET applications is improved on .NET 4. There are some improvements in the CLR and in ASP.NET itself that helped. If you have a giant app, you should do some tests.

Built-in Functions - Date and Time Functions

Date and time functions allow you to manipulate columns and variables with DATETIME and SMALLDATETIME data types.

Essential SQL Server Date, Time and DateTime Functions

The essential date and time functions that every SQL Server database should have to ensure that you can easily manipulate dates and times without the need for any formatting considerations at all.

Date/Time Conversions Using SQL Server

There are many instances when dates and times don't show up at your doorstep in the format you'd like it to be, nor does the output of a query fit the needs of the people viewing it. One option is to format the data in the application itself. Another option is to use the built-in functions SQL Server provides to format the date string for you.

Date and Time Data Types and Functions

The following sections in this topic provide an overview of all Transact-SQL date and time data types and functions. For information and examples that are common to date and time data types and functions
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