-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
1366 lines (965 loc) · 55.9 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 5.2.0">
<link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
<link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png">
<link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png">
<link rel="mask-icon" href="/images/logo.svg" color="#222">
<link rel="stylesheet" href="/css/main.css">
<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Lato:300,300italic,400,400italic,700,700italic|Monaco:300,300italic,400,400italic,700,700italic&display=swap&subset=latin,latin-ext">
<link rel="stylesheet" href="/lib/font-awesome/css/all.min.css">
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/pace-js@1/themes/blue/pace-theme-minimal.css">
<script src="//cdn.jsdelivr.net/npm/pace-js@1/pace.min.js"></script>
<script id="hexo-configurations">
var NexT = window.NexT || {};
var CONFIG = {"hostname":"andrewei1316.github.io","root":"/","scheme":"Mist","version":"7.8.0","exturl":false,"sidebar":{"position":"right","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":false,"show_result":false,"style":null},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":true,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},"path":"search.xml"};
</script>
<meta name="description" content="There's no feat, but what we make.">
<meta property="og:type" content="website">
<meta property="og:title" content="Andrewei's Blog">
<meta property="og:url" content="https://andrewei1316.github.io/index.html">
<meta property="og:site_name" content="Andrewei's Blog">
<meta property="og:description" content="There's no feat, but what we make.">
<meta property="og:locale" content="zh_CN">
<meta property="article:author" content="Andrewei">
<meta name="twitter:card" content="summary">
<link rel="canonical" href="https://andrewei1316.github.io/">
<script id="page-configurations">
// https://hexo.io/docs/variables.html
CONFIG.page = {
sidebar: "",
isHome : true,
isPost : false,
lang : 'zh-CN'
};
</script>
<title>Andrewei's Blog</title>
<noscript>
<style>
.use-motion .brand,
.use-motion .menu-item,
.sidebar-inner,
.use-motion .post-block,
.use-motion .pagination,
.use-motion .comments,
.use-motion .post-header,
.use-motion .post-body,
.use-motion .collection-header { opacity: initial; }
.use-motion .site-title,
.use-motion .site-subtitle {
opacity: initial;
top: initial;
}
.use-motion .logo-line-before i { left: initial; }
.use-motion .logo-line-after i { right: initial; }
</style>
</noscript>
<link rel="alternate" href="/atom.xml" title="Andrewei's Blog" type="application/atom+xml">
</head>
<body itemscope itemtype="http://schema.org/WebPage">
<div class="container use-motion">
<div class="headband"></div>
<header class="header" itemscope itemtype="http://schema.org/WPHeader">
<div class="header-inner"><div class="site-brand-container">
<div class="site-nav-toggle">
<div class="toggle" aria-label="切换导航栏">
<span class="toggle-line toggle-line-first"></span>
<span class="toggle-line toggle-line-middle"></span>
<span class="toggle-line toggle-line-last"></span>
</div>
</div>
<div class="site-meta">
<a href="/" class="brand" rel="start">
<span class="logo-line-before"><i></i></span>
<h1 class="site-title">Andrewei's Blog</h1>
<span class="logo-line-after"><i></i></span>
</a>
</div>
<div class="site-nav-right">
<div class="toggle popup-trigger">
<i class="fa fa-search fa-fw fa-lg"></i>
</div>
</div>
</div>
<nav class="site-nav">
<ul id="menu" class="main-menu menu">
<li class="menu-item menu-item-home">
<a href="/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a>
</li>
<li class="menu-item menu-item-archives">
<a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档</a>
</li>
<li class="menu-item menu-item-categories">
<a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类</a>
</li>
<li class="menu-item menu-item-tags">
<a href="/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签</a>
</li>
<li class="menu-item menu-item-search">
<a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索
</a>
</li>
</ul>
</nav>
<div class="search-pop-overlay">
<div class="popup search-popup">
<div class="search-header">
<span class="search-icon">
<i class="fa fa-search"></i>
</span>
<div class="search-input-container">
<input autocomplete="off" autocapitalize="off"
placeholder="搜索..." spellcheck="false"
type="search" class="search-input">
</div>
<span class="popup-btn-close">
<i class="fa fa-times-circle"></i>
</span>
</div>
<div id="search-result">
<div id="no-result">
<i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i>
</div>
</div>
</div>
</div>
</div>
</header>
<div class="back-to-top">
<i class="fa fa-arrow-up"></i>
<span>0%</span>
</div>
<a href="https://github.com/andrewei1316" class="github-corner" title="Follow me on GitHub" aria-label="Follow me on GitHub" rel="noopener" target="_blank"><svg width="80" height="80" viewBox="0 0 250 250" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a>
<main class="main">
<div class="main-inner">
<div class="content-wrap">
<div class="content index posts-expand">
<article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
<link itemprop="mainEntityOfPage" href="https://andrewei1316.github.io/2020/12/20/top-down-performance-analysis/">
<span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
<meta itemprop="image" content="/images/header.jpg">
<meta itemprop="name" content="Andrewei">
<meta itemprop="description" content="There's no feat, but what we make.">
</span>
<span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
<meta itemprop="name" content="Andrewei's Blog">
</span>
<header class="post-header">
<h2 class="post-title" itemprop="name headline">
<a href="/2020/12/20/top-down-performance-analysis/" class="post-title-link" itemprop="url">《A Top-Down Method for Performance Analysis and Counters Architecture》阅读笔记</a>
</h2>
<div class="post-meta">
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-calendar"></i>
</span>
<span class="post-meta-item-text">发表于</span>
<time title="创建时间:2020-12-20 14:35:36" itemprop="dateCreated datePublished" datetime="2020-12-20T14:35:36+08:00">2020-12-20</time>
</span>
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-calendar-check"></i>
</span>
<span class="post-meta-item-text">更新于</span>
<time title="修改时间:2021-01-03 17:16:39" itemprop="dateModified" datetime="2021-01-03T17:16:39+08:00">2021-01-03</time>
</span>
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-folder"></i>
</span>
<span class="post-meta-item-text">分类于</span>
<span itemprop="about" itemscope itemtype="http://schema.org/Thing">
<a href="/categories/cpu/" itemprop="url" rel="index"><span itemprop="name">cpu</span></a>
</span>
,
<span itemprop="about" itemscope itemtype="http://schema.org/Thing">
<a href="/categories/cpu/performance/" itemprop="url" rel="index"><span itemprop="name">performance</span></a>
</span>
</span>
</div>
</header>
<div class="post-body" itemprop="articleBody">
<h2 id="简介"><a href="#简介" class="headerlink" title="简介"></a>简介</h2><p>随着处理器复杂度的增加、处理任务的多样化以及性能分析工具数据的难以管理,使得性能分析的难度日益增加。同时,在某些领域中,对于资源和时间的限制更加严格,进一步要求性能分析给出分析速度和结果准确性更优的方法。</p>
<p>这篇文章给出了一个自顶向下的分析方法(Top-Down Analysis),可以在乱序处理器上快速定位真正的性能瓶颈。该方法通过将性能数据结构化、分层展示,直观快速的展示性能瓶颈,并且已经被包括 <code>VTune</code> 在内的众多性能工具使用。</p>
<p>不同于其他性能分析方法,该方法的开销很低,只需要在传统的 <code>PMU(Performance Monitor Unit)</code> 中增加 8 个简单的性能事件。它没有对问题域的限制,可以全面的进行性能分析,并且可以找到超标量核心的性能问题。</p>
<!--noindex-->
<div class="post-button">
<a class="btn" href="/2020/12/20/top-down-performance-analysis/#more" rel="contents">
阅读全文 »
</a>
</div>
<!--/noindex-->
</div>
<footer class="post-footer">
<div class="post-eof"></div>
</footer>
</article>
<article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
<link itemprop="mainEntityOfPage" href="https://andrewei1316.github.io/2020/12/13/skylake-microarchitecture/">
<span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
<meta itemprop="image" content="/images/header.jpg">
<meta itemprop="name" content="Andrewei">
<meta itemprop="description" content="There's no feat, but what we make.">
</span>
<span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
<meta itemprop="name" content="Andrewei's Blog">
</span>
<header class="post-header">
<h2 class="post-title" itemprop="name headline">
<a href="/2020/12/13/skylake-microarchitecture/" class="post-title-link" itemprop="url">【转载】Skylake Microarchitecture</a>
</h2>
<div class="post-meta">
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-calendar"></i>
</span>
<span class="post-meta-item-text">发表于</span>
<time title="创建时间:2020-12-13 20:35:04" itemprop="dateCreated datePublished" datetime="2020-12-13T20:35:04+08:00">2020-12-13</time>
</span>
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-calendar-check"></i>
</span>
<span class="post-meta-item-text">更新于</span>
<time title="修改时间:2021-01-03 17:16:39" itemprop="dateModified" datetime="2021-01-03T17:16:39+08:00">2021-01-03</time>
</span>
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-folder"></i>
</span>
<span class="post-meta-item-text">分类于</span>
<span itemprop="about" itemscope itemtype="http://schema.org/Thing">
<a href="/categories/cpu/" itemprop="url" rel="index"><span itemprop="name">cpu</span></a>
</span>
,
<span itemprop="about" itemscope itemtype="http://schema.org/Thing">
<a href="/categories/cpu/arch/" itemprop="url" rel="index"><span itemprop="name">arch</span></a>
</span>
</span>
</div>
</header>
<div class="post-body" itemprop="articleBody">
<blockquote>
<p>本文全部内容都来自于 DECODEZ “Skylake 微架构剖析” 系列,地址 <a target="_blank" rel="noopener" href="https://decodezp.github.io/2019/01/07/quickwords9-skylake-pipeline-1/">https://decodezp.github.io/2019/01/07/quickwords9-skylake-pipeline-1/</a></p>
<p>搬运仅仅为了留作笔记,详细内容请直接访问 DECODEZ 的博客网站 <a target="_blank" rel="noopener" href="https://decodezp.github.io/">https://decodezp.github.io/</a></p>
</blockquote>
<h2 id="前言"><a href="#前言" class="headerlink" title="前言"></a>前言</h2><p>了解 <code>CPU</code> 的微架构是基于其开发“硬核”软件的必需步骤。由于一些历史遗留问题,现存的技术资料往往存在一些概念混淆、重复命名甚至自相矛盾之处。本文一来梳理 <code>Skylake</code> 微架构(主要是流水线)的组成和特性,二来试图厘清一些含混的概念用以帮助后来者。</p>
<p>另外在介绍完微架构之后,会继续结合 <code>Perf</code> 中的 <code>Performance Event</code> 来对照说明互为印证。</p>
<blockquote>
<p>需要强调的是,本文的重点是Skylake的流水线(pipeline)架构,core间的连接和架构方式不作重点说明。</p>
</blockquote>
<!--noindex-->
<div class="post-button">
<a class="btn" href="/2020/12/13/skylake-microarchitecture/#more" rel="contents">
阅读全文 »
</a>
</div>
<!--/noindex-->
</div>
<footer class="post-footer">
<div class="post-eof"></div>
</footer>
</article>
<article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
<link itemprop="mainEntityOfPage" href="https://andrewei1316.github.io/2020/12/12/star-schema-benchmark/">
<span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
<meta itemprop="image" content="/images/header.jpg">
<meta itemprop="name" content="Andrewei">
<meta itemprop="description" content="There's no feat, but what we make.">
</span>
<span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
<meta itemprop="name" content="Andrewei's Blog">
</span>
<header class="post-header">
<h2 class="post-title" itemprop="name headline">
<a href="/2020/12/12/star-schema-benchmark/" class="post-title-link" itemprop="url">《Star Schema Benchmark》阅读笔记</a>
</h2>
<div class="post-meta">
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-calendar"></i>
</span>
<span class="post-meta-item-text">发表于</span>
<time title="创建时间:2020-12-12 13:28:55" itemprop="dateCreated datePublished" datetime="2020-12-12T13:28:55+08:00">2020-12-12</time>
</span>
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-calendar-check"></i>
</span>
<span class="post-meta-item-text">更新于</span>
<time title="修改时间:2020-12-13 14:34:11" itemprop="dateModified" datetime="2020-12-13T14:34:11+08:00">2020-12-13</time>
</span>
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-folder"></i>
</span>
<span class="post-meta-item-text">分类于</span>
<span itemprop="about" itemscope itemtype="http://schema.org/Thing">
<a href="/categories/olap/" itemprop="url" rel="index"><span itemprop="name">olap</span></a>
</span>
,
<span itemprop="about" itemscope itemtype="http://schema.org/Thing">
<a href="/categories/olap/benchmark/" itemprop="url" rel="index"><span itemprop="name">benchmark</span></a>
</span>
</span>
</div>
</header>
<div class="post-body" itemprop="articleBody">
<h2 id="简介"><a href="#简介" class="headerlink" title="简介"></a>简介</h2><p><code>SSB</code>(Star Schema Benchmark)是麻省州立大学波士顿校区的研究人员定义的基于现实商业应用的数据模型,业界公认用来模拟决策支持类应用,比较公正和中立。学术界和工业界普遍采用它来评价决策支持技术方面应用的性能。<br><code>SSB</code> 由 <code>TPC</code>(Transaction Processing Performance Council,事务处理性能委员会)发布的 <code>TPC-H</code> 标准改进而来。它将 <code>TPC-H</code> 的雪花模型改为星型模型,将基准查询由 <code>TPC-H</code> 的复杂 <code>Ad-Hoc</code> 查询改为了结构更固定的 <code>OLAP</code> 查询。</p>
<blockquote>
<p>事务处理性能委员会( Transaction Processing Performance Council ),是由数10家会员公司创建的非盈利组织,总部设在美国。该组织对全世界开放,但迄今为止,绝大多数会员都是美、日、西欧的大公司。TPC的成员主要是计算机软硬件厂家,而非计算机用户,它的功能是制定商务应用基准程序(Benchmark)的标准规范、性能和价格度量,并管理测试结果的发布。</p>
<p>引用自百度百科 <a target="_blank" rel="noopener" href="https://baike.baidu.com/item/TPC/1814556">TPC (事务处理性能委员会)</a></p>
</blockquote>
<p>不使用 <code>TPC-H</code> 的原因是,想要提供更普适的功能覆盖(Functional Coverage)和选择覆盖(Selectivity Coverage):</p>
<ol>
<li>功能覆盖(Functional Coverage):尽可能的选用跨多个表的查询,来贴近实际使用情况</li>
<li>选择覆盖(Selectivity Coverage):通过维度表的条件来过滤事实表,并使得过滤后的结果集相对较少</li>
</ol>
<p>几个概念:</p>
<ol>
<li>SF(Scale Factor):生成测试数据集时传入的数据量规模因子,决定了各表最终生成的行数。</li>
<li>FF(Filter Factor):每个 WHERE 过滤条件筛选出一部分行,被筛选出的行数占过滤前行数的比例叫做 FF。在过滤列彼此独立的条件下,表的FF为该表上各个过滤条件FF的乘积。</li>
</ol>
<!--noindex-->
<div class="post-button">
<a class="btn" href="/2020/12/12/star-schema-benchmark/#more" rel="contents">
阅读全文 »
</a>
</div>
<!--/noindex-->
</div>
<footer class="post-footer">
<div class="post-eof"></div>
</footer>
</article>
<article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
<link itemprop="mainEntityOfPage" href="https://andrewei1316.github.io/2020/11/20/column-stores-vs-row-stores/">
<span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
<meta itemprop="image" content="/images/header.jpg">
<meta itemprop="name" content="Andrewei">
<meta itemprop="description" content="There's no feat, but what we make.">
</span>
<span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
<meta itemprop="name" content="Andrewei's Blog">
</span>
<header class="post-header">
<h2 class="post-title" itemprop="name headline">
<a href="/2020/11/20/column-stores-vs-row-stores/" class="post-title-link" itemprop="url">《Column-Stores vs. Row-Stores How Different Are They Really?》 阅读笔记</a>
</h2>
<div class="post-meta">
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-calendar"></i>
</span>
<span class="post-meta-item-text">发表于</span>
<time title="创建时间:2020-11-20 21:11:35" itemprop="dateCreated datePublished" datetime="2020-11-20T21:11:35+08:00">2020-11-20</time>
</span>
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-calendar-check"></i>
</span>
<span class="post-meta-item-text">更新于</span>
<time title="修改时间:2020-12-13 14:31:06" itemprop="dateModified" datetime="2020-12-13T14:31:06+08:00">2020-12-13</time>
</span>
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-folder"></i>
</span>
<span class="post-meta-item-text">分类于</span>
<span itemprop="about" itemscope itemtype="http://schema.org/Thing">
<a href="/categories/olap/" itemprop="url" rel="index"><span itemprop="name">olap</span></a>
</span>
,
<span itemprop="about" itemscope itemtype="http://schema.org/Thing">
<a href="/categories/olap/%E5%AD%98%E5%82%A8/" itemprop="url" rel="index"><span itemprop="name">存储</span></a>
</span>
</span>
</div>
</header>
<div class="post-body" itemprop="articleBody">
<h2 id="摘要"><a href="#摘要" class="headerlink" title="摘要"></a>摘要</h2><p>本文主要讨论在 OLAP 领域,面向列的存储和计算为什么会比面向行的存储和计算更快的问题。</p>
<p>在 OLAP 场景下,基准测试都会说面向列的存储和计算比面向行的存储和计算块一个数量级。而大家普遍理解面向列快的原因是</p>
<blockquote>
<p>column-stores are more I/O efficient for read-only queries since they only have to read from disk (or from memory) those attributes accessed by a query.</p>
<p>对于只读查询,列存储的I/O效率更高,因为它们只需要从磁盘(或内存)中读取查询所需要的那些字段。</p>
</blockquote>
<p>这种想法让大家认为即使是行存也可以通过一些优化手段,达到列存的性能,包括:</p>
<ol>
<li>垂直分表(vertically partitioning)</li>
<li>全列索引(indexing every column)</li>
</ol>
<p>这些优化手段可以在查询时,只查询部分列对应的数据,从而加快分析速度。</p>
<p>通过一系列实验不难发现,这些手段并不能让面向行存打到列存的性能,原因是列存除了存储优势外,在计算上还有以下几种优化手段:</p>
<ol>
<li>压缩(Compression)</li>
<li>延迟物化(Late Materialization)</li>
<li>快迭代(Block Iteration)</li>
<li>Invisible Join</li>
</ol>
<p>前三种手段是目前面向列的系统中已有的优化手段,最后一种是本文新提出的一种策略,后面的章节会详细介绍。</p>
<!--noindex-->
<div class="post-button">
<a class="btn" href="/2020/11/20/column-stores-vs-row-stores/#more" rel="contents">
阅读全文 »
</a>
</div>
<!--/noindex-->
</div>
<footer class="post-footer">
<div class="post-eof"></div>
</footer>
</article>
<article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
<link itemprop="mainEntityOfPage" href="https://andrewei1316.github.io/2020/10/05/google-file-system/">
<span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
<meta itemprop="image" content="/images/header.jpg">
<meta itemprop="name" content="Andrewei">
<meta itemprop="description" content="There's no feat, but what we make.">
</span>
<span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
<meta itemprop="name" content="Andrewei's Blog">
</span>
<header class="post-header">
<h2 class="post-title" itemprop="name headline">
<a href="/2020/10/05/google-file-system/" class="post-title-link" itemprop="url">Google File System 总结</a>
</h2>
<div class="post-meta">
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-calendar"></i>
</span>
<span class="post-meta-item-text">发表于</span>
<time title="创建时间:2020-10-05 16:52:25" itemprop="dateCreated datePublished" datetime="2020-10-05T16:52:25+08:00">2020-10-05</time>
</span>
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-calendar-check"></i>
</span>
<span class="post-meta-item-text">更新于</span>
<time title="修改时间:2020-11-19 21:22:30" itemprop="dateModified" datetime="2020-11-19T21:22:30+08:00">2020-11-19</time>
</span>
</div>
</header>
<div class="post-body" itemprop="articleBody">
<p>本文是博主学习 <code>MIT6.824</code> 课程的学习笔记,其中会总结论文知识点并加入自己的理解,内容可能与论文原文有出入,想要了解细节的读者可以阅读论文原文或者学习 <code>MIT6.824</code>课程。</p>
<p><a target="_blank" rel="noopener" href="https://pdos.csail.mit.edu/6.824/papers/gfs.pdf">The Google File System</a></p>
<p><a target="_blank" rel="noopener" href="https://pdos.csail.mit.edu/6.824/video/3.html">GFS MIT Video</a></p>
<h2 id="简介"><a href="#简介" class="headerlink" title="简介"></a>简介</h2><p><code>Google File System</code> 简称 <code>GFS</code> 是 <code>Google</code> 设计并实现的一个面向数据密集型应用的、可伸缩的分布式文件系统。</p>
<p><code>GFS</code> 的设计基于以下使用场景:</p>
<ol>
<li>运行在廉价的日用硬件上,组件失效是常态事件。因此,系统必须具有持久的监控、错误侦测、容错以及自动恢复的功能。</li>
<li>以存储大文件(<code>100MB</code> 到 <code>数GB</code>)为主,同时要支持小文件,但是不需要针对小文件做优化。</li>
<li>支持两种读操作:大规模的流式读取(<code>数百KB</code>,或者一次读取 <code>1MB</code> 甚至更多)和小规模的随机读取(在任意位移上读取 <code>几个KB</code>)。</li>
<li>支持两种写操作:大规模的、顺序的对文件的追加和小规模的任意位置写入(不必高效)。</li>
<li>必须支持高效的多客户端同时并行追加数据到同一个文件的语义(<code>Google</code> 的场景下,<code>GFS</code> 中存储的文件通常用于 <code>生产者-消费者</code> 队列,或者其他多路文件合并操作)</li>
<li>大吞吐量优先于低延时</li>
</ol>
<!--noindex-->
<div class="post-button">
<a class="btn" href="/2020/10/05/google-file-system/#more" rel="contents">
阅读全文 »
</a>
</div>
<!--/noindex-->
</div>
<footer class="post-footer">
<div class="post-eof"></div>
</footer>
</article>
<article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
<link itemprop="mainEntityOfPage" href="https://andrewei1316.github.io/2020/10/04/map-reduce/">
<span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
<meta itemprop="image" content="/images/header.jpg">
<meta itemprop="name" content="Andrewei">
<meta itemprop="description" content="There's no feat, but what we make.">
</span>
<span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
<meta itemprop="name" content="Andrewei's Blog">
</span>
<header class="post-header">
<h2 class="post-title" itemprop="name headline">
<a href="/2020/10/04/map-reduce/" class="post-title-link" itemprop="url">MapReduce 总结</a>
</h2>
<div class="post-meta">
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-calendar"></i>
</span>
<span class="post-meta-item-text">发表于</span>
<time title="创建时间:2020-10-04 13:13:12" itemprop="dateCreated datePublished" datetime="2020-10-04T13:13:12+08:00">2020-10-04</time>
</span>
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-calendar-check"></i>
</span>
<span class="post-meta-item-text">更新于</span>
<time title="修改时间:2020-11-19 21:22:30" itemprop="dateModified" datetime="2020-11-19T21:22:30+08:00">2020-11-19</time>
</span>
</div>
</header>
<div class="post-body" itemprop="articleBody">
<p>本文是博主学习 <code>MIT6.824</code> 课程的学习笔记,其中会总结论文知识点并加入自己的理解,内容可能与论文原文有出入,想要了解细节的读者可以阅读论文原文或者学习 <code>MIT6.824</code>课程。</p>
<p><a target="_blank" rel="noopener" href="https://pdos.csail.mit.edu/6.824/papers/mapreduce.pdf">MapReduce: Simplified Data Processing on Large Clusters</a></p>
<p><a target="_blank" rel="noopener" href="https://pdos.csail.mit.edu/6.824/video/1.html">Introduction And MapReduce</a></p>
<h2 id="简介"><a href="#简介" class="headerlink" title="简介"></a>简介</h2><p><code>MapReduce</code> 是一种编程模型,也是一个处理和生成超大数据集算法模型的相关实现。使用 <code>MapReduce</code> 架构的程序能够在大量的普通配置的计算机上实现并行化处理。</p>
<h2 id="MapReduce-模型"><a href="#MapReduce-模型" class="headerlink" title="MapReduce 模型"></a>MapReduce 模型</h2><p><code>MapReduce</code> 编程模型的处理过程为:输入一个 <code>key/value pair</code> 集合,经过处理后,输出一个 <code>key/value pair</code> 集合作为结果。<br><code>MapReduce</code> 允许用户使用两个函数 <code>Map</code> 和 <code>Reduce</code> 来表达上述计算。</p>
<ul>
<li><code>Map</code> 函数接受一个输入的 <code>key/value pair</code> 值,然后产生一个中间 <code>key/value pair</code> 值的集合。<code>MapReduce</code> 把所有 <code>key</code> 为 <code>I</code> 的中间值 <code>value</code>集合在一起后传递给 <code>reduce</code> 函数。</li>
<li><code>Reduce</code> 函数接受一个中间 <code>key</code> 的值 <code>I</code> 和其<code>value</code>值的集合,由于 <code>value</code> 值可能由于太大无法放入内存中,故通常我们把 <code>value</code> 的迭代器传递给 <code>Reduce</code> 函数。</li>
</ul>
<p>上述过程也可以抽象为下面的表达式</p>
<p>$$ map(k1, v1) -> list(k2, v2) $$</p>
<p>$$ reduce(k2, list(v2)) -> list(v2) $$</p>
<!--noindex-->
<div class="post-button">
<a class="btn" href="/2020/10/04/map-reduce/#more" rel="contents">
阅读全文 »
</a>
</div>
<!--/noindex-->
</div>
<footer class="post-footer">
<div class="post-eof"></div>
</footer>
</article>
<article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
<link itemprop="mainEntityOfPage" href="https://andrewei1316.github.io/2019/06/02/method-reference/">
<span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
<meta itemprop="image" content="/images/header.jpg">
<meta itemprop="name" content="Andrewei">
<meta itemprop="description" content="There's no feat, but what we make.">
</span>
<span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
<meta itemprop="name" content="Andrewei's Blog">
</span>
<header class="post-header">
<h2 class="post-title" itemprop="name headline">
<a href="/2019/06/02/method-reference/" class="post-title-link" itemprop="url">方法引用</a>
</h2>
<div class="post-meta">
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-calendar"></i>
</span>
<span class="post-meta-item-text">发表于</span>
<time title="创建时间:2019-06-02 13:55:26 / 修改时间:16:49:33" itemprop="dateCreated datePublished" datetime="2019-06-02T13:55:26+08:00">2019-06-02</time>
</span>
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-folder"></i>
</span>
<span class="post-meta-item-text">分类于</span>
<span itemprop="about" itemscope itemtype="http://schema.org/Thing">
<a href="/categories/%E7%BC%96%E7%A8%8B%E8%AF%AD%E8%A8%80/" itemprop="url" rel="index"><span itemprop="name">编程语言</span></a>
</span>
,
<span itemprop="about" itemscope itemtype="http://schema.org/Thing">
<a href="/categories/%E7%BC%96%E7%A8%8B%E8%AF%AD%E8%A8%80/JAVA/" itemprop="url" rel="index"><span itemprop="name">JAVA</span></a>
</span>
</span>
</div>
</header>
<div class="post-body" itemprop="articleBody">
<h2 id="概述"><a href="#概述" class="headerlink" title="概述"></a>概述</h2><p><code>方法引用</code>的基础是 Lambda 表达式,它可以认为是 Lambda 表达式的语法糖,用来简化开发。</p>
<p>在我们使用Lambda表达式的时候,<code>-></code> 右边部分是要执行的代码,即要完成的功能,可以把这部分称作 Lambda 体。有时候,当我们想要实现一个函数式接口的那个抽象方法,但是已经有类实现了我们想要的功能,这个时候我们就可以用方法引用来直接使用现有类的功能去实现。</p>
<!--noindex-->
<div class="post-button">
<a class="btn" href="/2019/06/02/method-reference/#more" rel="contents">
阅读全文 »
</a>
</div>
<!--/noindex-->
</div>
<footer class="post-footer">
<div class="post-eof"></div>
</footer>
</article>
<article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
<link itemprop="mainEntityOfPage" href="https://andrewei1316.github.io/2019/05/18/java-optional/">
<span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
<meta itemprop="image" content="/images/header.jpg">
<meta itemprop="name" content="Andrewei">
<meta itemprop="description" content="There's no feat, but what we make.">
</span>
<span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
<meta itemprop="name" content="Andrewei's Blog">
</span>
<header class="post-header">
<h2 class="post-title" itemprop="name headline">
<a href="/2019/05/18/java-optional/" class="post-title-link" itemprop="url">Optional 详解</a>
</h2>
<div class="post-meta">
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-calendar"></i>
</span>
<span class="post-meta-item-text">发表于</span>
<time title="创建时间:2019-05-18 10:36:48 / 修改时间:12:17:50" itemprop="dateCreated datePublished" datetime="2019-05-18T10:36:48+08:00">2019-05-18</time>
</span>
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-folder"></i>
</span>
<span class="post-meta-item-text">分类于</span>
<span itemprop="about" itemscope itemtype="http://schema.org/Thing">
<a href="/categories/%E7%BC%96%E7%A8%8B%E8%AF%AD%E8%A8%80/" itemprop="url" rel="index"><span itemprop="name">编程语言</span></a>
</span>
,
<span itemprop="about" itemscope itemtype="http://schema.org/Thing">
<a href="/categories/%E7%BC%96%E7%A8%8B%E8%AF%AD%E8%A8%80/JAVA/" itemprop="url" rel="index"><span itemprop="name">JAVA</span></a>
</span>
</span>
</div>
</header>
<div class="post-body" itemprop="articleBody">
<h3 id="定义"><a href="#定义" class="headerlink" title="定义"></a>定义</h3><ol>
<li><p><code>Optional</code> 的出现主要为了解决 <code>NullPointerExcepton</code> 的异常。</p>
</li>
<li><p><code>Optional</code> 是一个值的容器,用来存储一个 <code>Object</code> 或者 <code>null</code>。</p>
</li>
<li><p>它是一个<code>基于值的类(value-base class)</code>。</p>
<blockquote>
<p>基于值的类(value-base class) 需要满足以下几个条件:</p>
<ol>
<li>必须为 <code>final</code> 和 不可变的(可以包含可变对象的引用);</li>
<li>必须实现 <code>equals</code>、 <code>hashCode</code> 和 <code>toString</code> 方法。并且这些方法必须仅根据当前实例的状态独自计算,而不是根据他的标识或者其他对象的状态、变量计算;</li>
<li>不使用身份敏感的操作,例如实例之间通过引用的 <code>==</code> 来判等、实例的 <code>hashCode</code> 已经实例内在的锁;</li>
<li>两个实例的相等,仅仅基于 <code>equals()</code> 方法,而不基于引用的相等(==);</li>
<li>没有可访问的构造方法(构造方法为私有),仅仅通过工厂方法来实例化对象,但是工厂方法不保证返回实例的一致性(即:第一次调用与第二次调用可能返回的实例是不同的);</li>
<li>如果使用 <code>equals</code> 方法判断两个实例是相同的,那么这两个实例之间可以随意替换。</li>
</ol>
</blockquote>
</li>
</ol>
<!--noindex-->
<div class="post-button">
<a class="btn" href="/2019/05/18/java-optional/#more" rel="contents">
阅读全文 »
</a>
</div>
<!--/noindex-->
</div>
<footer class="post-footer">
<div class="post-eof"></div>
</footer>
</article>
<article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
<link itemprop="mainEntityOfPage" href="https://andrewei1316.github.io/2019/05/04/java-lambda/">
<span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
<meta itemprop="image" content="/images/header.jpg">
<meta itemprop="name" content="Andrewei">
<meta itemprop="description" content="There's no feat, but what we make.">
</span>
<span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
<meta itemprop="name" content="Andrewei's Blog">
</span>
<header class="post-header">
<h2 class="post-title" itemprop="name headline">
<a href="/2019/05/04/java-lambda/" class="post-title-link" itemprop="url">Lambda 表达式与函数式接口</a>
</h2>
<div class="post-meta">
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-calendar"></i>
</span>
<span class="post-meta-item-text">发表于</span>
<time title="创建时间:2019-05-04 16:54:51" itemprop="dateCreated datePublished" datetime="2019-05-04T16:54:51+08:00">2019-05-04</time>
</span>
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-calendar-check"></i>
</span>
<span class="post-meta-item-text">更新于</span>
<time title="修改时间:2019-05-08 09:49:54" itemprop="dateModified" datetime="2019-05-08T09:49:54+08:00">2019-05-08</time>
</span>
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-folder"></i>
</span>
<span class="post-meta-item-text">分类于</span>
<span itemprop="about" itemscope itemtype="http://schema.org/Thing">
<a href="/categories/%E7%BC%96%E7%A8%8B%E8%AF%AD%E8%A8%80/" itemprop="url" rel="index"><span itemprop="name">编程语言</span></a>
</span>
,
<span itemprop="about" itemscope itemtype="http://schema.org/Thing">
<a href="/categories/%E7%BC%96%E7%A8%8B%E8%AF%AD%E8%A8%80/JAVA/" itemprop="url" rel="index"><span itemprop="name">JAVA</span></a>
</span>
</span>
</div>
</header>
<div class="post-body" itemprop="articleBody">
<blockquote>
<p>视频教程笔记,视频地址见 <a target="_blank" rel="noopener" href="https://www.bilibili.com/video/av46434650">深入理解 Java8+jdk8 源码级思想</a></p>
</blockquote>
<h2 id="Lambda-表达式"><a href="#Lambda-表达式" class="headerlink" title="Lambda 表达式"></a>Lambda 表达式</h2><h3 id="Lambda-表达式简介"><a href="#Lambda-表达式简介" class="headerlink" title="Lambda 表达式简介"></a>Lambda 表达式简介</h3><h4 id="介绍"><a href="#介绍" class="headerlink" title="介绍"></a>介绍</h4><p>Lambda 表达式可以认为是一种匿名函数(对 JAVA 而言,他是一个对象,此处暂且认为是一种匿名函数吧),简单地说,它是没有声明的方法,也即没有访问修饰符、返回值声明和名字。</p>
<h4 id="作用"><a href="#作用" class="headerlink" title="作用"></a>作用</h4><ol>
<li>在 JAVA8 之前,无法将函数作为参数传递给一个方法,也无法声明返回一个函数的方法。Lambda 表达式为 JAVA 添加了缺失的函数式编程的特性,使我们能把函数作为一等公民看待</li>
<li>在将函数作为一等公民的语言中,Lambda 表达式的类型是函数。但是在 JAVA 中 Lambda 表达式是对象,他们必须依附于一类特别的对象类型——函数式接口。</li>
</ol>
<!--noindex-->
<div class="post-button">
<a class="btn" href="/2019/05/04/java-lambda/#more" rel="contents">
阅读全文 »
</a>
</div>
<!--/noindex-->
</div>
<footer class="post-footer">