I was being intentional with the way the bookkeeping was designed both here
in the timers array and also with the queues. Object allocations in
backburner eventually lead to garbage, and the GC cost adds up at a large
scale on hot code paths.

On Wednesday, January 22, 2014, Giovanni Cappellotto <
notifications@github.com> wrote:

> In lib/backburner.js:
>
> >
> > -    timers.splice(i, 0, executeAt, fn);
> > +    timers.splice(i, 0, { executeAt: executeAt, fn: fn });
>
> @ebryn <https://github.com/ebryn> just out of curiosity, why are you
> concerned about allocating a new object here? We're just adding one integer
> and one pointer to a function object.
>
> @stefanpenner <https://github.com/stefanpenner> why are you saying
>
> all the values will be integers
>
> The array is always storing integers and pointers to functions, or
> pointers to objects as in this PR, am I right?
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/ebryn/backburner.js/pull/67/files#r9069307>
> .
>