渲染大量 html 数据的 IE 性能

发布于 2024-09-27 13:12:29 字数 350 浏览 0 评论 0原文

我有一些 Perl CGI,它们几乎查询整个表,结果超过 5000 行,并将数据发送到浏览器。生成的 html 数据大小约为 1MB

早些时候我使用表格(这应该是理想的方法)。

不幸的是,大多数用户使用 IE,它在收到结束表标记之前不会显示数据。我们能做点什么吗?

为了在生成后立即推送输出,我使用了另一种方法,其中使用了 printf 和

。这将响应大小减少了 200kb,并且显示速度更快。
IE(不是任何其他浏览器)再次耗尽 CPU 并挂起几秒钟......:-( ..
我们也可以为此做点什么吗?
仅供参考,我正在使用 IE8。

I have a few perl CGIs which almost query the whole table with more than 5000 rows as result and send that data to browsers. The size of html data generated is around 1MB.

Earlier I was using tables(which should be ideal approach).

Unfortunately most users use IE and it does not display data till it receives closing table tag. Can we do something about it.

To push output as soon as its generated, I used another approach where in I was using printf and <pre>. Which reduced the response size by 200kb and and it appears more faster in display.
Again IE (not any other browser) eats up CPU and hangs for couple of seconds... :-( ..
Can we do something about it too.
FYI I am using IE8.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

迷离° 2024-10-04 13:12:29

从用户体验的角度来看,也许使用某种分页方法是明智的。对于最终用户来说,拥有一个包含成千上万行的页面听起来完全不友好。像简单的分页方法(“跳到页面= dropdown =”)肯定会解决您的问题,并减少加载时间并提高可用性。

还有一些预先构建的解决方案,并且可能很容易集成。我几乎立即想到的是 Sencha 的 Paging Grid:

这非常漂亮,您可能会因使用时髦的新技术而获得一些荣誉。还有其他选项:

希望这有帮助!

Perhaps it would be wise from a UX perspective to use some sort of pagination method. Having a single page with thousands upon thousands of rows sounds entirely unfriendly for the end user. Something like a simple means of pagination ("Skip to page =dropdown=") would certainly solve your problem, as well as decrease load times and increase usability.

There are also several solutions which are pre-built and would likely integrate rather easily. One which comes to mind almost immediately is Sencha's Paging Grid:

It's pretty nifty and you'll likely get some kudos for using a hip new technology. There are other options, too:

Hope this helps!

卸妝后依然美 2024-10-04 13:12:29

用ie的人多吗?
http://www.w3schools.com/browsers/browsers_stats.asp

无论如何,你为什么还在用表格吗?
我们都知道它们很容易维护,很容易混淆,而且在你的情况下很慢......

将其输出为 div ,它将显示所有数据,并且不需要等待表标签完成。因为 div 和 span 具有最少的属性。

More people use ie?
http://www.w3schools.com/browsers/browsers_stats.asp

anyways why do you still use tables?
we all know they are easy to maintain, easy to get confused and in your case slow...

output it as div which will show all the data and does not need to wait for a table tag to finish. as div and span have the least properties.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文