Urgent.News

What's breaking now, across thousands of outlets.

Tech

A New JsonSerializerOptions Every Call Cost Me 120x

A list endpoint on one of my services started showing up heavier in the traces than it had any right to be. It pulled a small object, serialized it, returned it. The payload was tiny — an order with three line items. But under load the thing allocated like it was streaming a video, and the CPU time didn't match the shape of the work. I went looking for the expensive query. There wasn't one. The…

A programmer noticed a significant slowdown in a list endpoint on their service, which they traced back to a new JsonSerializerOptions being created on every call. The JsonSerializerOptions object was thought to be a simple settings bag, but it turns out it builds metadata for serialization when first used and then caches it. Creating a new options object for each serialization call resulted in the serializer rebuilding its entire type model, leading to 120 times slower performance and 42 times more memory allocation compared to reusing a single cached instance.

To optimize the code, the programmer moved the JsonSerializerOptions creation outside the method, building it once and reusing it for all serialization calls.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

How to Hide the Taskbar on Windows 11

Learning how to hide the taskbar on Windows 11 is useful when you want more screen space, enjoy a cleaner desktop, or concentrate on your work without distractions.

  • Open Windows 11 Settings by clicking Start or pressing Windows key + I
  • Navigate to Taskbar configuration in Personalization menu
  • Enable automatic hiding of taskbar via checkbox in behaviors section

How we test promo codes with a checkout bot that is not allowed to pay

Most coupon pages never tell you whether anyone tried the code. On Kuponaut, a small site that lists discount codes and prices for AI and SaaS tools, every code carries a label that says how we know…

  • Kuponaut bot tests promo codes without paying, documenting results with dates
  • Bot programmed to never enter payment info, CAPTCHAs, or auto-complete steps
  • Initial failures due to bot's prior account session, now flagged for manual review

Shipping 6,300+ 35A Smart Breakers: PCB, Firmware and Cloud Lessons

A smart breaker looks simple from the outside. It switches mains power, measures how much energy passed through it, shows a number on a small display, and sends that number to a cloud dashboard.

  • Over 6,300 units of 35A Smart Breakers shipped
  • PCB design separates high-energy and radio functions
  • Firmware incorporates calibration, reporting cadence, offline handling, and OTA updates

Building Google Ads Landing Pages in Next.js for Local Service Businesses

Paid search for plumbers, HVAC shops, dentists, and similar trades has a simple failure mode: the ad promises a job, and the page the click opens is the homepage.

  • Dedicated landing pages improve conversion rates for local service ads
  • Next.js App Router enables slim, mobile-friendly landing page layouts
  • Match ad keywords to H1 for high quality scores and strong conversions

More from Saturday 7 November →