Skip to content

Commit 67becd8

Browse files
author
zhouxuwen
committed
Site updated: 2022-02-11 11:41:53
1 parent 3f2acdd commit 67becd8

File tree

6 files changed

+129
-129
lines changed

6 files changed

+129
-129
lines changed

2021/07/08/RPC系列(二)-gRPC入门/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131
<meta property="article:modified_time" content="2022-02-09T08:54:45.288Z">
3232
<meta property="article:author" content="zhouxuwen">
3333
<meta property="article:tag" content="Golang">
34-
<meta property="article:tag" content="gRPC">
3534
<meta property="article:tag" content="RPC">
35+
<meta property="article:tag" content="gRPC">
3636
<meta property="article:tag" content="ProtoBuf">
3737
<meta name="twitter:card" content="summary">
3838

@@ -320,8 +320,8 @@ <h3 id="项目源码"><a href="#项目源码" class="headerlink" title="项目
320320
<footer class="post-footer">
321321
<div class="post-tags">
322322
<a href="/tags/Golang/" rel="tag"># Golang</a>
323-
<a href="/tags/gRPC/" rel="tag"># gRPC</a>
324323
<a href="/tags/RPC/" rel="tag"># RPC</a>
324+
<a href="/tags/gRPC/" rel="tag"># gRPC</a>
325325
<a href="/tags/ProtoBuf/" rel="tag"># ProtoBuf</a>
326326
</div>
327327

2021/07/15/RPC序列(三)-gRPC安全认证/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030
<meta property="article:published_time" content="2021-07-15T01:14:28.000Z">
3131
<meta property="article:modified_time" content="2022-02-09T08:54:45.288Z">
3232
<meta property="article:author" content="zhouxuwen">
33-
<meta property="article:tag" content="gRPC">
3433
<meta property="article:tag" content="RPC">
34+
<meta property="article:tag" content="gRPC">
3535
<meta property="article:tag" content="SSL&#x2F;TLS">
3636
<meta name="twitter:card" content="summary">
3737

@@ -322,8 +322,8 @@ <h3 id="项目源码"><a href="#项目源码" class="headerlink" title="项目
322322

323323
<footer class="post-footer">
324324
<div class="post-tags">
325-
<a href="/tags/gRPC/" rel="tag"># gRPC</a>
326325
<a href="/tags/RPC/" rel="tag"># RPC</a>
326+
<a href="/tags/gRPC/" rel="tag"># gRPC</a>
327327
<a href="/tags/SSL-TLS/" rel="tag"># SSL/TLS</a>
328328
</div>
329329

2022/02/11/Golang性能优化篇/index.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,16 @@
2727
<meta property="og:site_name" content="Xuwen&#39;s Blog">
2828
<meta property="og:description" content="在编写代码时常使用且常忽视的性能问题进行总结。这篇文章将持续更新…">
2929
<meta property="og:locale" content="zh_CN">
30-
<meta property="og:image" content="http://yoursite.com/images/banchmark2022021101.png">
31-
<meta property="og:image" content="http://yoursite.com/images/banchmark2022021102.png">
30+
<meta property="og:image" content="http://yoursite.com/images/benchmark-2022021101.png">
31+
<meta property="og:image" content="http://yoursite.com/images/benchmark-2022021102.png">
3232
<meta property="article:published_time" content="2022-02-11T03:27:23.000Z">
33-
<meta property="article:modified_time" content="2022-02-11T03:36:44.980Z">
33+
<meta property="article:modified_time" content="2022-02-11T03:41:22.842Z">
3434
<meta property="article:author" content="zhouxuwen">
3535
<meta property="article:tag" content="Golang">
3636
<meta property="article:tag" content="json">
3737
<meta property="article:tag" content="string">
3838
<meta name="twitter:card" content="summary">
39-
<meta name="twitter:image" content="http://yoursite.com/images/banchmark2022021101.png">
39+
<meta name="twitter:image" content="http://yoursite.com/images/benchmark-2022021101.png">
4040

4141
<link rel="canonical" href="http://yoursite.com/2022/02/11/Golang%E6%80%A7%E8%83%BD%E4%BC%98%E5%8C%96%E7%AF%87/">
4242

@@ -224,7 +224,7 @@ <h1 class="post-title" itemprop="name headline">
224224
<span class="post-meta-item-text">发表于</span>
225225

226226

227-
<time title="创建时间:2022-02-11 11:27:23 / 修改时间:11:36:44" itemprop="dateCreated datePublished" datetime="2022-02-11T11:27:23+08:00">2022-02-11</time>
227+
<time title="创建时间:2022-02-11 11:27:23 / 修改时间:11:41:22" itemprop="dateCreated datePublished" datetime="2022-02-11T11:27:23+08:00">2022-02-11</time>
228228
</span>
229229
<span class="post-meta-item">
230230
<span class="post-meta-item-icon">
@@ -285,11 +285,11 @@ <h2 id="字符串连接"><a href="#字符串连接" class="headerlink" title="
285285

286286

287287
<p>既然方法有这么多种,性能问题就会有差异,通过benchmark测试查看一下:</p>
288-
<p><img src="/images/banchmark2022021101.png" alt="banchmark2022021101"></p>
288+
<p><img src="/images/benchmark-2022021101.png" alt="benchmark-2022021101"></p>
289289
<p>可以看出copy和strings.Builder性能上是最好的,fmt.Sprintf是最差的,为什么呢?要知道golang 里面的字符串都是不可变的,每次运算都会产生一个新的字符串,所以会产生很多临时的无用的字符串,不仅没有用,还会给 gc 带来额外的负担,所以性能变差。而copy和strings.Builder根据长度预先分配内存,没有产生很多临时的无用的字符串。本质上就是以空间换时间。</p>
290290
<h2 id="json序列化"><a href="#json序列化" class="headerlink" title="json序列化"></a>json序列化</h2><p>json系列我们最常用的就是标准库里的encoding/json,但为提高性能可以使用一些第三方库替换。如json-iterator、easyjson等。</p>
291291
<p>性能提升多少呢?我们通过banchmark测试看一下:</p>
292-
<p><img src="/images/banchmark2022021102.png" alt="banchmark2022021101"></p>
292+
<p><img src="/images/benchmark-2022021102.png" alt="benchmark-2022021101"></p>
293293
<p>可以看到json-iterator和easyjson相比easyjson提升整整一倍。但第三方库有一定的维护成本,但数据量大的时候,使用第三方库也是值得的。</p>
294294

295295
</div>

css/main.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1168,7 +1168,7 @@ pre .javascript .function {
11681168
}
11691169
.links-of-author a::before,
11701170
.links-of-author span.exturl::before {
1171-
background: #cff642;
1171+
background: #218733;
11721172
border-radius: 50%;
11731173
content: ' ';
11741174
display: inline-block;

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ <h2 class="post-title" itemprop="name headline">
216216
<span class="post-meta-item-text">发表于</span>
217217

218218

219-
<time title="创建时间:2022-02-11 11:27:23 / 修改时间:11:36:44" itemprop="dateCreated datePublished" datetime="2022-02-11T11:27:23+08:00">2022-02-11</time>
219+
<time title="创建时间:2022-02-11 11:27:23 / 修改时间:11:41:22" itemprop="dateCreated datePublished" datetime="2022-02-11T11:27:23+08:00">2022-02-11</time>
220220
</span>
221221
<span class="post-meta-item">
222222
<span class="post-meta-item-icon">

0 commit comments

Comments
 (0)