Giter Site home page Giter Site logo

Abstract things about heaps HOT 4 CLOSED

heapsio avatar heapsio commented on August 19, 2024
Abstract things

from heaps.

Comments (4)

ncannasse avatar ncannasse commented on August 19, 2024

Note: doing some benchs, it seems that filling an Array and then converting it to Float32Array is ~15% faster than resizing a Float32Array. See example below

        for( i in 0...5 ) {

            var t0 = haxe.Timer.stamp();
            var a = [];
            for( i in 0...10000000 )
                a.push(i * 1.5);
            var at = new js.html.Float32Array(a);
            trace(haxe.Timer.stamp() - t0);

            var t0 = haxe.Timer.stamp();
            var a = new js.html.Float32Array(16);
            for( i in 0...10000000 ) {
                if( a.length == i ) {
                    var n = new js.html.Float32Array((a.length * 4) >> 1);
                    n.set(a);
                    a = n;
                }
                a[i] = i * 1.5;
            }
            trace(haxe.Timer.stamp() - t0);
        }

from heaps.

ncannasse avatar ncannasse commented on August 19, 2024

Using Array.push is also faster than using a[i] = v;

from heaps.

ncannasse avatar ncannasse commented on August 19, 2024

Done in [webgl] branch

from heaps.

delahee avatar delahee commented on August 19, 2024

yummy yummy :)

2013/7/22 Nicolas Cannasse [email protected]

Done in [webgl] branch


Reply to this email directly or view it on GitHubhttps://github.com//issues/14#issuecomment-21327692
.

David Elahee

from heaps.

Related Issues (20)

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.