《高性能网站建设进阶指南》阅读笔记 3

YOLO11实战 第001期-基于yolo11的CrowdHuman密集行人目标检测实战文档(yolo格式数据免费获取) 1.数据阶段在拥挤/遮挡场景下,使用crowdhuman数据集重训练后的yolo11,效果表现较好。crowdhuman数据集标签如下,有Head BBox、Visible BBox、Full BBox。如下图显示:数据集介绍CrowdHuman数据集是旷世发布的用于行人检测的数据集,图片数据大多来自于google搜索。CrowdHuman数据集数据量比较大,15000张,5000张,验证集4370张。训练集和验证集中共有470K个实例,约每张图片包含23个人,同时存在各种各样的遮挡。 阅读详情

7 超越Gip 压缩

浏览器向web server发送Accept-Encoding HTTP header:

 

Accept-Encoding: gzip, deflate

 

web server 返回压缩后的响应:

 

Content-Encoding: gzip

 

即便如此,仍然有很多浏览器(15%)收到未压缩的响应,why?

 

 

web proxies and PC security software.

被压缩的内容显然不利监控,所以代理或者防火墙软件往往会修改你的request header,比如:
Accept-EncodXng: gzip, deflate

7.1 Design to minimize uncompressed szie

sending smaller responses makes pages faster
典型的技术有javascript的压缩,图片的sprites(多个图标集成在一张图片上)
event delegation
Event delegation is the name commonly given to the technique of attaching a single event handler to a parent element that contains all of the elements that need to respond to the event. When the event is triggered on the child element, it bubbles up to the parent where it is handled. That single handler can distinguish which child element is the target of the event and receive additional parameters via some attribute on that element.
有点像OOP里面extract method的意思,比如一片代码总是重复出现,你可能就需要抽象出一个单独的方法来封装这片重复的代码.
在事件委托中,子元素的事件委托给容器元素,从而避免为每个子元素添加事件handle,增加重复代码。
Use relative URLs
/index.html instead of http://www.example.com/index.html
Table 9-3. Relative equivalents of http://www.example.com/path/page.html
Fully specified destination URL Relative equivalent
http://subdomain.example.com/ //subdomain.example.com
http://www.example.com/path/page2.html page2.html
http://www.example.com/index.html /index.html
http://www.example.com/path2/page.html ../path2/page.html
http://www.example.com/path/page.html#f=bar #f=bar
http://www.example.com/path/page.html?q=foo ?q=foo
Strip whitespace 
YUI Compressor: CSS  http://developer.yahoo.com/yui/compressor/
ShrinkSafe: http://shrinksafe.dojotoolkit.org/
JSMin: http://www.crockford.com/javascript/jsmin.html
Strip attribute quotes
according to the HTML 4.01 specification, it's valid to omit quotes around attributes that matching 
[a-zA-Z0-9/-._:]
letters, numbers, hyphens, periods, underscores, colons
avoid inline styling
Another way in which the uncompressed page size is often unnecessarily inflated is by
repeatedly styling content inline instead of relying on CSS
Do not repeat (DRY)
Alias JavaScript names
For instance, some popular JavaScript libraries alias document.getElementById as the variable $:
   var $ = document.getElementById;
// Wasteful
var foo = $("foo");
foo.style.left = "0";
foo.style.right = "0";
foo.style.height = "10px";
foo.style.width = "10px";
// Better
var foo = $("foo").style;
foo.left = "0";
foo.right = "0";
foo.height = "10px";
foo.width = "10px";

 

 

7.3 Direct Detection of Gzip Support

<iframe src="/test_gzip.html" style="display:none"></iframe>
This will load a test_gzip.html document, which you set up as follows:
1. Disable caching so that the current connection is always tested.
2. Compress the contents, regardless of the request headers.
3. Use JavaScript to set a session-only cookie indicating that the browser supports gzip.
 

 

12 尽早帅新文档的输出

 

 this chapter explains how to start the page loading even before the HTML document is completed.

12.1 Flush the head
Each packet sent incurs some network latency, so it’s usually better to send a small number of large packets, rather than a large number of small packets.
 

 

 

 

 

Whether this speeds up the page depends on what you include in the HTML before the call to flush(). In this example, there is a line of text (“This is the Flush example”) and three resources (two images and one script). This is exactly what’s needed to com- bat the two shortcomings of a slow HTML document: blocked rendering and blocked downloads.

 

 

getting resources downloading early is the primary benefit that flushing provides.

http://cn.php.net/flush

