<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/array-shift-optimizations-in-firefox-s-js-engine-i8i8uhf7x" -->

---
title: Array.shift optimizations in Firefox&#x27;s JS Engine | daily.dev
description: Array.shift in Firefox&#x27;s JS Engine has been optimized to improve performance by moving the pointer of the array instead of moving items individually. This...
canonical: https://daily.dev/posts/array-shift-optimizations-in-firefox-s-js-engine-i8i8uhf7x
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Array.shift optimizations in Firefox&#x27;s JS Engine | daily.dev
og:description: Array.shift in Firefox&#x27;s JS Engine has been optimized to improve performance by moving the pointer of the array instead of moving items individually. This...
og:url: https://daily.dev/posts/array-shift-optimizations-in-firefox-s-js-engine-i8i8uhf7x
og:image: https://api.daily.dev/og/posts/i8i8Uhf7X.png
og:image:alt: Array.shift optimizations in Firefox&#x27;s JS Engine
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Array.shift optimizations in Firefox's JS Engine

**[Hacker News](https://daily.dev/sources/hn)** · 3 min read · 6 upvotes · 1 comments

## Summary

Array.shift in Firefox's JS Engine has been optimized to improve performance by moving the pointer of the array instead of moving items individually. This results in a constant time complexity for shifting elements in the array.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://lannonbr.com/blog/2020-01-27-shift-optimizations/>

## Community discussion

Top comments from developers on daily.dev.

**@benredliber** · 0 upvotes

> “Chrome has a similar algorithm, but it only works for arrays under size of ~50k items (A story for another day).”
>
> One hell of an interesting cliffhanger. Reading up more on this.

---

Tags: [#javascript](https://daily.dev/tags/javascript), [#performance](https://daily.dev/tags/performance), [#firefox](https://daily.dev/tags/firefox)

[View this post on daily.dev](https://daily.dev/posts/array-shift-optimizations-in-firefox-s-js-engine-i8i8uhf7x)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Array.shift optimizations in Firefox's JS Engine","url":"https://daily.dev/posts/array-shift-optimizations-in-firefox-s-js-engine-i8i8uhf7x","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/array-shift-optimizations-in-firefox-s-js-engine-i8i8uhf7x"},"datePublished":"2024-05-07T10:23:09.507Z","dateModified":"2024-05-09T08:29:02.242Z","description":"Array.shift in Firefox's JS Engine has been optimized to improve performance by moving the pointer of the array instead of moving items individually. This...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/0eaefa5574b5d0df9b57e1823e296fa4?_a=AQAEuiZ","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/0eaefa5574b5d0df9b57e1823e296fa4?_a=AQAEuiZ","isAccessibleForFree":true,"articleSection":"Hacker News","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Hacker News","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/hn","url":"https://daily.dev/sources/hn"},"commentCount":1,"discussionUrl":"https://daily.dev/posts/array-shift-optimizations-in-firefox-s-js-engine-i8i8uhf7x","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":6},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":1}],"keywords":"javascript,performance,firefox","timeRequired":"PT3M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Hacker News","item":"https://daily.dev/sources/hn"},{"@type":"ListItem","position":3,"name":"Array.shift optimizations in Firefox's JS Engine"}]}
{"@context":"https://schema.org","@type":"WebPage","@id":"https://daily.dev/posts/array-shift-optimizations-in-firefox-s-js-engine-i8i8uhf7x","comment":[{"@type":"Comment","text":"“Chrome has a similar algorithm, but it only works for arrays under size of ~50k items (A story for another day).”\nOne hell of an interesting cliffhanger. Reading up more on this.","datePublished":"2024-05-07T18:55:51.325Z","url":"https://daily.dev/posts/i8i8Uhf7X#c-KgtS16JHH","author":{"@type":"Person","name":"ben-redliber","url":"https://daily.dev/benredliber","image":"https://avatars.githubusercontent.com/u/159011923?v=4"}}]}
```

