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 sim...

    Ownership at Large

     Open Problems and Challenges in Ownership Management -By John Ahlgren, Maria Eugenia Berezin, Kinga Bojarczuk, Elena Dulskyte, Inna Dvortsova, Johann George, Natalija Gucevska, Mark Harman, Shan He, Ralf Lämmel, Erik Meijer, Silvia Sapora, and Justin Spahr-Summers Facebook Inc.  Software-intensive organizations rely on large numbers of software assets of different types, e.g., source-code files, tables in the data warehouse, and software configurations. Who is the most suitable owner of a given asset changes over time, e.g., due to reorganization and individual function changes. New forms of automation can help suggest more suitable owners for any given asset at a given point in time. By such efforts on ownership health, accountability of ownership is increased. The problem of finding the most suitable owners for an asset is essentially a program comprehension problem: how do we automatically determine who would be best placed to understand, maintain, ev...

    Hybrid Approach to Automation, RPA and Machine Learning

    - By Wiesław Kopec´, Kinga Skorupska, Piotr Gago, Krzysztof Marasek  Polish-Japanese Academy of Information Technology Paper Link Courtesy DZone   Abstract One of the more prominent trends within Industry 4.0 is the drive to employ Robotic Process Automation (RPA), especially as one of the elements of the Lean approach.     The full implementation of RPA is riddled with challenges relating both to the reality of everyday business operations, from SMEs to SSCs and beyond, and the social effects of the changing job market. To successfully address these points there is a need to develop a solution that would adjust to the existing business operations and at the same time lower the negative social impact of the automation process. To achieve these goals we propose a hybrid, human-centred approach to the development of software robots. This design and  implementation method combines the Living Lab approach with empowerment through part...