简化、批处理和缓存。我们如何优化服务器端的店面渲染

On December 16, 2020 we held Shipit! presents: Performance Tips from the Storefront Renderer Team. A video for the event is now available for you to learn more about how the team optimized this Ruby application for the particular use case of serving storefront traffic. Click here to watch the video.

2020年12月16日,我们举行了Shipit!介绍。Storefront Renderer团队的性能提示。 该活动的视频现在可以让你了解更多关于团队如何为服务店面流量的特殊用例优化这个Ruby应用程序。点击这里观看视频

By Celso Dantas and Maxime Vaillancourt

作者:Celso Dantas和Maxime Vaillancourt

In the previous post about our new storefront rendering engine, we described how we went about the rewrite process and smoothly transitioned to serve storefront requests with the new implementation. As a follow-up and based on readers’ comments and questions, this post dives deeper into the technical details of how we built the new storefront rendering engine to be faster than the previous implementation.

在上一篇关于我们的新店面渲染引擎的文章中,我们描述了我们是如何进行重写过程并顺利过渡到用新的实现来服务店面请求。作为后续行动,并根据读者的评论和问题,这篇文章深入探讨了我们如何建立新的店面渲染引擎,使其比以前的实现更快。

To set the table, let’s see how the new storefront rendering engine performs:

为了说明问题,让我们看看新的店面渲染引擎的表现。

  • It generates a response in less than ~45ms for 75% of storefront requests;
  • 对于75%的店面请求,它能在不到45ms的时间内产生响应。
  • It generates a response in less than ~230ms for 90% of storefront requests;
  • 对于90%的店面请求,它能在不到230毫秒的时间内产生响应。
  • It generates a response in less than ~900ms for 99% of storefront requests.
  • 对于99%的店面请求,它能在不到900毫秒的时间内产生响应。

Thanks to the new storefront rendering engine, the average storefront response is nearly 5x faster than with the previous implementation. Of course, how fast the rendering engine is able to process a request and spit out a response depends on two key factors: the shop’s Liquid theme implementation, and the number of resources needed to process the request. To get a better idea of where the storefront rendering engine spends its time when processing a request, try using the Shopify Theme Inspector: this tool will help you identify potential bottlenecks so you can work on improving performance in those areas.

得益于新的...

开通本站会员,查看完整译文。

首页 - Wiki
Copyright © 2011-2026 iteam. Current version is 2.148.4. UTC+08:00, 2026-01-22 17:15
浙ICP备14020137号-1 $访客地图$