12.2 Output Buffering

PHP output is written to STDOUT. Output buffering adds another layer where output is queued before it goes to STDOUT
php.ini:
output_buffering = 4096
<?php
echo "<br>output_buffering = " . ini_get('output_buffering');
echo "<br>PHP version = " . phpversion();
?>
The most intuitive new function calls are ob_start and ob_flush; ob_start opens a new output buffer while ob_flush flushes the contents of this output buffer to STDOUT. Once the output buffer is flushed, we still need the call to flush() in order to flush STDOUT:
 

12.3 Chunked Encoding

Chunked encoding fosters faster pages in two other ways, both related to dynamic pages. Without chunked encoding, responses must contain a Content-Length header. This means the server can’t start sending the response until it finishes stitching the entire response together and measuring its size. With chunked encoding, the server can start transmitting the response sooner, because it only needs to know the size of each chunk being sent.
Normally, these headers must be sent in the beginning of the response, which means the server can’t start sending the response until these time-consuming database queries or web service calls have completed
The first chunk is sent immediately and uses the Trailer header to list the headers that will come later:
Trailer: Cookie
Trailer: ETag
The Cookie and ETag headers can then be included at the end of the HTML response.*

12.4 flushing and Gzip

Apache 2.x uses mod_deflate for compression.† This module has a buffer that is 8,096 bytes by default. You can reduce the size of this buffer using the DeflateBufferSize directive

12.5  Other Intermediaries

I look for headers such as Proxy-Connection, X-Forwarded-For, and Via or a status containing “HTTP/1.0” in the HTML document response. If any of these are present, you’re probably going through a proxy that may prevent flushing from working.

check list
• Is output buffering on? If so, you have to use the ob_ functions.
• Do you see the Transfer-Encoding: chunked response header? Chunked encoding is typically required for flushing to work.
• Is the response gzipped? If so, and you’re running a version of Apache earlier than 2.2.8, you have to add padding to your page.
• Are you behind a proxy or using antivirus software? These might buffer the chunks before sending them through to the browser.
• Are any of the resources referenced in the flushed chunk being blocked because they’re fetched from the same domain as the HTML document?
• Are you testing only in Safari or Chrome? The flushed HTML must be more than 2 KB to see the benefits in these browsers.


家庭作业:
压缩工具的使用

[xboard-real6410]39 real6410中的BL1和BL2实验及流程分析 文章目录uboot控制uboot 流程uboot加载kernel uboot控制 uboot 流程 uboot加载kernel 阅读详情

相关推荐

【知识点总结】电路原理 第一讲

大家好,从今天起,我将开始更新自上大学以来所学到的各种知识,之所以选择更新它们是因为最近我一直在收拾整理自己自上大学以来所收获到的各种知识,看着那厚厚一沓的书本心里不由得犯愁。如果我想找到特定的知识,那岂不是得翻到猴年马月。俗话说得好,下雨天打鞋子,闲着也是闲着,为此我设置一个专栏,将知识点一一分类总结,目的在于更好的整理所学的知识。本人学艺不精,有一些知识点地方可能存在瑕疵,希望各位大佬可以多多指教。以下是本篇文章正文内容虚断:一般通用性运算放大器的正反向输入端之间的电阻非常非常的大。

weixin_51130221的博客 4万+

《高性能网站建设进阶指南》学习笔记

第1章  理解 Ajax 性能 过早的优化是万恶之源-Donald Knuth 1.1 权衡 时间、质量和成本,三选二。 1.2 优化原则 把重点放在对程序整体开销影响最大的部分。 仔细观察程序的执行时间后,我们会发现其大部分时间都消耗在循环上。 1.3 Ajax 依据 YSlow 规则来重构代码。 1.4 浏览器 运行程序的最大开销往往是 DOM 而非 JavaScript。

符江涛的博客 1506

STM32CubeIDE离线安装芯片PACK包全攻略(附离线包下载与导入步骤)

本文详细介绍了在STM32CubeIDE中离线安装芯片PACK包的完整流程,包括官方和第三方资源获取方法、本地安装步骤及常见问题解决方案。特别针对网络隔离环境下的嵌入式开发需求,提供了实用的版本管理和自动化部署技巧,帮助开发者高效完成芯片固件支持包的离线配置。

weixin_30825581的博客 310

《高性能网站建设指南》之14个性能黄金法则

