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 7856875
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T20:50:44+00:00 2026-06-02T20:50:44+00:00

I am new to Node would appreciate some advice on writing to an array.

  • 0

I am new to Node would appreciate some advice on writing to an array. I have high frequency real-time data coming in, and each tick will be written to a single array.

Would it be beneficial to do this in an asynchronous way? If so, how can this be done?

Here is a trimmed down snippet of my code. The “filter” function is called when a new tick is received. The “storeWindowData” function then saves to the array. I presume this could be blocking under high load?

Appreciate any comments.

Regards, Ben.

var window_data = [];
module.exports = {

filter: function (data) {

    this.storeWindowData(timestamp, ticker, content);

    }
},

storeWindowData: function(timestamp, ticker, content){
    // Check if we have seen this ticker before for this minute
    if(window_data[timestamp] !== undefined && window_data[timestamp][0] !== undefined && window_data[timestamp][0] === ticker){
        window_data[timestamp][1] =  window_data[timestamp][1] + ',' + content;
    } else {
        window_data[timestamp] = [ticker, content];
    }
}     

};

  • 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-02T20:50:46+00:00Added an answer on June 2, 2026 at 8:50 pm

    An array is an in memory primitive (well, built in type, not particularly primitive).

    How exactly could you, at a JavaScript level, async write to it?

    Where would it be stored temporarily while waiting to be written? A second array? (See the problem? Writing to that array would cause two array writes, which would be twice as slow.)

    You’re going to have to identify a different bottleneck, or if this really is the problem (which I’m very, very sure that it’s not), you have either too weak of a machine handling this, or you have an insanely high amount of data coming in.

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

Sidebar

Related Questions

I want to create new node of BeanTreeView, and when I add some node
I want to replace a existing Dom node with a new node I have
So I'm new to OAuth and Node.JS, but I have to create a Flickr
We have a HPC node that runs some of our tasks in it. I
I have some XML where I would like to remove identical consecutive child nodes,
I'm exploring Nokogiri and have come across a perplexing issues I would appreciate someones
When I tried to add a new node to current replica set, the current
I parse an xml file containing books, for each new node I go: Book
I'm pretty new to Node.js/Express, but I think I'm slowly getting the hang of
I'm fairly new to node.js and I've found its quite complicated separating a project

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.