All Questions
Tagged with memory-optimization javascript
12 questions
4
votes
2
answers
63
views
Optimizing a Function to Generate a Row of Consecutive Odd Numbers in a Triangle
I've written a JavaScript function that generates a row of consecutive odd numbers in a triangle. The triangle looks like this:
...
1
vote
2
answers
147
views
"Frequency Counter Pattern", Can we get other better algorithm having like, O(n) or O(n log n)
Problem Statement :
Write a function called matchSquare, which accept two arrays (arr1, arr2)
Criteria:
The function should return true, if every value in the arr1, has its corresponding values ...
2
votes
1
answer
93
views
iterating a big list of objects throws a memory issue
I'm writing a function which iterate through a list of objects and should return:
true if all the items have the attributes (cp and type).
false if all the items haven't the attributes (cp and type).
...
1
vote
2
answers
117
views
which for loop has better performance in javascript? [closed]
I can't find out which loop is better performance than another, if you know help me.
I try about loops in js and performance in this site
and this is code snippet, you can run and check.
...
3
votes
1
answer
1k
views
json2CSV fails because of lack of RAM memory
I run this code on my Heroku Node.js server in order to get CSV for few hundred rows, but it fails with R14 - Memory Quota Exceeded.
It worked fine when there were ...
1
vote
2
answers
72
views
Check whether an array can be the result of merging two smaller arrays, maintaining order
I'm prepping for a tech interview coming up and trying to have a better understanding of what I should look out for in writing code. Also, feel free to correct the terminology that I use as I want to ...
7
votes
1
answer
44k
views
Count duplicates in a JavaScript array
This is actually a hackerrank interview question I have already solved but I need guidance on how to optimize it for the
Time
Space
Given an array of integers, your task is to count the number of ...
8
votes
1
answer
3k
views
Make To and From date range picker using jQuery UI
I implemented date range picker logic using the jQUery UI datepicker component:
...
1
vote
1
answer
143
views
Displaying weather data from an Arduino
Please review my code, for performance and readability.
3 issues I am facing are
Uncaught Exception : out of memory (in firefox)
randomly Failed to load resource: The request timed out.
Even if the ...
3
votes
1
answer
233
views
Tic Tac Toe with Minimax (memory management optimization)
I've made a Tic Tac Toe game with minimax in Javascript. It works but I have to use location.reload(true); to automatically reload the page every time user starts a ...
4
votes
2
answers
1k
views
Object-oriented JavaScript and Google Maps objects memory management
I have to draw various instances of HeatMaps, Winds and Polylines. Each layer will have one <...
6
votes
2
answers
1k
views
Two-dimensional array, modified one field at a time
Title says it all. I'm basically initializing a two-dimensional array and changing the fields one at a time.
It might be a good idea to do this OO.
A Grid class ...