Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8812603
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T03:38:28+00:00 2026-06-14T03:38:28+00:00

I wonder if working with arrays (or objects) which contain about 100 000 elements

  • 0

I wonder if working with arrays (or objects) which contain about 100 000 elements (properties) can cause performance or memory problems in browsers when frequently access them using indexOf, slice etc. Are there some recommendations for working with big arrays in modern browsers?

My particular case. I have the following structure:

tack01: [array of elements 10 000 in average]
…
tack0n: [array of elements 10 000 in average]

tracks average amount is 10.

element looks like {id: “xa432fds”, some properties}

During the runtime I need to access any of the element knowing providing it’s id.

If I use this structure without transformation I need to perform search throught all tracks and use indexOf to find element with Id.

So I deside to create an index object which has following structure:
indexObj = {id1: reference to element with id1, id2: reference to element with id2}

to access a certain element I just need to access indexObj[id], is it right solution for my case?

All this should be performed on the client side.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T03:38:29+00:00Added an answer on June 14, 2026 at 3:38 am

    It’s a very broad question.

    I’d say the primary recommendation would be to really deeply understand what you’re working with. Arrays in JavaScript aren’t really arrays at all, they’re objects with all the normal plumbing of JavaScript normal objects. Array indexes aren’t numbers, aren’t offsets into some memory table*; they’re string keys in a dictionary-like map. Once you embrace the fact that arrays are just objects, it may open up new ways of structuring or accessing your data such that you can avoid expensive operations like indexOf.

    (* Barring JavaScript engine optimizations, of course. And engines do optimize.)


    Update: Looking at your edit, yes, transforming the data so that you can look up tracks by using their id as a property name (indexObj[id]) is what I’d recommend. Then, instead of the expensive linear search required by indexOf, you get the benefit of the JavaScript engine’s handling of property names, which will typically be a much more efficient lookup (b-trees and/or hash structures, etc.).

    Once you’ve created your indexed version, if you can release the array version, the memory consumed by the array and its property names ("0", "1", etc.) can be eligible for reclamation, which may be useful (your individual tracks will remain in memory because you’re referencing them from the indexed structure).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on a browser-game and I can't help but wonder about what's the
I wonder about that can I write native SQL to add or delete operations
I'm a newbie programmer working with jQuery and wonder if anyone can help me
I'm working on string and I wonder which way is best to check if
I wonder if anyone can help. I am working on a Spring Webflow 2
My program is working with fax documents stored as separate bitmaps I wonder if
wonder whether someone can help me with the following one... I have a struct
I'm working on a tiny web library and wonder wheter I should call the
i wonder what i'm doing wrong? I'm working on a ftp-upload with php. if
I am currently working on CGH array results, which involve several plots of dozens

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.