Skip to main content

Dot Net CLR Performance considerations while Architecting

Performance considerations while architecting dot net applications.
  1. Throwing Few Exceptions : 
    • Avoid exceptions with in loops.
    • Minimal use of functions like Response.Redirect() which throws a ThreadAbort exception.
    • COM usage could result in HRESULTS exception, make sure to track these.
    • Usages of ValueTypes where ever possible, rather using Reference types that is classes. Avoiding boxing and un-boxing for best use of memory.
    • Reduce interaction with unmanaged code. COM interop is much more expensive.The following steps needs to be taken while interacting with unmanaged code.
      • Data Marshalling
      • fix calling convention
      • Protect callee-saved registeres
      • Switch thread mode so that GC won't block unmanaged threads
      • Erect an Exception Handling frame on calls into managed code
      • Handle threading properly
    • Use For loop for string iteration. For loop on strings is five times faster than Foreach.
    • StringBuilder for complex string manipulation increases performance.
    • System.IO buffer size could be between 4KB and 8KB for best performance
    • Asynchronous IO when applied correctly, it gives as much as ten times the performance.

    Comments

    Popular posts from this blog

    ABOD and its PyOD python module

    Angle based detection By  Hans-Peter Kriegel, Matthias Schubert, Arthur Zimek  Ludwig-Maximilians-Universität München  Oettingenstr. 67, 80538 München, Germany Ref Link PyOD By  Yue Zhao   Zain Nasrullah   Department of Computer Science, University of Toronto, Toronto, ON M5S 2E4, Canada  Zheng Li jk  Northeastern University Toronto, Toronto, ON M5X 1E2, Canada I am combining two papers to summarize Anomaly detection. First one is Angle Based Outlier Detection (ABOD) and other one is python module that  uses ABOD along with over 20 other apis (PyOD) . This is third part in the series of Anomaly detection. First article exhibits survey that covered length and breadth of subject, Second article highlighted on data preparation and pre-processing.  Angle Based Outlier Detection. Angles are more stable than distances in high dimensional spaces for example the popularity of cosine-based similarity measures for text data. Object o is an out

    TableSense: Spreadsheet Table Detection with Convolutional Neural Networks

     - By Haoyu Dong, Shijie Liu, Shi Han, Zhouyu Fu, Dongmei Zhang Microsoft Research, Beijing 100080, China. Beihang University, Beijing 100191, China Paper Link Abstract Spreadsheet table detection is the task of detecting all tables on a given sheet and locating their respective ranges. Automatic table detection is a key enabling technique and an initial step in spreadsheet data intelligence. However, the detection task is challenged by the diversity of table structures and table layouts on the spreadsheet. Considering the analogy between a cell matrix as spreadsheet and a pixel matrix as image, and encouraged by the successful application of Convolutional Neural Networks (CNN) in computer vision, we have developed TableSense, a novel end-to-end framework for spreadsheet table detection. First, we devise an effective cell featurization scheme to better leverage the rich information in each cell; second, we develop an enhanced convolutional neural network model for tab

    Rule Extraction Algorithm for Deep Neural Networks: A Review

    -By Tameru Hailesilassie Department of Computer Science and Engineering National University of Science and Technology (MISiS) Moscow, Russia Today's blog is the continuation of XAI series. Rule Extraction from Neural Networks Abstract—Despite the highest classification accuracy in wide varieties of application areas, the artificial neural network has one disadvantage. The way this Network comes to a decision is not easily comprehensible. The lack of explanation ability reduces the acceptability of neural network in data mining and decision system. This drawback is the reason why researchers have proposed many rule extraction algorithms to solve the problem. Recently, Deep Neural Network (DNN) is achieving a profound result over the standard neural network for classification and recognition problems. It is a hot machine learning area proven both useful and innovative. This paper has thoroughly reviewed various rule extraction algorithms, considering the classifi