Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

224
Views
LokiJS - fastest way to update large number of records?

I have a large in-memory dataset on the client side, and need to quickly update records in a wide dataset (at most, about 50k records at a time). Right now, I have a loop that looks like this.

// looping over new data entry, then either updating or adding if the id isn't already present
data.forEach((d) => {
const current = collection.by('id', d.id);
  if (current) {
  Object.assign(current, d);
    collection.update(current);
  } else collection.insert(d);
});

This loop takes about 10 seconds on a fast pc for 50k records, which is about 20x as long as I can afford for it take in the larger app context. Any thoughts would be greatly appreciated.

Thank you!

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!