本文简单的总结了《高性能网站建设指南》这本书中的14条性能黄金法则,描述的十分的简单,如果想要深入了解这些规则的原理,就需要仔细去阅读这本书,本文仅提供了简单的记录和个人理解O(∩_∩)O~。 但是不得不说,这是一本每个从事前端开发工作者都应该必读的工具书,书中说得非常非常的好,页数也不多,可以反复的阅读深入理解,在本文底部也有提供电子版的pdf。 规则一、减少HTTP请求 HTTP是一种客户端/...

Hei, Welcome To vickie's Blog,Good Good Study, Day Day Up ~ 919

控制台模拟前端请求实现快速刷网课时长

本教程仅用于学习前端技术和网页开发,旨在提供教育与技术指导。对于任何未经授权或违反规定的使用行为,本人不承担任何责任。注意到那个serive后面有timestamp时间戳,暗示它很可能就是每30秒汇报一次进度和播放时长的命令,我们右键——复制——复制为fetch。有的网站上的网课需要的不仅仅是进度,而是时长,所以倍速插件失效,但我们可以使用控制台命令来模拟请求实现快速刷网课时长。尝试修改即可,例如我修改time为800,然后复制粘贴到控制台执行。播放视频,等待前端请求出现,然后复制前端请求为fetch。

m0_74823408的博客 2080

基于电子海图的水面无人艇全局路径规划

Research and Implementation of Global Path Planning for Unmanned Surface Vehicle Based on Electronic Chart (基于电子海图的水面无人艇全局路径规划)   该论文已经在ICMIR2017会议上发表,附上springer的文献地址 Research and Implementation of Gl...

weixin_30797199的博客 1594

高性能网站建设

近日读了《高性能网站建设指南》一书。就此发点笔记。 目录:绪言A、绪言B第1章:规则1——减少HTTP请求第2章:规则2——使用内容发布网络第3章:规则3——添加Expires头第4章:规则4——压缩组件第5章:规则5——将样式表放在顶部第6章:规则6——将脚本放在底部第7章:规则7——避免CSS表达式第8章:规则8——使用外部JavaScript和CSS第9章:规则9——减少DNS查...

309

别再只当调包侠了!YOLO检测头到损失函数全链路拆解,看完才算真懂

YOLO的精妙不在于某个单一创新,而在于各模块围绕“实时精准检测”这一目标的协同设计。Backbone追求高效特征压缩,Neck保障多尺度信息流通,Head解耦任务冲突,Loss动态引导优化方向。只有理解这套内在逻辑,才能跳出“调包-试错”的低效循环,在面对新场景、新问题时做出有理有据的改进决策。技术深度决定职业天花板。下次再调YOLO时,不妨先问自己:我改的这个参数,到底影响了系统中的哪一环?参考资料。

专注于Python爬虫开发,分享爬虫技巧、项目实战与反爬经验,使用Scrapy、BeautifulSoup等工具,解决数据抓取难题。 188

高性能网站建设的14个原则

今日大致浏览了一下《High Performance Web Sites》。本书的中文版是《高性能网站建设指南》。本书另有对其中个别问题深入探究的进阶篇《Even Faster Web Sites》,中译《高性能网站建设进阶指南》。 作者介绍上面的豆瓣链接中有,就不再照搬过来了。

我的地盘 879

【推荐100个unity插件】皮毛shader着色器 实现可以用动的毛茸茸毛绒绒效果

Unity内置渲染管线毛发着色器实现 摘要:本文介绍了Unity内置渲染管线下的毛发着色器实现方案。该方案通过多层渲染技术模拟毛发效果,支持基础光照模型(环境光、漫反射和镜面反射),提供毛发长度调节功能。主要包含10个渲染通道,采用逐步增加的FURSTEP参数(0.05-0.55)分层渲染毛发,每层使用相同的着色器代码但不同参数值。该实现仅适用于内置渲染管线,不支持毛发动态效果,代码结构简洁,通过FurHelper.cginc包含核心着色逻辑。

向宇的博客,专注php/web全栈 unity游戏开发,欢迎大家评论纠错 2684

【1】Java 部分笔试题解析

解析A.abstract关键字应该放在class关键字之前。C.抽象方法不能有方法体。D缺少了class关键字。

博客 3953

《高性能网站建设指南》的阅读总结.

引言:去年的时候,公司的平台需要对访问速度等进行优化,大致的方向就是从缓存、压缩、减少请求等方面进行处理,不光需要对网络有一定的理解,也需要对浏览器的机制以及前端的技术等有些许的了解,在这个过程中,阅读了《高性能网站建设指南》,其中就描述了雅虎的工程师们,总结出的“性能黄金法则”:“只有10%~20%的最终用户响应时间花在了下载HTML文档上。其余的80%~90%时间花在了下载页面中的所有组件上”

