fill

Benchmark created on


Preparation HTML

    <script>
      let len = 1024;

      let fill_loop = () => {
        let array = new Uint8Array(len);

        for (let i = 0; i < len; i++) {
          array[i] = 0;
        }
      };

      let intrinsic_fill = () => {
        let array = new Uint8Array(len);

        array.fill(0);
      };
    </script>

Test runner

Ready to run.

Testing in
TestOps/sec
fill_loop
fill_loop()
ready
intrinsic_fill
intrinsic_fill()
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.