Giter VIP home page Giter VIP logo

arrayiteration's Introduction

My Github Stats

I have a deep passion for technology across the board. My journey into the world of innovative human-computer interaction began back in the late 90s with virtual reality. Over time, I delved into camera-based full-body interaction through computer vision and explored augmented reality using devices like the Epson Moverio and Microsoft Hololens.

My coding journey started on a ZX Spectrum 48K, and I've since earned a Computer Science degree from the New University of Lisbon. While I spent many years working with C++, my primary coding tool of choice today is C#.

I derive great joy from sharing my experiences and constantly expanding my knowledge alongside others. You can discover a diverse collection of repositories here, but most of my open-source projects are housed within the NetFabric organization.

Additionally, I've made contributions to various projects, including:

Beyond my tech interests, I'm a devoted husband and father, and I used to be an avid BMX rider.

arrayiteration's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

arrayiteration's Issues

change for make it fast

hi, i test your benchmark and get unexcepted results:
my first test was on this class :
https://github.com/aalmada/ArrayIteration/blob/master/Benchmarks/ReadSliceBenchmarks.cs

result :

Method Count Mean Error StdDev Ratio RatioSD Gen 0 Gen 1 Gen 2 Allocated
Array_ForEach 1000000 734.8 us 2.40 us 2.25 us baseline - - - -
Array_For 1000000 1,057.0 us 4.98 us 4.66 us 1.44x slower 0.01x - - - -
Span_ForEach 1000000 1,056.6 us 4.37 us 4.09 us 1.44x slower 0.01x - - - -
ArraySegment_For 1000000 1,416.9 us 15.32 us 14.33 us 1.93x slower 0.02x - - - -
ArraySegment_ForEach 1000000 4,734.6 us 14.97 us 14.00 us 6.44x slower 0.03x - - - -
ArraySegment_Linq 1000000 9,884.1 us 82.45 us 73.09 us 13.45x slower 0.11x - - - 72 B
ArraySegment_ArrayFor 1000000 1,091.8 us 20.93 us 25.70 us 1.49x slower 0.04x - - - -
ArraySegment_SpanForEach 1000000 1,117.2 us 22.15 us 35.77 us 1.53x slower 0.05x - - - -

and when i remove some of methods get me other result.
code:

 public class ReadSliceBenchmarks : ReadBenchmarksBase
    {

        [Benchmark(Baseline = true)]
        public int Array_ForEach()
            => Sum.ForEach(_array);

        [Benchmark]
        public int Array_For()
            => Sum.For(_array, 0, _array.Length);

        [Benchmark]
        public int Span_ForEach()
            => Sum.ForEach(_array.AsSpan());

        [Benchmark]
        public int ArraySegment_For()
            => Sum.For(_arraySegment);

        //[Benchmark]
        //public int ArraySegment_ForEach()
        //    => Sum.ForEach(_arraySegment);

        //[Benchmark]
        //public int ArraySegment_Linq()
        //    => _arraySegment.Sum();

        //[Benchmark]
        //public int ArraySegment_ArrayFor()
        //    => Sum.For(_arraySegment.Array, _arraySegment.Offset, _arraySegment.Count);

        //[Benchmark]
        //public int ArraySegment_SpanForEach()
        //    => Sum.ForEach(_arraySegment.AsSpan());

    }

Result:

Method Count Mean Error StdDev Ratio RatioSD Gen 0 Gen 1 Gen 2 Allocated
Array_ForEach 1000000 1.098 ms 0.0212 ms 0.0217 ms baseline - - - -
Array_For 1000000 1.086 ms 0.0214 ms 0.0246 ms 1.01x faster 0.03x - - - -
Span_ForEach 1000000 1.077 ms 0.0169 ms 0.0149 ms 1.02x faster 0.03x - - - -
ArraySegment_For 1000000 1.435 ms 0.0285 ms 0.0305 ms 1.31x slower 0.04x - - - -

this is related to dotnet/runtime#54758

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.