Urgent.News

What's breaking now, across hundreds of outlets.

Tech

Does Deleting Object Keys Still Kill Performance? I Tested It

I tested the old advice that deleting object keys wrecks lookup speed, on Node 22, with 100,000 entries A plain object stayed faster than a Map before, during and after five delete-and-rebuild cycles Map lookups ran 30 to 50 percent slower than object lookups across all three test phases The dictionary-mode slowdown the old advice warns about never showed up in any test phase Years of JavaScript…

A recent test comparing plain objects and Maps for key deletion performance on Node 22 revealed that the old advice against deleting keys from objects has no basis in current JavaScript engine behavior. The test involved a 100,000 entry plain object and a Map, with 200,000 random lookups performed each of the three phases. Phase one showed the plain object performing faster than the Map.

Phase two, after deleting half the keys, saw both structures get slightly faster, with the object maintaining its lead. The crucial phase three, which tested the "dictionary-mode" slowdown claim by deleting the same keys five times and adding them back, demonstrated that the object actually became faster during this churn, while the Map slowed to 15.8 milliseconds from 16.2 milliseconds.

The results contradicted the well-established advice, showing that the slowdown only appeared in the old recommendation, not in actual engine behavior.

Rewritten by urgent.news; may contain errors — check the original.

Source: dev.to

Read the original at dev.to →

Report a problem with this story

More in Tech

Artalk site isolation and admin credentials define a comment control plane

Artalk site isolation and admin credentials define a comment control plane Artalk is a self-hosted comment system with social login, site isolation, moderation, an administrator dashboard, and an HTTP…

  • Artalk is a self-hosted commenting system with social login and moderation features
  • Each installation hosts comments for multiple sites via site key
  • Administrators must secure appkey with strong, unique credentials

Zero-downtime credential rotation in OpenTofu: the two-phase pattern (and the two bugs it taught me)

Rotating a long-lived credential sounds trivial: create a new one, hand it out, delete the old one. In practice "hand it out" is never instant.

  • Implement two-phase pattern for zero-downtime credential rotation in OpenTofu
  • Phase 1 and Phase 2 slots alternate with overlap window (W) of credential lifespan (E)
  • Three resources manage timeline: locals, cycletimer, and deterministictime

Turning a Chinese open-ended contract rule into code: four boundary cases

I spent a day turning a Chinese employment rule into code, and the rule that looked simple turned out to be four boundary conditions wearing a trench coat.

  • Four boundary conditions identified in translating Chinese employment rule into code
  • "Full ten years" term in contract counting is inclusive of zero days
  • 11-month extension does not count as second contract for open-ended clause

Java4Shell: 64 A's, one equals sign and an hour with Codex

Originally published at heygalatea.com , with every source linked. I'm Galatéa, an AI persona who reads advisories so you can spend your weekend patching instead.

  • Critical Java4Shell vulnerability discovered on November 17
  • Unauthenticated remote attackers can execute arbitrary code via 64 "A"s and an equals sign
  • AI-powered agent Codex identified vulnerability within an hour

Build a 3D Character from Spheres, Then Turn It into Numbers (Python, No GPU)

"A beginner-friendly intro to how 3D AI sees shapes: voxel grids, in about 40 lines of Python in Google Colab." FROM ZERO TO FIRST Training a 3D Generator Without a PhD 3D generative AI looks like it…

  • Character built from five spheres with coordinates, radius, color
  • NumPy, Matplotlib used for 3D visualization and interactive modification
  • Voxel grid conversion reveals relationship between visual and numerical representation

More from Sunday 22 November →