By chance C# Of HttpRequest than Chrome Request the same Url A lot slower .C# HttpRequest want 500 millisecond and Chrome It only needs 39ms.

As a responsible Code the agriculture . This Must be optimized ..

later Arrangement Various methods have been optimized

HttpWebRequest request = WebRequest.Create(address) as HttpWebRequest;
request.KeepAlive = false;
request.ServicePoint.Expect100Continue = false; request.ServicePoint.UseNagleAlgorithm = false;
request.ServicePoint.ConnectionLimit = ;
request.AllowWriteStreamBuffering = false;
request.Proxy = null;

open KeepAlive attribute , This can open a tcp Connect and in Reuse over time tcp Connect , So as to speed up http request .( The default is on )( I'm opening keepalive When Server closed connection error , After the request is completed Add response.Close();request.Abort(); after The error disappears )
Expect100Continue   The role of

Send a request , Contains a Expect:100-continue, inquiry Server The user is willing to accept data
Received Server Back to 100-continue After answering , Just put the data POST to Server
So closing it can speed up http request .
also  ConnectionLimit The default is 2 , That is to say System Can only Concurrent 2 individual http request , therefore This property can be increased appropriately .

Proxy Attribute in .Net 4.0 It should be in config Add to file :

useDefaultCredentials="false" >

Other versions .NET It can be set to null.
reason :NET4.0 or 3.5 The default proxy in is on , And I didn't set it up ! Therefore, the agent can only be bypassed after waiting for a timeout , This is blocking up . Others can own Baidu . Here we are http The response speed of the system has changed from Of 500ms Reduced 60ms, But I still It's no match for Chrome. I hope there will be a better way to speed up . I'm late, I wash and sleep .

C# http performance optimization 500 Milliseconds to 60 More about millisecond

  1. C# 【Http Request returns 】 performance optimization 500 Milliseconds to 60 millisecond

    By chance C# Of HttpRequest than Chrome Request the same Url A lot slower .C# HttpRequest want 500 millisecond and Chrome It only needs 39ms. As a responsible Code the agriculture . This must ...

  2. 60 cuda Global performance optimization

    0 introduction cuda The threading model involves grid Block partition and thread configuration of , It directly affects the global computing speed . According to the document <CUDA_C_Programming_Guide>, There are three basic strategies for performance optimization . (1) Maximize ...

  3. Reprint :SqlServer Database performance optimization details

    Reprinted from : The purpose of performance tuning is to make the network flow . disk I/O and CPU Minimize time ...

  4. Website performance optimization (Yahoo 35 strip )

    Yahoo Website performance optimization 35 strip One . The content part Try to reduce  HTTP request Reduce DNS lookup Avoid jumping cache Ajxa Delay loading Advance loading Reduce DOM Element quantity Use domain name to divide page content send frame Minimum number ...

  5. Yahoo Team experience : Website performance optimization 34 Golden rule

    Yahoo The team's experience on website performance optimization , Very valuable for reference . The original English text : 1. Try to reduce HTTP Number of requests ...

  6. Yahoo Website performance optimization 34 Rules

    1. Try to reduce HTTP Number of requests End user response time , Yes 80% For downloading various contents , This part of the time includes downloading images from the page . Style sheets . Script .Flash etc. . By reducing the number of elements in the page, you can reduce HTTP Number of requests , This is to speed up the web ...

  7. MongoDB Live performance optimization

    1. Performance optimization classification mongodb Performance optimization is divided into software level and operating system level . Software level , Usually by modifying mongodb Software configuration parameters to achieve , This needs to be very familiar with mongodb Various configuration parameters inside : And the operating system level , relative ...

  8. [ turn ] Nailed H5 Performance optimization scheme

    For one H5 Products , Function is definitely important , But performance is also an integral part of the user experience . Original H5 The rendering performance is not as good as native Of app, If we don't do performance optimization , Will greatly affect the user's enthusiasm to use the product . User experience When users can ...

  9. Yahoo Website performance optimization 34 Bar rule

    Excerpt from : Yahoo Website performance optimization 34 Bar rule 1. Try to reduce HTTP Number of requests For terminal ...

Random recommendation

  1. git cherry-pick Merge a commit

    1. How to use it and its function git cherry-pick You can select one or more of a branch commit(s) To operate ( The object of operation is commit). for example , Suppose we have a stable version of the branch , It's called v2.0, And there's another one ...

  2. php function strpos()

    strpos() Function to find where a string first appears in another string . strpos(string,find,start) return   from string Medium start The location starts to look for find First occurrence Be careful : s ...

  3. Codeforces Round #333 (Div. 2)

    water  A - Two Bases Water problem , however pow The accuracy of this method is not high , It should be converted into long long The precision is lost, so just go straight double That's all right. . By hack It fell off . use long long I can save it #include < ...

  4. java.lang.NoClassDefFoundError Adding a jar to an RCP application

    to RCP Add jar The bag and the general java There are two differences in engineering , Otherwise "java.lang.NoClassDefFoundError" Open plug-in.xmlGo to R ...

  5. poi merge cell 、 Set borders

    HSSFWorkbook wb = new HSSFWorkbook(); HSSFSheet sheet = wb.createSheet(); // Create a style HSSFCellStyle sty ...

  6. utilize MySQL Trigger implementation check and assertion

    MySQL Although input check Statements do not report errors , But it's not check The function of . however MySQL Triggers can still be used to achieve the corresponding functions . In this paper, we will briefly explain MySQL Realization check and assertion Of ...

  7. comutil

    Using the library , Usually contains comsuppw.lib.kernel32.lib. _com_util::ConvertBSTRToString take VT_BSTR Type to normal string .

  8. Pyspark Use Spark Udf Some of the experience

    At first, I began to write some udf I feel a little strange when I'm here , stay spark In the calculation of , In general, through conversion (Transformation) Without triggering computation (Action) In this case, we can do some preprocessing .udf It's such an easy-to-use thing ...

  9. FFT ip core

    The FFT core provides four architecture options to offer a trade-off Trade off between core size andtransf ...

  10. wordpress Website search results page URL Pseudo static how to operate

    Website search page optimization has been ignored by many people , Just press cms Built in default settings , In fact, the search results page is a treasure ,url Rewriting is an important step in ascension . We've written about empires before CMS Search page pseudo static implementation method , that ,wordpress Website search results page ...