react-admin icon indicating copy to clipboard operation
react-admin copied to clipboard

Tests heap size increase consequently after v4 migration

Open fugudesign opened this issue 1 year ago • 1 comments

What you were expecting:

Expecting same tests performances after v4 migration.

What happened instead:

After migration to v4, the execution time and heap size in tests where "react-admin" is importing (in test file or component file) increase consequently (± double).

Steps to reproduce:

  • create a simple hook with state management
  • create the test and call it with --logHeapUsage
  • run the test, the heap is less than 100MB
  • simply import something from "react-admin" in the test file or the hook file
  • run the test, the heap is more than 300MB

Environment

  • React-admin version: 4.16.4
  • Last version that did not exhibit the issue (if applicable):
  • React-testing-library: 14.1.2
  • React version: 18.2.0
  • Browser: Chrome
  • Stack trace (in case of a JS error):

fugudesign avatar Jan 15 '24 16:01 fugudesign

Thanks for your report.

We don't know how you test your components so this report isn't enough to investigate. We'll need a repro based on the simple example (https://stackblitz.com/github/marmelab/react-admin/tree/master/examples/simple?file=README.md).

Also, there are many differences between react-admin v3 and v4 (including, and not limited to, different libraries for UI kit, form, state management, etc) that could explain this, so I'm not sure this qualifies as a react-admin issue.

Finally, we haven't had any problem with memory usage in tests with react-admin v4, and we have a lot of them.

So I'm marking this issue as "needs more info", but we probably won't investigate ourselves, unless you can prove that the problem actually comes from react-admin itself.

fzaninotto avatar Jan 15 '24 17:01 fzaninotto

No news for some time, closing.

fzaninotto avatar Mar 12 '24 14:03 fzaninotto