Script Preparation code:
AخA
 
    function Custom(iterable = null) {
        if (iterable !== null) {
            this.array = Array.from(iterable);
        } else {
            this.array = [];
        }
        this.length = this.array.length;
        this.index0 = 0;
    }
    Custom.prototype.item = function (accessor) {
        return this.array[this.index0 + Number(accessor)];
    };
    Custom.prototype.set = function (index, value) {
        const newIndex = this.index0 + Number(index);
        if (newIndex >= this.length) {
            this.length = newIndex + 1;
        }
        this.array[newIndex] = value;
    };
    Custom.prototype.shift = function () {
        if (this.length !== 0) {
            this.length--;
            this.index0++;
            return this.array[this.index0 - 1];
        }
        return undefined;
    };
    Custom.prototype.pop = function () {
        if (this.length !== 0) {
            this.length--;
            return this.array[this.index0 + this.length];
        }
        return undefined;
    };
    Custom.prototype.push = function (value) {
        this.array[this.index0 + this.length] = value;
        this.length++;
    };
function p(array) {
  for (var i = 0; i <= 10000000; i++) {
       array[array.length] = i;
  }
return array;
}
var a1 = p([]);
var a2 = p([]);
var q = new Custom(p(p(p(p(p([]))))));
var s = new Custom(p(p(p(p(p([]))))));
Tests:
  • Array Shift

     
    a1.shift();
  • Array Pop

     
    a2.pop();
  • Custom Shift

     
    q.shift();
  • Custom Pop

     
    s.pop();
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Array Shift
    Array Pop
    Custom Shift
    Custom Pop

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: one year ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36
Chrome 116 on Mac OS X 10.15.7
View result in a separate tab
Test name Executions per second
Array Shift 1062.8 Ops/sec
Array Pop 31789050.0 Ops/sec
Custom Shift 16700338.0 Ops/sec
Custom Pop 16463451.0 Ops/sec