测量 python cgi 脚本的加载时间?

发布于 2024-07-10 18:05:07 字数 307 浏览 4 评论 0原文

我将 python cgi 用于我们的 Intranet 应用程序。

当我测量时间时,脚本需要 4 秒才能完成。 但之后,浏览器中显示屏幕还需要 11 秒。 该屏幕是用表格构建的(大小:10 KB,未压缩的 91 KB),并且有一个大的 css 文件(5 KB,未压缩的 58 KB)。

我使用 YSlow 并按照建议进行了尽可能多的优化。 Gzip 压缩等 Firebug Net 说:文件需要 11 秒。

如何衡量最后 11 秒的用途? 仅仅是 HTML 的大小,还是表结构? 还有更多调整的想法吗?

I use python cgi for our intranet application.

When I measure time, the script takes 4s to finish. But after that, it still takes another 11s to show the screen in the browser.
The screen is build with tables (size: 10 KB, 91 KB uncompressed) and has a large css file (5 KB, 58 KB uncompressed).

I used YSlow and did as much optimization as suggested. Gzipping etc.
Firebug Net says: 11s for the file.

How do I measure where these last 11 seconds are needed for?
Is it just the size of the HTML, or the table structure?
Anyone more ideas for tweaking?

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

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

发布评论

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

评论(2

陌路终见情 2024-07-17 18:05:08

如果我担心服务器是否没有在可接受的时间内完成其工作,我想我会获取 Ethereal 的副本并观察浏览器和脚本之间的 TCP 连接。 如果您看到 TCP 套接字在 11 秒间隙之前关闭,您就知道问题完全出在浏览器端。 如果 TCP 关闭正好在 11 秒间隙内,那么您将必须在 http 服务器端进行一些调试。

我认为 Ethereal 已将其名称更改为 WireShark。 无论它最近如何称呼自己,它都是此类工作的必备工具。 前几天我正在使用它来找出为什么我无法连接到我的虚拟化 http 服务器。

I think I'd grab a copy of Ethereal and watch the TCP connection between the browser and the script, if I were concerned about whether the server is not getting its job done in an acceptable amount of time. If you see the TCP socket close before that 11s gap, you know that your issue is entirely on the browser side. If the TCP close comes well into the 11s gap, then you're going to have to do some debugging on the http server side.

I think that Ethereal has changed it's name to WireShark. Whatever it is calling itself recently, it's a must-have tool for this sort of work. I was using it just the other day to find out why I couldn't connect to my virtualized http server.

慢慢从新开始 2024-07-17 18:05:08

有了这么多的 html 渲染,我还会考虑计算机的速度。 您可以通过保存 html 文件并从本地硬盘打开它来测试这一点:)

with that much html to render I would also consider the speed of the computer. you can test this by saving the html file and opening it from your local hard drive :)

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