StarkLi 的博客 1617

使用CloudCompare和CANUPO进行点云分类的编程指南

在本文中,我们将介绍如何使用CloudCompare和CANUPO库进行点云分类的编程。CloudCompare是一款功能强大的开源点云处理软件,而CANUPO是一个用于点云分类和分割的C++库。这只是一个简单的点云分类示例,CANUPO库还提供了其他更高级的功能和算法,以满足各种点云分类需求。该函数接受点云数据、地面点掩码和非地面点掩码作为输入,并将分类结果存储在这两个掩码向量中。完成安装后,我们可以开始编写点云分类的代码。最后,我们遍历点云数据,并根据地面点和非地面点的掩码将结果打印出来。

ByteWhisper的博客 1065

高性能网站建设指南

之前一个机械化工类企业网站项目:发现项目原网站确实卡的不行。 项目结束之后,与之前原网站对比了一下,性能优化的大有可侃之处。 总结归纳了一下高性能建站的经验方法。 结合《高性能网站建设指南》一书[作者:美 · Steve Souders 著 &amp;amp;&amp;amp; 刘彦博 译]专业的剖析,这里博客一撒,分享一下此书与经验。 Web前端开发精髓 网站性能优化 参考点: 规则1:减少HTTP...

草巾冒小子的博客 1192

IEM模型,地表粗糙度模拟

利用微波反演土壤水分时候,利用IEM模型可以实现对随机地表的模拟

全球国家地区城市数据

MySQL全球国家地区城市数据报。。。。。。。。。。。。

《高性能网站建设进阶指南》阅读笔记 1

高性能网站建设进阶指南Performance Best Practices for web developers Even Faster Web Sites1.2 Principles of optimization<br />把重点放在对程序整体开销影响最大的那部分。E.g,循环开销 = 固定开销 + n * 每次循环时间<br />减少固定开销通常收益不大,减少每次增量的开销,即便固定开销有所增加,也可能是一个很好的权衡。<br /> <br />循环嵌套越多,可优化的选择越少。如果循环开销是O(n l

FireCoder的专栏 1317

Camera2Demo

在Camera2 的基础上进行封装,使得Camera2一堆初始化逻辑与Activity分离,降低耦合度,完成预览拍照并保存的操作

读《高性能网站建设指南》有感

读《高性能网站建设指南》有感 这本书最大的特点是把管理人员和技术人员从传统的思维模式中解放出来,对于大多数管理人员和技术人员来说当谈到高性能网站和性能瓶颈时,总是习惯从系统硬件、网络、数据库、中间件、系统架构...

csy542339419的博客 96

WINCC7.3破解文件

WINCC7.3硬件够破解文件,有需要的下载!WINCC7.3硬件够破解文件,有需要的下载!

《高性能网站建设进阶指南》阅读笔记 2

大部分Comet服务器或明显地减少每个线程的资源开销,或者使用微线程或进程。如ErlyComet大多数使用Comet的Php web应用采用分离式(off-board),Php编写的客户端与使用另一门语言编写的服务端通信。工具包:Dojo Toolkit 或者 js.io8.2 Transport Techniques8.2.1 Polling每x 毫秒发出一个请求,检查是否有更新setTimeout(function() {xhrRequest( {"foo" : "bar"})}, 2000);func

FireCoder的专栏 2142

高性能网站建设指南 阅读总结

本书2008年出版,有些内容显得有些老了,很多优化已经被广泛应用甚至有了更好的优化方式,但是阅读后仍然获益良多。 绪言A :前端性能的重要性 时间花在哪了?(性能黄金法则) 至少80%的最终用户响应时间花在了下载页面中所有组件上,仅10%-20%的时间用来下载HTML文档 绪言B :HTTP概述 压缩:用压缩减小响应的大小,服务器用Content-Encoding头确认响应已被压缩 条件get请求:浏览器缓存的副本,用Last-Modified头使浏览器知道组件最后修改时间,服务器会返回304响应.

qq_42736234的博客 500
上一篇: 《高性能网站建设进阶指南》阅读笔记 2
下一篇: mybatis (Ibatis ibator) generator - 1 mysql 分页插件(page/paging/pagination plugin)
FireCoder
博客等级 码龄17年 65粉丝 100原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

FireCoder

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值
⌂ 换网址