Vuex 分析:如何知道内存中的 Vuex 状态或组件大小 [英] Vuex profiling : How to know a vuex state or a component size in memory

查看:96
本文介绍了Vuex 分析:如何知道内存中的 Vuex 状态或组件大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法找到状态(对象、数组等)或组件在内存中占用的大小.

在我当前的上下文中,我需要知道特定状态/组件是否很重(就内存而言).

In my current context, I need that to know if a specific state/component is very heavy (in term of memory).

在 chrome 中,我已经尝试过对内存进行快照,但是在这样的大信息中我找不到如何在结果中识别特定组件或状态:

In chrome, I already tried to snapshot the memory, but I couldn't find how to identify a specific component or state in the result in such large info like this:

推荐答案

对于变量大小,您可以使用这个 js 函数找到它 然后使用控制台日志或使用 google chrome 开发者工具

For variables size you can find it using this js function and then use console logs or using google chrome developer tools

对于组件大小,请检查 Linus 响应.

For component size check Linus response.

这篇关于Vuex 分析:如何知道内存中的 Vuex 状态或组件大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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