DEV Community

A single malloc took 7 milliseconds. So I deleted the slow path. (opens in new tab)

Discussed on DEV

Every allocator benchmark leads with the median. malloc does 15M ops/sec, the typical call is 15 ns, ship it. The median never paged me at 3 a.m. The tail did. Same allocator, same workload, but measuring the worst single call instead of the typical one: Median: ~16 ns Worst case: 6,950,000 ns — almost 7 milliseconds. One malloc, occasionally, taking seven milliseconds. If you're rendering a frame in 16 ms or quoting a price in a market, that call just ate your entire budget — and the average...

Read the original article
Sign in to keep reading the full article.

Keyboard Shortcuts

Navigation

Next / previous post
j/k
Open post
oorEnter
Preview post
v

Post Actions

Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Save / unsave
s

Recommendations

Add interest / feed
Enter
Not interested
x

Go to

Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Discover
gb
Search
/

General

Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help