Skip to content

2.0.0-rc7 | possible regression from rc0 with many stores single write and a flush #3360

Description

@mizulu

Describe the bug

RC.0
https://mizulu.users.s.olid.uk/solid2-store-write-benchmark/r/2/

Image

RC.7
https://mizulu.users.s.olid.uk/solid2-store-write-benchmark/r/1/

Image

Your Example Website or App

.

Steps to Reproduce the Bug or Issue

.

Expected behavior

.

Screenshots or Videos

No response

Platform

  • OS: [e.g. macOS, Windows, Linux]
  • Browser: [e.g. Chrome, Safari, Firefox]
  • Version: [e.g. 91.1]

Additional context

import {
  createStore,
  flush
} from "solid-js"

const STORE_COUNT = 100000
const WRITES_PER_STORE = 1

const stores = Array.from(
  { length: STORE_COUNT },
  () =>
    createStore({
      value: 0
    })
)

const start =
  performance.now()

for (
  let write = 0;
  write < WRITES_PER_STORE;
  write++
) {
  for (
    let i = 0;
    i < STORE_COUNT;
    i++
  ) {
    const [, setStore] =
      stores[i]

    setStore(store => {
      store.value =
        write + 1
    })
  }
}

flush()

console.log(
  {
    stores:
      STORE_COUNT,

    writesPerStore:
      WRITES_PER_STORE,

    totalWrites:
      STORE_COUNT *
      WRITES_PER_STORE,

    ms:
      (
        performance.now() -
        start
      ).toFixed(3)
  }
)

I am not sure how much of this benchmark is related to the fixes #3044
or the benchmarks from that issue, because I don't see this numbers in the reproductions in the 3044

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions