{"id":315470,"date":"2020-12-24T15:00:53","date_gmt":"2020-12-24T15:00:53","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=315470"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2020-12-24T15:00:53","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=315470","title":{"rendered":"\u041f\u0435\u0440\u0432\u044b\u0439 \u043f\u0430\u0440\u0441\u0435\u0440 \u043d\u0430 \u0434\u0435\u0440\u0435\u0432\u043d\u0435"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\">\u0421\u0435\u0433\u043e\u0434\u043d\u044f \u043c\u044b \u043f\u043e\u043c\u0435\u0440\u044f\u0435\u043c\u0441\u044f \u043f\u0430\u0440\u0441\u0435\u0440\u0430\u043c\u0438. \u0422\u043e\u0447\u043d\u0435\u0435, \u043f\u043e\u043c\u0435\u0440\u044f\u0435\u043c \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u0445 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 JavaScript-\u043f\u0430\u0440\u0441\u0435\u0440\u043e\u0432 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043e\u0434\u043d\u043e\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0442\u0440\u043e\u043a\u0438 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0444\u043e\u0440\u043c\u0430\u0442\u0430 \u0432 \u043e\u0431\u044a\u0435\u043a\u0442.<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/s6\/dk\/4z\/s6dk4zwhqda6qg-umi2pu0zpumu.png\"><\/div>\n<p>  \u0412\u043e\u043f\u0440\u043e\u0441\u044b \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u043d\u043e\u0433\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 \u0432 JavaScript \u043e\u0441\u0442\u0430\u0432\u0438\u043c \u0437\u0430 \u0440\u0430\u043c\u043a\u0430\u043c\u0438 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u0438 \u0441\u043e\u0441\u0440\u0435\u0434\u043e\u0442\u043e\u0447\u0438\u043c\u0441\u044f \u043d\u0430 <b>\u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430\u0445 \u0438 \u043c\u0430\u043b\u043e\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0445 \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439<\/b> \u0434\u043b\u044f \u0440\u0430\u0437\u0431\u043e\u0440\u0430 <a href=\"https:\/\/github.com\/postgres\/postgres\/blob\/REL_12_STABLE\/src\/backend\/commands\/explain.c#L2871\">\u0441\u0442\u0440\u043e\u043a\u0438 buffers-\u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430<\/a> \u0443\u0437\u043b\u0430 \u043f\u043b\u0430\u043d\u0430 PostgreSQL.<\/p>\n<p>  \u0422\u043e \u0435\u0441\u0442\u044c \u0438\u0437 \u0441\u0442\u0440\u043e\u043a\u0438 \u0432\u0438\u0434\u0430 <code>'<i><b>Buffers: shared hit=123 read=456, local hit=789<\/b><\/i>'<\/code> \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c JSON \u0442\u0430\u043a\u043e\u0433\u043e \u0444\u043e\u0440\u043c\u0430\u0442\u0430:<\/p>\n<pre><code class=\"json\">{   &quot;shared-hit&quot;  : 123 , &quot;shared-read&quot; : 456 , &quot;local-hit&quot;   : 789 }<\/code><\/pre>\n<p>  \u0412\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0432\u0440\u043e\u0434\u0435 \u0432\u0441\u0435 \u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u043e, \u043f\u0440\u0430\u0432\u0434\u0430 \u0436\u0435?<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/6g\/et\/ly\/6getlyxcjulh9v1nlggc8llndwc.png\"><\/div>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<h2>\u041d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u0440\u0435\u0434\u044b\u0441\u0442\u043e\u0440\u0438\u0438<\/h2>\n<p>  \u041e\u0442\u043a\u0443\u0434\u0430 \u0432\u043e\u043e\u0431\u0449\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u0430 \u0442\u0430\u043a\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430 \u2014 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0438 \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u0435\u0435?<\/p>\n<p>  \u042f <a href=\"https:\/\/habr.com\/ru\/post\/blog\/487380\/\">\u0443\u0436\u0435 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u043b<\/a>, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u0432 \u00ab\u0422\u0435\u043d\u0437\u043e\u0440\u0435\u00bb \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043c\u043d\u043e\u0433\u043e \u0441\u043e\u0442\u0435\u043d \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432 PostgreSQL. \u0418 \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438\u0433\u043b\u044f\u0434\u044b\u0432\u0430\u0442\u044c \u0437\u0430 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043d\u0430 \u043d\u0438\u0445, \u043c\u044b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0438 <a href=\"https:\/\/youtu.be\/5XKbFb-l5Do?t=1459\">\u043a\u043e\u043b\u043b\u0435\u043a\u0442\u043e\u0440-\u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043b\u043e\u0433\u043e\u0432<\/a> \u044d\u0442\u043e\u0439 \u0421\u0423\u0411\u0414, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u00ab\u0432\u044b\u0446\u0435\u043f\u043b\u044f\u0435\u0442\u00bb \u0438\u0437 \u043f\u043e\u0442\u043e\u043a\u0430 \u043e\u0442 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 <b>\u043f\u043b\u0430\u043d\u044b \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432<\/b>, \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0435\u0442 \u0438\u0445 \u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0443\u0437\u043b\u0430, \u0447\u0442\u043e <a href=\"https:\/\/youtu.be\/jHqaLp040rY?t=510\">\u043d\u0435 \u0442\u0430\u043a \u0443\u0436 \u0438 \u043f\u0440\u043e\u0441\u0442\u043e<\/a>.<\/p>\n<p>  \u0422\u043e \u0435\u0441\u0442\u044c \u043d\u0430\u0434\u043e \u0443\u043c\u0435\u0442\u044c \u00ab\u0441\u0438\u0434\u0435\u0442\u044c \u043d\u0430 \u043f\u043e\u0442\u043e\u043a\u0435\u00bb \u0438 \u0431\u044b\u0441\u0442\u0440\u043e-\u0431\u044b\u0441\u0442\u0440\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c (\u0430 \u043f\u043e\u0442\u043e\u043c\u0443 \u2014 \u0438\u043c\u0435\u0442\u044c <b><i>\u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u0443\u044e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0438 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u0438\u0440\u043e\u0441\u0442 \u043f\u0430\u043c\u044f\u0442\u0438<\/i><\/b>) \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0432\u043e\u0442 \u0442\u0430\u043a\u0438\u0435 \u0431\u043b\u043e\u043a\u0438 \u0442\u0435\u043a\u0441\u0442\u0430, \u0430 \u0441\u0440\u0435\u0434\u0438 \u043d\u0438\u0445 \u2014 \u0438 \u043d\u0430\u0448\u0438 buffers-\u0441\u0442\u0440\u043e\u043a\u0438:<\/p>\n<pre><code class=\"plaintext\">Hash Left Join (actual time=9.248..51.659 rows=551 loops=1)   Hash Cond: (c.reloftype = t.oid)   Buffers: shared hit=5814 read=251 dirtied=63   -&gt;  Hash Join (actual time=2.990..7.148 rows=551 loops=1)         Hash Cond: (c.relnamespace = nc.oid)         Buffers: shared hit=4249 read=2         -&gt;  Seq Scan on pg_class c (actual time=0.046..3.922 rows=555 loops=1)               Filter: ((relkind = ANY ('{r,v,f,p}'::&quot;char&quot;[])) AND (pg_has_role(relowner, 'USAGE'::text) OR has_table_privilege(oid, 'SELECT, INSERT, UPDATE, DELETE, TRUNCATE, REFERENCES, TRIGGER'::text) OR has_any_column_privilege(oid, 'SELECT, INSERT, UPDATE, REFERENCES'::text)))               Rows Removed by Filter: 3308               Buffers: shared hit=1829         -&gt;  Hash (actual time=2.931..2.931 rows=7 loops=1)               Buckets: 1024  Batches: 1  Memory Usage: 9kB               Buffers: shared hit=2420 read=2               -&gt;  Seq Scan on pg_namespace nc (actual time=0.035..2.912 rows=7 loops=1)                     Filter: (NOT pg_is_other_temp_schema(oid))                     Rows Removed by Filter: 784                     Buffers: shared hit=2420 read=2   -&gt;  Hash (actual time=6.199..6.199 rows=1629 loops=1)         Buckets: 2048  Batches: 1  Memory Usage: 277kB         Buffers: shared hit=105 read=162 dirtied=63         -&gt;  Hash Join (actual time=0.338..5.640 rows=1629 loops=1)               Hash Cond: (t.typnamespace = nt.oid)               Buffers: shared hit=105 read=162 dirtied=63               -&gt;  Seq Scan on pg_type t (actual time=0.015..4.910 rows=1629 loops=1)                     Buffers: shared hit=57 read=162 dirtied=63               -&gt;  Hash (actual time=0.307..0.307 rows=791 loops=1)                     Buckets: 1024  Batches: 1  Memory Usage: 86kB                     Buffers: shared hit=48                     -&gt;  Seq Scan on pg_namespace nt (actual time=0.004..0.121 rows=791 loops=1)                           Buffers: shared hit=48 <\/code><\/pre>\n<p>  <\/p>\n<h4>\u0424\u043e\u0440\u043c\u0430\u0442 \u0441\u0442\u0440\u043e\u043a\u0438<\/h4>\n<p>  \u0412 \u043e\u0431\u0449\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435, <a href=\"https:\/\/github.com\/postgres\/postgres\/blob\/REL_12_STABLE\/src\/backend\/commands\/explain.c#L2871\">\u0444\u043e\u0440\u043c\u0430\u0442 \u043e\u043f\u0438\u0441\u0430\u043d \u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0430\u0445 PostgreSQL<\/a>. \u0415\u0441\u043b\u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0435\u0433\u043e \u0432 \u0432\u0438\u0434\u0435 JS-\u043a\u043e\u0434\u0430, \u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u0447\u0442\u043e-\u0442\u043e \u0432\u0440\u043e\u0434\u0435:<\/p>\n<pre><code class=\"javascript\">const keys = [   ['shared', ['hit', 'read', 'dirtied', 'written']] , ['local',  ['hit', 'read', 'dirtied', 'written']] , ['temp',   ['read', 'written']] \/\/ \u0434\u0430, \u0442\u0443\u0442 \u0434\u0440\u0443\u0433\u043e\u0439 \u043d\u0430\u0431\u043e\u0440 \u043a\u043b\u044e\u0447\u0435\u0439 2-\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f ];  let str = 'Buffers: ' + \/\/ \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u043d\u043e\u0435 \u043d\u0430\u0447\u0430\u043b\u043e   keys     .filter(([keyo, keysi]) =&gt; node[keyo])     .map(([keyo, keysi]) =&gt; [         keyo       , ...keysi           .filter(keyi =&gt; node[keyo][keyi] &gt; 0)           .map(keyi =&gt; `${keyi}=${node[keyo][keyi]}`)       ].join(' ') \/\/ \u0432\u043d\u0443\u0442\u0440\u0438 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u044b \u0447\u0435\u0440\u0435\u0437 \u043f\u0440\u043e\u0431\u0435\u043b     )     .join(', ');  \/\/ \u0441\u043d\u0430\u0440\u0443\u0436\u0438 - \u0447\u0435\u0440\u0435\u0437 \u0437\u0430\u043f\u044f\u0442\u0430\u044f-\u043f\u0440\u043e\u0431\u0435\u043b <\/code><\/pre>\n<p>  <\/p>\n<h2>\u041c\u0435\u0442\u043e\u0434\u0438\u043a\u0430 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f<\/h2>\n<p>  \u041d\u043e \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043f\u0430\u0440\u0441\u0438\u0442\u044c \u043f\u0440\u043e\u0431\u0435\u043b\u044b \u043d\u0435\u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u0441\u043e\u0432\u0441\u0435\u043c, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u0440\u0430\u0437\u0443 \u0434\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c\u0441\u044f, \u0447\u0442\u043e \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043d\u0430 \u0443\u0436\u0435 <a href=\"https:\/\/gist.githubusercontent.com\/Kilor\/8c4fee60a94073c1accc6bdd167e9990\/raw\/8b2918e5eb55c1e61034e80adb10554551434718\/buffers.txt\">\u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u043e\u043c \u043d\u0430\u0431\u043e\u0440\u0435<\/a>, \u0433\u0434\u0435 \u043e\u043d\u0438 \u0443\u0431\u0440\u0430\u043d\u044b:<\/p>\n<pre><code class=\"plaintext\">Buffers: shared hit=31770 Buffers: shared hit=1159 Buffers: shared hit=255 Buffers: shared hit=2579 read=2961 dirtied=3 Buffers: shared hit=3 read=1 Buffers: shared hit=205 read=44 Buffers: shared hit=230 read=34 dirtied=3 Buffers: shared hit=13 Buffers: shared hit=5 Buffers: shared hit=6 ...<\/code><\/pre>\n<p>  \u0427\u0442\u043e\u0431\u044b \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0435 \u0432\u043b\u0438\u044f\u043d\u0438\u0435 GC, \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043d\u0430\u0448\u0438 \u0442\u0435\u0441\u0442\u044b \u0431\u0443\u0434\u0435\u043c \u0441 \u043a\u043b\u044e\u0447\u0430\u043c\u0438 <code>--expose-gc --initial-old-space-size=1024<\/code>. \u041e\u0446\u0435\u043d\u0438\u0432\u0430\u0435\u043c \u0432\u0441\u0435\u0445 \u0443\u0447\u0430\u0441\u0442\u043d\u0438\u043a\u043e\u0432 \u043f\u043e \u0434\u0432\u0443\u043c \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f\u043c: \u043e\u0431\u0449\u0435\u0435 <b>\u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0438 \u043f\u0440\u0438\u0440\u043e\u0441\u0442 \u043e\u0431\u044a\u0435\u043c\u0430 \u043f\u0430\u043c\u044f\u0442\u0438<\/b>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c (\u0438 \u043d\u0430 \u0447\u0438\u0441\u0442\u043a\u0443 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043f\u043e\u0442\u043e\u043c \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u043f\u043e\u0442\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u0440\u0435\u043c\u044f GC \u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u044b CPU).<\/p>\n<p>  \u0428\u0430\u0431\u043b\u043e\u043d \u043d\u0430\u0448\u0435\u0433\u043e \u0442\u0435\u0441\u0442\u0430 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a:<\/p>\n<pre><code class=\"javascript\">const fs = require('fs'); const heapdump = require('heapdump');  const buffers = fs.readFileSync('buffers.txt').toString().split('\\n');  const parseBuffers = line =&gt; { \/\/ -- 8&lt; -- \/\/ ... \/\/ -- 8&lt; -- };  global.gc();  \/\/ \u043d\u0443\u043b\u0435\u0432\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0434\u043e \u0442\u0435\u0441\u0442\u0430 heapdump.writeSnapshot();  const hrb = process.hrtime(); for (let line of buffers) {   let obj = parseBuffers(line); } const hre = process.hrtime(hrb); \/\/ \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043f\u0430\u043c\u044f\u0442\u0438 \u043f\u043e\u0441\u043b\u0435 \u0442\u0435\u0441\u0442\u0430 heapdump.writeSnapshot();  const usec = hre[0] * 1e+9 + hre[1]; console.log(usec);<\/code><\/pre>\n<p>  \u0427\u0442\u043e \u0436\u2026 \u041f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043c, \u0438 \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u0435\u043c\u0441\u044f \u0433\u0440\u0430\u043c\u043e\u0442\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u0430\u044e\u0442 \u043d\u0430\u043c \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 \u044f\u0437\u044b\u043a\u0430.<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/p6\/6s\/g1\/p66sg12saub2yzx9xe7mvjeq2t8.png\"><\/div>\n<p>  \u0418 \u043d\u0430\u0447\u043d\u0435\u043c \u0441 \u0441\u0430\u043c\u043e\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e.<\/p>\n<h2><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/w0\/00\/um\/w000umtzfuyd9asq2q4_ss7i7n8.png\"> \u0411\u0440\u043e\u043d\u0437\u0430: \u043e\u0431\u044b\u043a\u043d\u043e\u0432\u0435\u043d\u043d\u044b\u0439 .split<\/h2>\n<p>  <\/p>\n<pre><code class=\"javascript\">const parseBuffers = line =&gt; {   let rv = {};   line.slice('Buffers: '.length)              \/\/ &quot;\u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u043d\u043e\u0435&quot; \u043d\u0430\u0447\u0430\u043b\u043e \u043d\u0430\u0441 \u043d\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u0435\u0442     .split(', ').forEach(part =&gt; {            \/\/ 'shared ..., local ..., temp ...' =&gt; ['shared ...', 'local ...', 'temp ...']       let [kind, ...pairs] = part.split(' '); \/\/ 'shared hit=1 read=2' =&gt; ['shared', ['hit=1', 'read=2']]       pairs.forEach(pair =&gt; {         let [type, val] = pair.split('=');    \/\/ 'hit=1' =&gt; ['hit', '1']         rv[`${kind}-${type}`] = Number(val);  \/\/ ['shared-hit'] = 1       });     });   return rv; }; <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"plaintext\">Time, avg: 544ms Size Delta: +14.8MB:  - (sliced string) : +6.8 \/\/ \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u044b \u0441\u0442\u0440\u043e\u043a \u0431\u0435\u0437 'Buffers: '  - (string)        : +6.3 \/\/ \u0441\u0442\u0440\u043e\u043a\u0438 \u0438\u043c\u0435\u043d \u043a\u043b\u044e\u0447\u0435\u0439  - (array)         : +1.7 \/\/ \u043c\u0430\u0441\u0441\u0438\u0432\u044b pairs <\/code><\/pre>\n<p>  <\/p>\n<h2><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/p1\/yc\/ho\/p1ychoxyjf7bfzhvlq_ualswsae.png\"> \u0421\u0435\u0440\u0435\u0431\u0440\u043e: .lastIndex + \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u044f \u043f\u043e .matchAll(RegExp)<\/h2>\n<p>  \u0418\u0442\u0430\u043a, \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0432\u044b\u0432\u043e\u0434\u044b \u0438\u0437 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0433\u043e \u0442\u0435\u0441\u0442\u0430: <b>.slice \u0438 .split \u043d\u0430\u043c \u043d\u0435 \u0434\u0440\u0443\u0437\u044c\u044f<\/b>, \u043a\u0430\u043a \u0438 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u0438\u043c\u0435\u043d \u043a\u043b\u044e\u0447\u0435\u0439.<\/p>\n<p>  \u0421 \u0438\u043c\u0435\u043d\u0430\u043c\u0438 \u043a\u043b\u044e\u0447\u0435\u0439 \u0432\u0441\u0435 \u043f\u043e\u043d\u044f\u0442\u043d\u043e \u2014 \u0434\u0430\u0432\u0430\u0439\u0442\u0435 <b>\u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c \u0438\u0445 \u0432\u0441\u0435 \u0437\u0430\u0440\u0430\u043d\u0435\u0435<\/b>, \u0438\u0445 \u0436\u0435 \u0432\u0441\u0435\u0433\u043e 10 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432. \u0410 \u0432\u043e\u0442 <code>.slice<\/code> \u0441\u0442\u0440\u043e\u043a\u0438 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438, \u0442\u043e\u043b\u044c\u043a\u043e \u043b\u0438\u0448\u044c \u0447\u0442\u043e\u0431\u044b \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u00ab\u0441\u0434\u0432\u0438\u043d\u0443\u0442\u044c\u00bb \u043d\u0430\u0447\u0430\u043b\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u043d\u0430 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e\u0435 \u043d\u0430\u0447\u0430\u043b\u043e <code>'Buffers: '<\/code>. \u0410 \u043d\u0435\u043b\u044c\u0437\u044f \u043b\u0438 \u043a\u0430\u043a-\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u0431\u0435\u0437 \u043f\u043e\u0440\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u043d\u043e\u0432\u044b\u0445 \u0441\u0442\u0440\u043e\u043a?<\/p>\n<p>  \u041e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u043c\u043e\u0436\u043d\u043e, \u0435\u0441\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <b>\u043f\u0440\u0438\u043d\u0443\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0443 <code>re.lastIndex<\/code><\/b> \u0434\u043b\u044f \u00ab\u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0433\u043e\u00bb RegExp.  <\/p>\n<blockquote><p>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043f\u0440\u043e <code>g-<\/code> \u0438 <code>y-<\/code>\u043a\u043b\u044e\u0447\u0438 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 <code>.lastIndex<\/code> <a href=\"https:\/\/javascript.info\/regexp-sticky\">\u0434\u043b\u044f \u0431\u043e\u043b\u0435\u0435 \u0442\u043e\u0447\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f RegExp<\/a>.<\/p><\/blockquote>\n<p>  \u041d\u0430 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043a\u0430\u0442\u044c \u0432 \u0441\u0442\u0440\u043e\u043a\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0435 \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u0441\u043b\u043e\u0432\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u0441 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u044e\u0442:<\/p>\n<pre><code class=\"javascript\">const buffersRE = \/(shared|local|temp)|(hit|read|dirtied|written)=(\\d+)\/g;  const buffersKeys = {   'shared' : {     'hit'     : 'shared-hit'   , 'read'    : 'shared-read'   , 'dirtied' : 'shared-dirtied'   , 'written' : 'shared-written'   } , 'local' : {     'hit'     : 'local-hit'   , 'read'    : 'local-read'   , 'dirtied' : 'local-dirtied'   , 'written' : 'local-written'   } , 'temp' : {     'read'    : 'temp-read'   , 'written' : 'temp-written'   } };  const parseBuffers = line =&gt; {   let rv = {};    let keys;   buffersRE.lastIndex = 9; \/\/ \u0441\u0434\u0432\u0438\u0433\u0430\u0435\u043c \u043d\u0430\u0447\u0430\u043b\u043e \u043f\u043e\u0438\u0441\u043a\u0430 \u043d\u0430 'Buffers: '.length   for (let match of line.matchAll(buffersRE)) {     if (match[1]) {       keys = buffersKeys[match[1]];     }     else {       rv[keys[match[2]]] = Number(match[3]);     }   }   return rv; }; <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"plaintext\">Time, avg: 270ms Size Delta: +8.5MB <\/code><\/pre>\n<p>  <\/p>\n<h2><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/fr\/ab\/-o\/frab-oi9twa9clpphaq2s96vxuk.png\"> \u0417\u043e\u043b\u043e\u0442\u043e: \u043f\u043e\u043b\u043d\u043e\u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u043d\u044b\u0439 .match(RegExp)<\/h2>\n<p>  \u041d\u043e \u043d\u0438 \u0432 \u043e\u0434\u043d\u043e\u043c \u0438\u0437 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u043c\u044b \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u043d\u0430\u0448\u0438 \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u043a\u043b\u044e\u0447\u0438 \u0438\u0434\u0443\u0442 \u0432 \u0441\u0442\u0440\u043e\u0433\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435.<\/p>\n<p>  \u0427\u0442\u043e\u0431\u044b \u043d\u0435 \u0437\u0430\u043d\u0438\u043c\u0430\u0442\u044c\u0441\u044f \u00ab\u0434\u0432\u0443\u0445\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u044b\u043c\u00bb \u0441\u043f\u0443\u0441\u043a\u043e\u043c \u043f\u043e \u0441\u043b\u043e\u0432\u0430\u0440\u044e \u0437\u0430 \u0438\u043c\u0435\u043d\u0430\u043c\u0438 \u043a\u043b\u044e\u0447\u0435\u0439, \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u043c \u0442\u0430\u043a\u043e\u0439 <s>\u0441\u0442\u0440\u0430\u0448\u043d\u044b\u0439<\/s> RegExp, \u043a\u0430\u0436\u0434\u0430\u044f <b>\u0437\u0430\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u0435\u043c\u0430\u044f \u043f\u043e\u0437\u0438\u0446\u0438\u044f \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0432\u0441\u0435\u0433\u0434\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043e\u0434\u043d\u043e\u043c\u0443 \u0438 \u0442\u043e\u043c\u0443 \u0436\u0435 \u0438\u043c\u0435\u043d\u0438 \u043a\u043b\u044e\u0447\u0430<\/b>. \u041f\u043e\u0437\u0438\u0446\u0438\u0438 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u0432 \u0441\u0442\u0440\u043e\u043a\u0435 \u043a\u043b\u044e\u0447\u0435\u0439 \u0431\u0443\u0434\u0443\u0442 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u044b \u0432 <code>match<\/code>-\u043c\u0430\u0441\u0441\u0438\u0432\u0435 <code>undefined<\/code>:<\/p>\n<pre><code class=\"javascript\">const buffersRE = \/^Buffers:(?:,? shared(?: hit=(\\d+))?(?: read=(\\d+))?(?: dirtied=(\\d+))?(?: written=(\\d+))?)?(?:,? local(?: hit=(\\d+))?(?: read=(\\d+))?(?: dirtied=(\\d+))?(?: written=(\\d+))?)?(?:,? temp(?: read=(\\d+))?(?: written=(\\d+))?)?$\/;  const buffersKeys = ['shared-hit', 'shared-read', 'shared-dirtied', 'shared-written', 'local-hit', 'local-read', 'local-dirtied', 'local-written', 'temp-read', 'temp-written'];  const parseBuffers = line =&gt;    line.match(buffersRE)     .slice(1) \/\/ \u0432 match[0] \u043b\u0435\u0436\u0438\u0442 \u0438\u0441\u0445\u043e\u0434\u043d\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043d\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u0430     .reduce(       (rv, val, idx) =&gt; (val !== undefined &amp;&amp; (rv[buffersKeys[idx]] = Number(val)), rv)     , {}     ); <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"plaintext\">Time, avg: 111ms Size Delta: +8.5MB <\/code><\/pre>\n<p>  \u041d\u0430\u0431\u043b\u044e\u0434\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044c \u0441\u0440\u0430\u0437\u0443 \u0436\u0435 \u0437\u0430\u0434\u0430\u0441\u0442 \u0432\u043e\u043f\u0440\u043e\u0441 \u2014 \u0440\u0430\u0437\u0432\u0435 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0431\u044b\u0441\u0442\u0440\u0435\u0435, \u0435\u0441\u043b\u0438 <b>\u0443\u0431\u0440\u0430\u0442\u044c \u0438\u0437 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043a\u0438 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u043d\u043e\u0435 \u043d\u0430\u0447\u0430\u043b\u043e<\/b> <code>'^Buffers:'<\/code>:<\/p>\n<pre><code class=\"javascript\">const buffersRE = \/(?:,? shared(?: hit=(\\d+))?(?: read=(\\d+))?(?: dirtied=(\\d+))?(?: written=(\\d+))?)?(?:,? local(?: hit=(\\d+))?(?: read=(\\d+))?(?: dirtied=(\\d+))?(?: written=(\\d+))?)?(?:,? temp(?: read=(\\d+))?(?: written=(\\d+))?)?$\/;<\/code><\/pre>\n<p>  \u0412\u0435\u0434\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043e\u0442 \u044d\u0442\u043e\u0433\u043e \u043d\u0435 \u0434\u043e\u043b\u0436\u0435\u043d \u043d\u0438\u043a\u0430\u043a \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c\u0441\u044f? \u041d\u043e \u2014 \u043d\u0435\u0442, <b>\u0442\u0430\u043a\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043d\u0430 \u0447\u0435\u0442\u0432\u0435\u0440\u0442\u044c \u0445\u0443\u0436\u0435<\/b>:<\/p>\n<pre><code class=\"plaintext\">Time, avg: 140ms<\/code><\/pre>\n<p>  \u0414\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043d\u0430\u0448 \u00ab\u043f\u043e\u043b\u043d\u044b\u0439\u00bb RegExp <code>\/^...$\/<\/code> \u043d\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043d\u0438 \u043e\u0434\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u0438, \u0430 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u00ab\u0431\u0435\u0437 \u043d\u0430\u0447\u0430\u043b\u0430\u00bb \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u043f\u043e\u0437\u0438\u0446\u0438\u0438 \u044d\u0442\u043e\u0433\u043e \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u0430 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c, \u043d\u0435 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u043b\u0438 \u0442\u0443\u0442 \u043e\u0434\u0438\u043d \u0438\u0437 \u00ab\u0445\u0432\u043e\u0441\u0442\u043e\u0432\u00bb <code>(shared ...|local ...|temp ...)<\/code> \u2014 \u0447\u0442\u043e \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432, \u0447\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u043f\u0443\u0441\u0442\u0443\u044e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0435 \u0434\u0432\u0443\u0445 \u043f\u043e\u0434\u0441\u0442\u0440\u043e\u043a.<\/p>\n<h2>\u0412\u043d\u0435 \u043a\u043e\u043d\u043a\u0443\u0440\u0441\u0430: \u0441\u043a\u0440\u0435\u0449\u0438\u0432\u0430\u0435\u043c \u0443\u0436\u0430 \u0438 \u0435\u0436\u0430<\/h2>\n<p>  \u0412 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0435 \u043c\u044b \u0432\u0441\u0435-\u0442\u0430\u043a\u0438 \u0432\u043d\u0435\u0441\u043b\u0438 \u043d\u0430\u0447\u0430\u043b\u043e \u0441\u0442\u0440\u043e\u043a\u0438 \u0432 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043a\u0443, \u0438 \u043e\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437! \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0436\u0435 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u043c\u0435\u0442\u043e\u0434\u043e\u043c \u0441 <code>.lastIndex<\/code>:<\/p>\n<ul>\n<li>\u043d\u043e \u043e\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u00ab\u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u043c\u0438\u00bb RegExp<\/li>\n<li>\u0434\u043b\u044f \u00ab\u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0433\u043e\u00bb RegExp \u043e\u0431\u044b\u0447\u043d\u044b\u0439 <code>.match<\/code> \u0437\u0430\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0441\u0440\u0430\u0437\u0443 \u0432\u0441\u044e \u0441\u0442\u0440\u043e\u043a\u0443, \u0430 \u043d\u0435 \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u043d\u043e<\/li>\n<li>\u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u043d\u0430\u0431\u043e\u0440\u0430 \u043d\u0430\u043c \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0435\u0440\u0432\u044b\u0439 (\u0430 \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439) \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0438\u0442\u0435\u0440\u0430\u0442\u043e\u0440\u0430 <code>.matchAll<\/code><\/li>\n<\/ul>\n<p>  <\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/7k\/4p\/8i\/7k4p8ixjqso58pf6nsxbcjd2oq8.png\"><\/div>\n<p>  <\/p>\n<pre><code class=\"javascript\">const buffersRE = \/(?:,? shared(?: hit=(\\d+))?(?: read=(\\d+))?(?: dirtied=(\\d+))?(?: written=(\\d+))?)?(?:,? local(?: hit=(\\d+))?(?: read=(\\d+))?(?: dirtied=(\\d+))?(?: written=(\\d+))?)?(?:,? temp(?: read=(\\d+))?(?: written=(\\d+))?)?$\/g;  const buffersKeys = ['shared-hit', 'shared-read', 'shared-dirtied', 'shared-written', 'local-hit', 'local-read', 'local-dirtied', 'local-written', 'temp-read', 'temp-written'];  const parseBuffers = line =&gt; {   buffersRE.lastIndex = 8; \/\/ 'Buffers:'.length   return line.matchAll(buffersRE).next().value     .slice(1)     .reduce(       (rv, val, idx) =&gt; (val !== undefined &amp;&amp; (rv[buffersKeys[idx]] = Number(val)), rv)     , {}     ); }; <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"plaintext\">Time, avg: 304ms Size Delta: +8.5MB <\/code><\/pre>\n<p>  \u0422\u043e \u0435\u0441\u0442\u044c \u043d\u0430\u0448 \u0441\u0442\u0440\u0430\u043d\u043d\u044b\u0439 \u0433\u0438\u0431\u0440\u0438\u0434 \u043f\u043e \u043f\u0430\u043c\u044f\u0442\u0438 \u043d\u0438\u043a\u0430\u043a\u043e\u0433\u043e \u0432\u044b\u0438\u0433\u0440\u044b\u0448\u0430 \u043d\u0435 \u0434\u0430\u043b, \u0430 \u043f\u043e \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u043f\u0440\u043e\u0438\u0433\u0440\u0430\u043b \u043e\u0431\u043e\u0438\u043c \u0441\u0432\u043e\u0438\u043c \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044f\u043c.<\/p>\n<h2><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/0x\/wb\/xe\/0xwbxeq_hvug-2gtvzw7osgoyd8.png\"> \u0418\u0442\u043e\u0433\u043e<\/h2>\n<p>  \u0412 \u0441\u0435\u0433\u043e\u0434\u043d\u044f\u0448\u043d\u0435\u043c \u0437\u0430\u0431\u0435\u0433\u0435 \u043a\u0443\u0431\u043e\u043a \u0432\u0440\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0431\u044b\u0447\u043d\u043e\u043c\u0443 \u043f\u043e\u043b\u043d\u043e\u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u043d\u043e\u043c\u0443 <code>.match(RegExp)<\/code>. \u0423\u0440\u0430, \u0442\u043e\u0432\u0430\u0440\u0438\u0449\u0438!  <\/p>\n<div class=\"scrollable-table\">\n<table>\n<tr>\n<td>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/2r\/fp\/ki\/2rfpkijrw4vlhehczu8fuqawsj8.png\"><\/div>\n<\/td>\n<td>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/vf\/p1\/qh\/vfp1qhlxd36-2dazjh8g8sxtdp4.png\" width=\"250\"><\/div>\n<\/td>\n<\/tr>\n<\/table>\n<\/div>\n<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/company\/tensor\/blog\/534340\/\"> https:\/\/habr.com\/ru\/company\/tensor\/blog\/534340\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\">\u0421\u0435\u0433\u043e\u0434\u043d\u044f \u043c\u044b \u043f\u043e\u043c\u0435\u0440\u044f\u0435\u043c\u0441\u044f \u043f\u0430\u0440\u0441\u0435\u0440\u0430\u043c\u0438. \u0422\u043e\u0447\u043d\u0435\u0435, \u043f\u043e\u043c\u0435\u0440\u044f\u0435\u043c \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u0445 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 JavaScript-\u043f\u0430\u0440\u0441\u0435\u0440\u043e\u0432 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043e\u0434\u043d\u043e\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0442\u0440\u043e\u043a\u0438 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0444\u043e\u0440\u043c\u0430\u0442\u0430 \u0432 \u043e\u0431\u044a\u0435\u043a\u0442.<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/s6\/dk\/4z\/s6dk4zwhqda6qg-umi2pu0zpumu.png\"><\/div>\n<p>  \u0412\u043e\u043f\u0440\u043e\u0441\u044b \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u043d\u043e\u0433\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 \u0432 JavaScript \u043e\u0441\u0442\u0430\u0432\u0438\u043c \u0437\u0430 \u0440\u0430\u043c\u043a\u0430\u043c\u0438 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u0438 \u0441\u043e\u0441\u0440\u0435\u0434\u043e\u0442\u043e\u0447\u0438\u043c\u0441\u044f \u043d\u0430 <b>\u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430\u0445 \u0438 \u043c\u0430\u043b\u043e\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0445 \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439<\/b> \u0434\u043b\u044f \u0440\u0430\u0437\u0431\u043e\u0440\u0430 <a href=\"https:\/\/github.com\/postgres\/postgres\/blob\/REL_12_STABLE\/src\/backend\/commands\/explain.c#L2871\">\u0441\u0442\u0440\u043e\u043a\u0438 buffers-\u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430<\/a> \u0443\u0437\u043b\u0430 \u043f\u043b\u0430\u043d\u0430 PostgreSQL.<\/p>\n<p>  \u0422\u043e \u0435\u0441\u0442\u044c \u0438\u0437 \u0441\u0442\u0440\u043e\u043a\u0438 \u0432\u0438\u0434\u0430 <code>'<i><b>Buffers: shared hit=123 read=456, local hit=789<\/b><\/i>'<\/code> \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c JSON \u0442\u0430\u043a\u043e\u0433\u043e \u0444\u043e\u0440\u043c\u0430\u0442\u0430:<\/p>\n<pre><code class=\"json\">{   &quot;shared-hit&quot;  : 123 , &quot;shared-read&quot; : 456 , &quot;local-hit&quot;   : 789 }<\/code><\/pre>\n<p>  \u0412\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0432\u0440\u043e\u0434\u0435 \u0432\u0441\u0435 \u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u043e, \u043f\u0440\u0430\u0432\u0434\u0430 \u0436\u0435?<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/6g\/et\/ly\/6getlyxcjulh9v1nlggc8llndwc.png\"><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-315470","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/315470","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=315470"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/315470\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=315470"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=315470"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=315470"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}