May 2, 2020 09:47 pm GMT
Original Link: https://dev.to/calin92540842/which-is-more-memory-efficient-in-javascript-big-arrays-or-big-strings-with-a-comma-separator-5e67
Which is more memory efficient in JavaScript: big arrays, or big strings with a comma separator?
I am working with big arrays, bug I want to know if I can compress it's content to be more memory effectiant, I am using:
mybigarray.includes(x)
and was wondering if it woild be more efficient to just do
mybigstring.includes(String(x))
would be slightly more effecient.
Q: Are Strings more memory effecient than Arrays? => if not, is there any way to compress an Array to save memory?
Thanks!
Cheers!
Cheers!
Original Link: https://dev.to/calin92540842/which-is-more-memory-efficient-in-javascript-big-arrays-or-big-strings-with-a-comma-separator-5e67
Share this article:
Tweet
View Full Article
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To