简体   繁体   English

动态生成的网页应该创建多快?

[英]How fast should a dynamically generated web page be created?

I have a number data-driven web based applications that serve both internal and public users and would like to gauge how fast you would expect a page to be created (in milliseconds) in order to maintain user satisfaction and scalability. 我有一些数据驱动的基于Web的应用程序,它们为内部和公共用户提供服务,并且希望衡量您希望创建页面的速度(以毫秒为单位),以保持用户满意度和可伸缩性。

So, how fast does a page have be created to maintain a fast site? 那么,创建页面以保持快速站点的速度有多快?

The sites are developed in ASP classic, with a SQL Server backend generating XML recordsets that I render using XSLT. 这些站点是用ASP经典开发的,SQL Server后端生成我使用XSLT渲染的XML记录集。 Not the most efficient technique and pages take between 7ms to 120ms to create (ie Timer interval between first line of code and the 'Response.Write') depending on the complexity of the page. 不是最有效的技术和页面需要7ms到120ms来创建(即第一行代码和'Response.Write'之间的定时器间隔),具体取决于页面的复杂程度。 Slower pages are due to the database running bigger and more complex queries. 较慢的页面是由于数据库运行更大和更复杂的查询。 Even if I re-wrote all the ASP classic to ASP.NET there will not be any significant improvement to the overall page render speed. 即使我将所有ASP经典重新编写到ASP.NET中,整个页面渲染速度也不会有任何显着的改进。

I've often heard Jeff say he wants SO to be the fastest site , and his blogs have discussed optimisation of his code and database but how far do you have to go in optimising your the code? 我经常听到杰夫说他希望SO成为最快的网站 ,他的博客讨论了他的代码和数据库的优化,但你需要在优化代码方面走多远? Is shaving off milliseconds by using StringBuffer instead of String + String a good use of my time? 通过使用StringBuffer而不是String + String来缩短毫秒时间可以充分利用我的时间吗?

[Clarification] [澄清]

At what point do you start to think "This page is taking too long to create?". 在什么时候你开始认为“这个页面创建时间太长了?”。 Is it over 20ms, over 200ms or is it OK for a page to take over a second to build? 是超过20毫秒,超过200毫秒还是一个页面可以接管一秒钟构建? What are your "target times?" 你的“目标时间是多少?”

This depends entirely on your audience and targets - I've worked on apps with a target 'onload' event at <4secs, and on apps where the time on server is expected to be <1ms. 这完全取决于您的受众和目标 - 我已经在<4secs上的目标'onload'事件的应用程序上工作,并且在服务器上的时间预计<1ms的应用程序上工作。 It can go either way - but whatever you do you need to be aware that whatever performance optimisations you do at the server-side level are likely to be dwarfed by both network performance, still the major bottleneck with the web, and perceptive load times. 它可以采用任何一种方式 - 但无论你做什么,你都需要注意,无论你在服务器端进行的任何性能优化都可能与网络性能,网络的主要瓶颈以及敏感的加载时间相比都相形见绌。

Yahoo has some excellent guidelines for general website performance, especially on the perceptive load area. 雅虎对一般网站的性能有一些很好的指导 ,特别是在敏感的负载区域。

Hopefully you're already smart enough to be caching what you can and doing the little things like avoiding massive chains of Response.Writes... 希望你已经足够聪明,可以缓存你所能做的事情并做一些小事情,比如避免大量的Response.Writes链......

Users doesn't care about how fast you prepare your data, they only care about the actual loading-time of the page. 用户不关心您准备数据的速度,他们只关心页面的实际加载时间。

If you have a lot of overhead in rendering, your users will experience your site to be slow. 如果您在渲染方面有很多开销,那么您的用户将会觉得您的网站速度很慢。 Concerning classic ASP, string concatenation is considered very bad practice since it's gonna be really slow when you hit the critical string-length where it will start to be a burden to the server. 关于经典的ASP,字符串连接被认为是非常糟糕的练习,因为当你遇到关键的字符串长度它会开始成为服务器的负担时,它会非常慢。

Using an array (jscript) or a .NET StringBuffer can improve the rendering-time significantly. 使用数组(jscript)或.NET StringBuffer可以显着改善渲染时间。 Aswell as unloading unecesary CPU-usage, that would allow your server to handle more traffic, I would say those kind of obvious optimization is very worth doing. 除了卸载不必要的CPU使用率,这将允许您的服务器处理更多的流量,我会说这种明显的优化是非常值得做的。

A very interesting screencast on this topic van be found here: link text . 这个主题的一个非常有趣的截屏视频可以在这里找到: 链接文本

Although it is made by a Rails guy, it is perfectly applicable to other frameworks. 虽然它是由Rails人员制作的,但它完全适用于其他框架。

If you can shave off milliseconds by just changing one thing, go for it! 如果你可以通过改变一件事来减少毫秒,那就去吧!

You might want to have a look into caching database requests as well. 您可能还想查看缓存数据库请求。

One factor that affects user satisfaction to server response time is how often he is requesting a new page. 影响用户对服务器响应时间满意度的一个因素是他请求新页面的频率。 If you're presenting (say) a page with lots of information that the user is going to spend some time to read, a longer "rendering" time is okay. 如果您正在呈现(说)一个包含大量信息的页面,用户将花一些时间阅读,那么更长的“渲染”时间就可以了。 In contrast, if the person is quickly navigating through pages, he will want a near instantaneous response. 相反,如果该人正在快速浏览页面,他将需要近乎即时的响应。

For example, if you're on a news site, you probably will be okay if it takes a full second or two for the next page, since you're going to be spending 30 seconds to read it. 例如,如果您在新闻网站上,如果下一页需要一两秒钟,您可能会好起来,因为您将花30秒钟阅读它。

On the other hand, if you're browsing through an interactive map, you probably want the response to be less than a second. 另一方面,如果您正在浏览交互式地图,您可能希望响应时间不到一秒钟。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在MVC3 Web应用程序中的缓存中存储动态生成的视图? - How to store dynamically generated view in cache in MVC3 web application? 如何最好地搜索基于ID的特定元素动态生成的自定义列表? - How should I best search through a custom list generated dynamically based on id for a specific element? 如何将动态生成的页面存储为asp.net mvc3中的静态页面? - How to store dynamically generated page as static page in asp.net mvc3? 今天的口译语言应该多快? - How fast should an interpreted language be today? 如何在html中存储动态生成的页面? - how to store dynamically generated pages in html? 如何在动态创建的文本框中获取Click Listener - How to get Click Listener on dynamically created textboxes 慢速实体框架查询,但快速生成SQL - slow entity framework query , but fast Generated SQL Googe Places API应该以多快的速度以8.62 Mbps的下载速度返回结果? - How fast should the Googe Places API return results on 8.62 Mbps download speed? 移动Web应用程序的快速按钮 - Fast Buttons for Mobile Web Applications 模板化的类应该和非模板化的类一样快吗? - Should templated classes be precisely as fast as untemplated classes?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM