Giter VIP home page Giter VIP logo

rewrittenfunctions's Introduction

Rewritten Functions

This library is for everyone who cares about micro-optimisations and also wants some extensions for other .NET classes. It contains different optimizations (and extensions), for example:

  • String helpers (e.g. ContainsIgnoreCase)
  • Math helpers (e.g. Faculty)
  • Expression Trees for replacing reflection (Get/Set Properties/Fields and execute Methods)

Benchmark results

String helpers

Method Mean Error StdDev Ratio Gen 0 Gen 1 Gen 2 Allocated
DefaultStartsWith 9,072.83 ns 46.243 ns 43.256 ns 1.00 - - - -
RFStartsWith 780.17 ns 3.832 ns 3.584 ns 1.00 - - - -
RFStartsWithIgnoreCase 1,762.30 ns 3.537 ns 3.136 ns 1.00 - - - -
DefaultEndsWith 9,541.02 ns 35.392 ns 33.105 ns 1.00 - - - -
RFEndsWith 1,034.91 ns 1.961 ns 1.739 ns 1.00 - - - -
RFEndsWithIgnoreCase 2,473.15 ns 6.717 ns 5.954 ns 1.00 - - - -
IsNotNullOrEmpty 82.79 ns 0.108 ns 0.101 ns 1.00 - - - -
RFIsFilled 81.45 ns 0.297 ns 0.278 ns 1.00 - - - -
DefaultContainsIgnoreCase 25,485.69 ns 95.362 ns 84.536 ns 1.00 2.6550 - - 14021 B
RFContainsIgnoreCase 21,296.74 ns 78.993 ns 73.890 ns 1.00 - - - -

Math helpers

Method Mean Error StdDev Ratio Gen 0 Gen 1 Gen 2 Allocated
PowNormal 3.435 us 0.0045 us 0.0040 us 1.00 - - - -
PowRF 2.792 us 0.0240 us 0.0224 us 1.00 - - - -
TryParseIntNormal 9.212 us 0.0369 us 0.0345 us 1.00 - - - -
tryParseIntRF 2.776 us 0.0106 us 0.0094 us 1.00 - - - -
BigIntVariant 339.219 us 1.4480 us 1.3544 us 1.00 20.9961 - - 110165 B
RFModLongInt 17.333 us 0.0564 us 0.0471 us 1.00 - - - -

Expression Trees

Method Mean Error StdDev Ratio Gen 0 Gen 1 Gen 2 Allocated
PropertyReflectionGetter 10,945.4 ns 9.41 ns 7.35 ns 1.00 - - - -
PropertyExpTreeGetter 226.8 ns 0.62 ns 0.58 ns 1.00 - - - -
PropertyReflectionSetter 22,421.7 ns 36.36 ns 30.37 ns 1.00 0.9766 - - 5168 B
PropertyExpTreeSetter 6,015.9 ns 23.44 ns 21.92 ns 1.00 0.3738 - - 1963 B
FieldReflectionGetter 7,126.0 ns 13.06 ns 12.21 ns 1.00 - - - -
FieldExpTreeGetter 227.0 ns 0.37 ns 0.35 ns 1.00 - - - -
FieldReflectionSetter 14,085.5 ns 32.80 ns 30.68 ns 1.00 0.3662 - - 1963 B
FieldExpTreeSetter 5,981.2 ns 18.17 ns 17.00 ns 1.00 0.3738 - - 1963 B
MethodReflection 35,230.1 ns 101.97 ns 95.38 ns 1.00 1.4038 - - 7588 B
MethodExpTree 8,467.0 ns 26.22 ns 23.24 ns 1.00 0.8240 - - 4383 B

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.