redux 存储的最大内存大小是多少? [英] What's the maximum memory size of the redux store?

查看:183
本文介绍了redux 存储的最大内存大小是多少?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在用 React 编写一个应用程序.我正在使用 Redux 在页面上存储我的数据.此数据包含一个巨大的用户对象(嵌套最多 3 级),其中包含所有用户数据.我在任何地方都在使用它,所以我认为最好将它存储在 redux 中,而不是每次需要时都从服务器请求它.此数据可能约为 70-80 KB,但我认为每个用户的平均大小为 30-40 kb.

I am writing an App in React. I am using Redux to store my data on page. This Data contains a huge user object ( nested max. 3 levels ) which contains all user data. I am using it almast anywhere so I think that it is good to store it in redux and not to request it from server everytime when I need it. This Data can be about 70-80 KB but I think average size of each user will be 30-40 kb.

此数据是通过 5-6 个减速器和 30-50 个动作的组合修改的.我有一个组件使用所有这些数据,还有 10-15 个组件使用其中的一部分.

This data is modified with combined of 5-6 reducers and 30-50 actions. I have one component which uses all of this data and 10-15 components which uses some part of it.

redux store 的大小可以接近 100 kb 吗?

can redux store be almost 100 kb in size?

它会影响应用程序的性能吗?

does it affect the App performance?

任何浏览器都可以在没有任何性能问题的情况下处理我的应用吗?

can any browser handle my app without any performance issues?

您能否提供您的平均 redux 存储大小?

Can you provide your average redux store size?

一个人可以拥有的动作和减速器的平均数量是多少?

What is the average number of actions and reducers one can have?

推荐答案

在 Chrome 中打开更多工具"->任务管理器".

Open "More Tools" -> "Task Manager" in Chrome.

打开 twitter 网络应用程序并在任务管理器中找到选项卡.我的开始是 120MB.

Open the twitter web app and find the tab in Task Manager. Mine started at 120MB.

开始滚动,看看破解 500MB 需要多长时间.

Start scrolling and see how long it takes to crack 500MB.

我知道它与存储在 Redux 中的数据没有直接关系,因为其中大部分是 gif 等,但它是相关的,我认为这表明谈论 100KB 的限制不值得考虑.如果您能找到一款浏览器甚至 10MB 也有问题的设备,我会感到非常惊讶.

I know it's not directly related to data stored in Redux considering most of it is gifs, etc, but it is related I think it demonstrates that talking about limits of 100KB is not worth the thought involved. I'd be very surprised if you could find a device with a browser that had any issues with even 10MB.

这篇关于redux 存储的最大内存大小是多少?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