diff --git a/website/docs/performance.mdx b/website/docs/performance.mdx index 863e860b..8829544b 100644 --- a/website/docs/performance.mdx +++ b/website/docs/performance.mdx @@ -52,7 +52,7 @@ title: Immer performance -Here is a [simple benchmark](https://github.com/immerjs/immer/blob/main/__performance_tests__/todo.js) on the performance of Immer. This test takes 50,000 todo items and updates 5,000 of them. _Freeze_ indicates that the state tree has been frozen after producing it. This is a _development_ best practice, as it prevents developers from accidentally modifying the state tree. +Here is a [simple benchmark](https://github.com/immerjs/immer/blob/main/__performance_tests__/todo.mjs) on the performance of Immer. This test takes 50,000 todo items and updates 5,000 of them. _Freeze_ indicates that the state tree has been frozen after producing it. This is a _development_ best practice, as it prevents developers from accidentally modifying the state tree. Something that isn't reflected in the numbers above, but in reality, Immer is sometimes significantly _faster_ than a hand written reducer. The reason for that is that Immer will detect "no-op" state changes, and return the original state if nothing actually changed, which can avoid a lot of re-renderings for example. Cases are known where simply applying immer solved critical performance issues. diff --git a/website/i18n/zh-CN/docusaurus-plugin-content-docs/current/performance.mdx b/website/i18n/zh-CN/docusaurus-plugin-content-docs/current/performance.mdx index 0a2685b0..3e21436c 100644 --- a/website/i18n/zh-CN/docusaurus-plugin-content-docs/current/performance.mdx +++ b/website/i18n/zh-CN/docusaurus-plugin-content-docs/current/performance.mdx @@ -51,7 +51,7 @@ title: Immer 性能 -这是一个关于 Immer 性能的 [简单 benchmark](https://github.com/immerjs/immer/blob/main/__performance_tests__/todo.js) 。该测试需要 50,000 个待办事项并更新其中的 5,000 个。 _Freeze_ 表示状态树在生成后已被冻结。这是一种开发最佳实践,因为它可以防止开发人员意外修改状态树。 +这是一个关于 Immer 性能的 [简单 benchmark](https://github.com/immerjs/immer/blob/main/__performance_tests__/todo.mjs) 。该测试需要 50,000 个待办事项并更新其中的 5,000 个。 _Freeze_ 表示状态树在生成后已被冻结。这是一种开发最佳实践,因为它可以防止开发人员意外修改状态树。 上面的数字没有反映一些东西,但实际上,Immer 有时比手写的 reducer _快_ 得多。这样做的原因是,Immer 会检测“无操作”状态变化,如果实际上没有任何变化,则返回原始状态,这可以避免很多重新渲染。众所周知,只需应用 immer 即可解决关键性能问题。