Mozilla Firefox 中的本地存储读/写性能
我正在测试不同的浏览器如何从本地存储读取/写入大量数据。示例数据是 1500 条客户记录,其中包含每个人的一些数据集(名字、姓氏、位置、类型的一些 ID 等)。测试应用程序是基于 GWT paltform 构建的。
我注意到,在从本地存储(而不是从 Web 服务器)加载数据后,IE8、IE9、Chrome 的性能提高了至少 30%。只有 Firefox (5.0) 的结果更差(大约慢了 30%)。远程网络服务器用于将某种现实带入实验中。 对于小数据块(100-200 条记录),浏览器之间的差异几乎不可见,并且生成的时间也几乎相同。但大量的数据揭示了这个问题。
我发现 mozilla 支持网站上提到了这个问题 - https://support.mozilla.com/ en-US/questions/750266 但仍然没有解决方案或解决方法来解决它。
Javascript 分析显示,对 GWT StorageImpl.java 类中实现的函数的调用
function $key(storage, index){
return index >= 0 && index < $wnd[storage].length ?
$wnd[storage].key(index) : null;
}
在执行期间占用了大部分时间。这实际上是 GWT 中的 storage.getItem(key) 调用。
为了避免这种频繁的调用,我宁愿选择一次调用来将存储内容转换为地图,例如,它可能会帮助我节省花在 Firefox 缓存 I/O 操作(如果有的话)上的时间。但是存储接口( http://dev.w3.org/html5/webstorage/#storage -0 )仅包含 getItem() 函数来从存储接收任何内容。
关于如何强制 Firefox 运行更快有什么想法吗?
PS 也许对某人有用:我使用插件 SQLite 管理器找到了 FF 本地存储内容,并从默认内置数据库的下拉列表中加载 webappstore.sqlite 数据库。
I am testing different browsers on how do they read/write large amounts of data to/from local storage. Sample data is 1500 customer records with some set of data for everyone (first name, last name, some ids for their location, type, etc). Test application is built on GWT paltform.
And what I noticed is that IE8, IE9, Chrome improved their performance in at least 30% after moving to loading data from local storage (rather than from web server). And only Firefox (5.0) is the one who worsened the results (around 30% slower). Remote web-server was used to bring some sort of reality into experiment.
The difference between browsers is almost invisible on small data chunks (100-200 records) and the resulting time is also about to be the same. But large amounts reveal the problem.
I found mentioning of this issue on mozilla support site - https://support.mozilla.com/en-US/questions/750266
But still no solution or workaround there how to fix it.
Javascript profiling shows that calls to function implemented in GWT StorageImpl.java class
function $key(storage, index){
return index >= 0 && index < $wnd[storage].length ?
$wnd[storage].key(index) : null;
}
take the lion's share of time during execution. Which is actually storage.getItem(key) call in GWT.
To avoid this frequent calls I would rather prefer a single call to translate storage contents to the map, for example, and it might help me to save time spent on Firefox's cache I/O operations (if any). But Storage interface ( http://dev.w3.org/html5/webstorage/#storage-0 ) contains only getItem() function to receive any contents from the storage.
Any thoughts about how to force Firefox work faster?
P.S. Maybe will be useful for someone: I found FF local storage contents using addon SQLite manager, and loading webappstore.sqlite database from the drop-down list of default built-in databases.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您正在测试哪个版本的 Firefox?您在 support.mozilla.org 上的帖子提到了 Firefox 3.6.8,并且提到了 IE,因此可能是在 Windows 上,在这种情况下,您可能会点击 https://bugzilla.mozilla.org/show_bug.cgi?id=536544 已修复Firefox 4。或者您在最近的 Firefox 中看到了这个问题吗?
Which version of Firefox are you testing? Your post on support.mozilla.org mentions Firefox 3.6.8, and you mention IE, so are presumably on Windows, in which case you're probably hitting https://bugzilla.mozilla.org/show_bug.cgi?id=536544 which was fixed in Firefox 4. Or are you seeing the problem in a recent Firefox?