Skip to content

feat: improve store.get performance when atoms are not mutated#3265

Merged
dai-shi merged 11 commits intopmndrs:mainfrom
dmaskasky:dmaskasky/store-internals-performance
Mar 24, 2026
Merged

feat: improve store.get performance when atoms are not mutated#3265
dai-shi merged 11 commits intopmndrs:mainfrom
dmaskasky:dmaskasky/store-internals-performance

Conversation

@dmaskasky
Copy link
Copy Markdown
Collaborator

@dmaskasky dmaskasky commented Mar 11, 2026

Related Bug Reports or Discussions

edkimmel#3

#3259

fix #2334

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 11, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
jotai Ready Ready Preview, Comment Mar 24, 2026 2:25am

Request Review

@codesandbox-ci
Copy link
Copy Markdown

codesandbox-ci bot commented Mar 11, 2026

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

@edkimmel
Copy link
Copy Markdown

edkimmel commented Mar 14, 2026

@dmaskasky @dai-shi
Here are the benchmark and tests I have to show this problem as well. The problem is more accurately in readAtomState's recursive traversal.

edkimmel@63baf73

And here is a commit that passes those tests
edkimmel@2c052d5

I am realizing now that in the new world of building blocks, any one of these functions could be replaced. The solution linked may not be desired because it puts new data requirements on any library taking over those building blocks.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 20, 2026

LiveCodes Preview in LiveCodes

Latest commit: ca572a3
Last updated: Mar 24, 2026 2:25am (UTC)

Playground Link
React demo https://livecodes.io?x=id/GYXZFXN2E

See documentations for usage instructions.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Mar 20, 2026

More templates

npm i https://pkg.pr.new/jotai@3265

commit: ca572a3

@dai-shi
Copy link
Copy Markdown
Member

dai-shi commented Mar 20, 2026

/ecosystem-ci run

@github-actions
Copy link
Copy Markdown

Ecosystem CI Output

---- Jotai Ecosystem CI Results ----
{
  "bunshi": "PASS",
  "jotai-devtools": "FAIL",
  "jotai-effect": "PASS",
  "jotai-family": "PASS",
  "jotai-scope": "PASS",
  "waku-jotai": "PASS"
}

https://github.com/pmndrs/jotai/actions/runs/23346637623

@dai-shi
Copy link
Copy Markdown
Member

dai-shi commented Mar 20, 2026

/ecosystem-ci run

@github-actions
Copy link
Copy Markdown

Ecosystem CI Output

---- Jotai Ecosystem CI Results ----
{
  "bunshi": "PASS",
  "jotai-devtools": "FAIL",
  "jotai-effect": "PASS",
  "jotai-family": "PASS",
  "jotai-scope": "PASS",
  "waku-jotai": "PASS"
}

https://github.com/pmndrs/jotai/actions/runs/23348135076

@dai-shi
Copy link
Copy Markdown
Member

dai-shi commented Mar 20, 2026

@arjunvegda Could you please check how jotai-devtools is failing?

@dai-shi dai-shi added this to the v2.19.0 milestone Mar 20, 2026
@arjunvegda
Copy link
Copy Markdown
Collaborator

/ecosystem-ci run

@github-actions
Copy link
Copy Markdown

Ecosystem CI Output

---- Jotai Ecosystem CI Results ----
{
  "bunshi": "PASS",
  "jotai-devtools": "PASS",
  "jotai-effect": "PASS",
  "jotai-family": "PASS",
  "jotai-scope": "PASS",
  "waku-jotai": "PASS"
}

https://github.com/pmndrs/jotai/actions/runs/23455636067

@dai-shi
Copy link
Copy Markdown
Member

dai-shi commented Mar 24, 2026

Thanks!!

@dai-shi dai-shi changed the title add performance test to evaluate store.get performance fix: store.get performance when atoms are not mutated Mar 24, 2026
@dai-shi dai-shi changed the title fix: store.get performance when atoms are not mutated feat: store.get performance when atoms are not mutated Mar 24, 2026
@dai-shi dai-shi changed the title feat: store.get performance when atoms are not mutated feat: improve store.get performance when atoms are not mutated Mar 24, 2026
@dai-shi dai-shi merged commit ef85ceb into pmndrs:main Mar 24, 2026
47 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants