Email me

Crates / Compare / once_cell vs lazy_static

Rust crates side by side · data Oct 24, 2026

once_cell vs lazy_static

Short answerBoth are now in std: OnceLock since Rust 1.70 and LazyLock since 1.80. Prefer std, then once_cell. By steady daily use, once_cell is bigger: 3,785,180 real downloads a day against 2,449,997 for lazy_static (1.5x). 8,656 crates depend on once_cell and 10,953 on lazy_static. once_cell last shipped 7 months ago, lazy_static 23 days ago.

once_cell

Widely used

Widely used and steady.

8,656 crates depend on it; no release in the last 90 days, so its count is all steady use.

Single assignment cells and lazy values.

lazy_static

Foundational

Foundational and steady.

10,953 crates depend on it; downloads jump on release days (1.3x the baseline).

A macro for declaring lazily evaluated statics in Rust.

50%100%150%Aug 1Sep 1Oct 1

once_celllazy_static · 100% = that crate's normal quiet day, so a spike to 300% is triple its usual traffic

Every number, side by side

Same window, same methodonce_celllazy_static
Real downloads a day3,785,1802,449,997
Crates that depend on it8,65610,953
Last release1.21.4, 7 months ago1.5.1, 23 days ago
Trend vs the field-1%+4%
Release-window share0.0%2.8%
Downloads in the window336,233,853226,380,088
All-time downloads1,416,715,6771,095,056,506
Versions published6739
LicenseMIT OR Apache-2.0MIT OR Apache-2.0
MSRV1.65not set
First publishedAug 2, 2018Nov 23, 2014

Which to pick

  • Pick once_cell if you are on a Rust older than 1.80 and need lazy statics today.
  • Pick lazy_static if only in existing code; for new code use the standard library.
  • Bottom line: Both are now in std: OnceLock since Rust 1.70 and LazyLock since 1.80. Prefer std, then once_cell. (checked against each project's docs, Oct 24, 2026)
  • Downloads tell you what is common, not what fits. Each crate's own description above says what it is for; when the jobs differ, pick by the job.
  • When both fit, prefer the one more crates depend on (lazy_static, 10,953 dependents): more eyes, more answered questions, and you may already have it in your tree.
  • Check the release dates against your own pace: once_cell 7 months ago, lazy_static 23 days ago.

Also in this space

Method

Real downloads = the median day with no release that day or the day before, from the crates.io API (Jul 27, 2026 to Oct 23, 2026). Raw crates.io counts include CI and bots and run high (why); the method is from our 90-day study. People search for this pair: Google suggests "once_cell vs lazy_static".

Get the receipts by email.

What my AI agents tried this week, with the real numbers: what worked, what flopped, what made money. One email when there is something worth reading.

No spam, never sold. Every email has a one-click unsubscribe.

Up next

Another comparison: Same method, same window. Foundational and steady vs widely used and steady.reqwest vs hyperRead it next →

Also worth your time

Did this answer your question?

Popular in the shop

All 124 tools →

Browse: Bundles and kitsHome, family and schoolMoney and businessAI toolsSports and fitnessMaking and hobbiesFood and drinkIndie dev and launchTrading and quant

Free: Landing page teardown iPhone app cost calculator LLM API cost calculator Paid online: $49 Launch Check App builds Articles FAQ