{"id":162885,"date":"2012-12-17T19:28:02","date_gmt":"2012-12-17T15:28:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=162885"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=162885","title":{"rendered":"<span class=\"post_title\">\u0427\u0435\u0440\u043d\u044b\u0435 \u0434\u044b\u0440\u044b \u043f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0412\u0435\u0431 \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/span>"},"content":{"rendered":"<div class=\"content html_format\"> \t\t\t\u0420\u0435\u0447\u044c \u043f\u043e\u0439\u0434\u0435\u0442 \u043e PHP,JavaScript \u0438 MySQL \u043a\u0430\u043a \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u043e\u0439 \u0442\u043e\u0447\u043a\u0435. \u042f \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0443 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0446\u0438\u0444\u0440\u044b \u0442\u0435\u0441\u0442\u043e\u0432 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0438 \u043f\u043e\u0442\u0435\u0440\u0438 \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0443\u0431\u0438\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442, \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u0437 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043d\u0435 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043d\u0435\u0434\u0430\u0432\u043d\u043e \u0432\u0441\u043a\u0440\u044b\u0442\u044c \u043d\u0430 \u043f\u0440\u0435\u0434\u043c\u0435\u0442 \u043f\u043e\u0438\u0441\u043a\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043d\u044b\u0445 \u043c\u0435\u0441\u0442, \u0438 \u043f\u043e\u043a\u0430\u0436\u0443 \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0432 \u0442\u0440\u0438 \u0448\u0430\u0433\u0430 \u0443\u0431\u0438\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442.<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/fbb\/817\/d4f\/fbb817d4f38ac13024eab5e73b880a05.jpg\"\/><\/p>\n<h4>\u041f\u0440\u0435\u0434\u0438\u0441\u043b\u043e\u0432\u0438\u0435.<\/h4>\n<p>  \u041d\u0435\u0434\u0430\u0432\u043d\u043e \u043c\u043d\u0435 \u0431\u044b\u043b\u0430 \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0430 \u0437\u0430\u0434\u0430\u0447\u0430, \u043f\u043e\u043c\u043e\u0447\u044c \u043d\u0430\u0439\u0442\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0432 \u043e\u0434\u043d\u043e\u043c \u0438\u0437 \u0432\u0435\u0431 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0445 \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u043e \u043d\u0430 PHP+MySQL, \u0438 \u0432\u0441\u0435 \u044d\u0442\u043e \u043a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e \u0437\u0430\u0432\u0435\u0440\u043d\u0443\u0442\u043e \u0432 Symfony Framework. \u0411\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u0438\u043b\u044c\u043d\u043e \u0440\u0430\u0441\u0442\u0438, \u0442\u0430\u043a-\u043a\u0430\u043a \u043b\u044e\u0434\u0438 \u0441\u043e\u0431\u0438\u0440\u0430\u043b\u0438 \u044d\u0432\u0435\u043d\u0442\u044b \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f (\u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c \u0430\u0432\u0442\u043e\u043f\u0430\u0440\u043a\u0430) \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u043b\u0438\u0432\u0430\u043b\u0438\u0441\u044c \u0431\u0443\u043a\u0432\u0430\u043b\u044c\u043d\u043e \u043a\u0430\u0436\u0434\u044b\u0435 5 \u043c\u0438\u043d\u0443\u0442. \u0415\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u044d\u0432\u0435\u043d\u0442\u043e\u0432 \u0432\u044b\u0440\u043e\u0441\u043b\u0430, \u0438 \u0434\u0430\u0431\u044b MySQL \u0441 \u043d\u0435\u0439 \u0445\u043e\u0442\u044c \u043a\u0430\u043a \u0442\u043e \u0441\u043f\u0440\u0430\u0432\u043b\u044f\u043b\u0430\u0441\u044c, \u0435\u0435 \u0440\u0430\u0437\u0431\u0438\u043b\u0438 \u043d\u0430 \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u0438. \u0412 \u0438\u0442\u043e\u0433\u0435 \u0432\u0441\u0435 \u044d\u0442\u043e \u0441\u0432\u043e\u0434\u0438\u043b\u043e\u0441\u044c \u043a \u0440\u0430\u0437\u043d\u043e\u0433\u043e \u0440\u043e\u0434\u0430 \u0432\u044b\u0431\u043e\u0440\u043a\u0430\u043c \u0438 \u043e\u0442\u0447\u0435\u0442\u0430\u043c, \u0442.\u0435. \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0435. \u0412 \u0438\u0442\u043e\u0433\u0435, \u0434\u0430\u0436\u0435 \u043f\u0440\u043e\u0441\u0442\u0430\u044f \u0432\u044b\u0431\u043e\u0440\u043a\u0430 \u0437\u0430 \u043f\u0435\u0440\u0438\u043e\u0434, \u043f\u043b\u044e\u0441 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043f\u043e\u0434\u0441\u0447\u0435\u0442, \u0437\u0430\u043d\u0438\u043c\u0430\u043b\u0438 \u043e\u0442 11 \u0441\u0435\u043a \u0438 \u0432\u044b\u0448\u0435. \u0412\u0438\u0434\u0438\u043c\u043e \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0438 \u0431\u044b\u043b\u043e \u043f\u0440\u0438\u043d\u044f\u0442\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435, \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u0442\u044c \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c\u044b\u0439 \u043f\u0435\u0440\u0438\u043e\u0434 \u0432 \u0434\u043d\u044f\u0445.<\/p>\n<p>  <a name=\"habracut\"><\/a><\/p>\n<p>  \u0418 \u0442\u0430\u043a \u043f\u043e\u0435\u0445\u0430\u043b\u0438:<\/p>\n<h4>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 1 \u2013 \u0411\u0430\u0437\u0430<\/h4>\n<p>  \u0411\u0430\u0437\u0430 \u0431\u044b\u043b\u0430 \u0432\u044b\u0431\u0440\u0430\u043d\u0430 MySQL. \u0412\u0438\u0434\u0438\u043c\u043e \u0442\u043e, \u0447\u0442\u043e \u043e\u043d\u0430 \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u0430, \u043f\u043e\u0434\u043a\u0443\u043f\u0430\u0435\u0442 \u0432\u0441\u0435\u0445. \u041d\u043e \u0432\u043e\u0442 \u0432\u0435\u0448\u0430\u0442\u044c \u043d\u0430 \u044d\u0442\u0443 \u0431\u0430\u0437\u0443 \u0442\u0440\u0435\u0442\u044c\u0435\u0433\u043e \u044d\u0448\u0435\u043b\u043e\u043d\u0430, \u0442\u044f\u0436\u0435\u043b\u0443\u044e \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0443, \u0441\u0447\u0438\u0442\u0430\u044e \u043f\u0435\u0440\u0432\u043e\u0439 \u043e\u0448\u0438\u0431\u043a\u043e\u0439 \u0438 \u0441\u0430\u043c\u043e\u0439 \u0433\u043b\u0430\u0432\u043d\u043e\u0439. \u041d\u0430 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0432 <b>700K<\/b> \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u044d\u0432\u0435\u043d\u0442\u043e\u0432, \u0432\u044b\u0431\u043e\u0440\u043a\u0430 \u0437\u0430 \u043f\u0435\u0440\u0438\u043e\u0434 \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u0430\u043b\u0430 \u0434\u043e <b>30 \u0441\u0435\u043a<\/b>. \u0412\u0441\u044f \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u043b\u0430\u0441\u044c \u0432 \u0434\u0430\u043d\u043d\u044b\u0445. \u0422\u0430\u0431\u043b\u0438\u0446\u0430 events \u0438\u043c\u0435\u043b\u0430 \u0437\u0430\u043f\u0438\u0441\u044c \u201c\u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0440\u0430\u0437\u043d\u043e\u0433\u043e \u0442\u0438\u043f\u0430\u201d \u0441\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e\u043c ON \u0438\u043b\u0438 OFF, \u0442.\u0435. \u043d\u0430\u0447\u0430\u043b\u043e \u0438 \u043a\u043e\u043d\u0435\u0446 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u044d\u0432\u0435\u043d\u0442\u0430. \u0412\u0441\u0435 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0442\u0430\u043a\u0438 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e, \u0438 \u043b\u044e\u0431\u043e\u0439 \u0431\u044b \u0441 \u043b\u0435\u0433\u043a\u043e\u0441\u0442\u044c\u044e \u0441\u0434\u0435\u043b\u0430\u043b \u0432\u044b\u0431\u043e\u0440\u043a\u0443:<\/p>\n<pre><code class=\"sql\">SELECT     ev1.event_point,ev1.event_date,             (select event_date from test_events                         where ev1.event_point = event_point                         and event_type = (CASE WHEN ev1.event_type = 1 THEN 2 ELSE 1 END)                         and event_date &gt; ev1.event_date limit 1) as end_date FROM test_events as ev1 WHERE     ev1.event_date BETWEEN '2012-1-1' AND '2012-1-31' AND ev1.event_type IN (1 , 2) <\/code><\/pre>\n<p>  \u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0438 \u0442\u0435\u0441\u0442\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f \u043e\u0434\u0438\u043d \u0442\u0438\u043f \u0441\u043e\u0431\u044b\u0442\u0438\u044f 1 \u043d\u0430\u0447\u0430\u043b\u043e \u0438 2 \u043a\u043e\u043d\u0435\u0446, \u0445\u043e\u0442\u044f \u0432 \u0431\u0430\u0437\u0435 \u0438\u0445 \u043f\u043e\u0440\u044f\u0434\u043a\u0430 40 \u043f\u0430\u0440. \u0412 \u0438\u0442\u043e\u0433\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u044b\u0431\u043e\u0440 \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u0437\u0430 \u043f\u0435\u0440\u0438\u043e\u0434, \u0441 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u0441\u0440\u0430\u0437\u0443 \u043a\u043e\u043d\u0446\u0430 \u044d\u0442\u043e\u0433\u043e \u0441\u043e\u0431\u044b\u0442\u0438\u044f, \u0437\u0430\u0431\u0438\u0440\u0430\u0435\u0442 \u0443 MySQL \u043f\u043e\u0440\u044f\u0434\u043a\u0430 <b>20-30 \u0441\u0435\u043a<\/b>.<br \/>  \u0414\u043b\u044f \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f, \u0431\u044b\u043b\u0430 \u0432\u0437\u044f\u0442\u0430 \u0442\u0430\u043a\u0436\u0435 \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u0430\u044f \u0431\u0430\u0437\u0430, SQL Server 2008 \u0432 \u0440\u0435\u0434\u0430\u043a\u0446\u0438\u0438 Web, \u0432\u0441\u0435 \u044d\u0442\u043e \u0431\u044b\u043b\u043e \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043e \u043d\u0430 MS Server 2008 R2 \u043d\u0430 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0440\u0435\u0434\u0435 VirtualB\u043ex. \u0421\u043a\u0430\u0436\u0443 \u0441\u0440\u0430\u0437\u0443 \u0447\u0442\u043e Web \u0440\u0435\u0434\u0430\u043a\u0446\u0438\u044f \u0445\u043e\u0442\u044c \u0438 \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u0430, \u043d\u043e \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u0440\u044f\u0434\u0430 \u0432\u0430\u0436\u043d\u044b\u0445 \u043e\u043f\u0446\u0438\u0439, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0432\u0430\u0436\u043d\u044b\u0445 \u0434\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u043d\u0435\u0442 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u043a\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f View \u0438 Procedure.<br \/>  \u0412\u0441\u0435 \u0442\u0435\u0441\u0442\u044b \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0438 \u0447\u0442\u043e MS SQL \u0441 \u043b\u0435\u0433\u043a\u043e\u0441\u0442\u044c\u044e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441 \u043c\u0435\u043d\u0435\u0435 \u0447\u0435\u043c \u0437\u0430 <b>1 \u0441\u0435\u043a <\/b>\u043f\u0440\u0438 <b>1\u041a\u041a<\/b> \u0434\u0430\u043d\u043d\u044b\u0445.<br \/>  \u0414\u0430\u043b\u0435\u0435 \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043f\u043e\u0434\u0441\u0447\u0435\u0442 \u0438 \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0437\u0430\u043d\u0438\u043c\u0430\u043b\u0438 \u0442\u0435 \u0438\u043b\u0438 \u0438\u043d\u044b\u0435 \u0442\u0438\u043f\u044b \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u0437\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u043a\u0443\u0441\u043e\u043a \u0432\u0440\u0435\u043c\u0435\u043d\u0438. \u0422\u0430\u043a\u043e\u0435 \u043f\u043e\u0434\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 SQL \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043d\u0435 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u0438\u043a\u0430\u043a\u043e\u0433\u043e \u0442\u0440\u0443\u0434\u0430, \u043d\u0430\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u043c \u0441\u0432\u0435\u0440\u0445\u0443 \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u043e\u0442\u0447\u0435\u0442:<\/p>\n<pre><code class=\"sql\">SELECT event_point,SUM(TIMESTAMPDIFF(HOUR,event_date,end_date)) FROM ( SELECT     ev1.event_point,ev1.event_date,             (select event_date from test_events                         where ev1.event_point = event_point                         and event_type = (CASE WHEN ev1.event_type = 1 THEN 2 ELSE 1 END)                         and event_id &gt; ev1.event_id limit 1) as end_date FROM test_events as ev1 WHERE     ev1.event_date BETWEEN '2012-1-1' AND '2012-1-31' AND ev1.event_type IN (1 , 2) ) report GROUP BY event_point <\/code><\/pre>\n<p>  \u0412\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u043d\u0430 \u0442\u043e\u0439 \u0436\u0435 MS SQL \u0431\u0430\u0437\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043c\u0433\u043d\u043e\u0432\u0435\u043d\u043d\u043e, \u043c\u0435\u043d\u0435\u0435 \u0447\u0435\u043c \u0437\u0430 1 \u0441\u0435\u043a. \u0410 \u0432\u043e\u0442 \u0441 MySQL \u043c\u043e\u0436\u043d\u043e \u0438 \u043d\u0435 \u0434\u043e\u0436\u0434\u0430\u0442\u044c\u0441\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430, \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u044f \u043f\u0435\u0440\u0438\u043e\u0434, \u0431\u0430\u0437\u0430 \u043b\u043e\u0436\u0438\u043b\u0430\u0441\u044c \u043d\u0430\u043c\u0435\u0440\u0442\u0432\u043e. \u0412\u0438\u0434\u0438\u043c\u043e \u0442\u0435, \u043a\u0442\u043e \u0441\u043e\u0431\u0438\u0440\u0430\u043b \u043f\u0440\u043e\u0435\u043a\u0442, \u044d\u0442\u043e \u043f\u043e\u043d\u044f\u043b\u0438 \u0438 \u0440\u0435\u0448\u0438\u043b\u0438 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043d\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0432\u044b\u0431\u043e\u0440\u043a\u0438 \u043f\u0440\u044f\u043c\u043e \u0432 PHP. \u0418 \u0434\u0430\u0431\u044b \u043d\u0435 \u0442\u0435\u0440\u044f\u0442\u044c \u0432\u0441\u0435 \u0442\u0430\u043a\u0436\u0435 20-30 \u0441\u0435\u043a \u043d\u0430 JOIN, \u0431\u044b\u043b\u043e \u0440\u0435\u0448\u0435\u043d\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 SELECT \u0437\u0430 \u043f\u0435\u0440\u0438\u043e\u0434, \u0437\u0430\u043a\u0438\u043d\u0443\u0442\u044c \u0432\u0441\u0435 \u0432 Array \u0438 \u0442\u0430\u043c \u0443\u0436\u0435 \u043f\u0440\u043e\u0431\u0435\u0436\u043a\u043e\u0439 \u043d\u0430\u0439\u0442\u0438 \u043d\u0430\u0447\u0430\u043b\u043e \u0438 \u043a\u043e\u043d\u0435\u0446 \u0438 \u043f\u043e\u0442\u043e\u043c \u0441 \u043b\u0435\u0433\u043a\u043e\u0441\u0442\u044c\u044e \u0432\u044b\u0434\u0430\u0442\u044c \u0441\u0443\u043c\u043c\u044b. \u0427\u0442\u043e \u0438 \u0431\u044b\u043b\u043e \u0441\u0434\u0435\u043b\u0430\u043d\u043e, \u0432 \u0438\u0442\u043e\u0433\u0435 \u044f \u0441\u043d\u043e\u0432\u0430 \u043f\u0440\u0438\u0448\u0435\u043b \u0442\u0443\u043f\u0438\u043a, \u0440\u043e\u0441\u0442 \u043f\u0435\u0440\u0438\u043e\u0434\u0430 \u043d\u0430\u0447\u0438\u043d\u0430\u043b \u0437\u0430\u0431\u0438\u0440\u0430\u0442\u044c \u0434\u043e 1 \u043c\u0438\u043d. \u043d\u0430 \u0440\u0430\u0441\u0447\u0435\u0442. \u0418 \u044f \u043d\u0430\u0447\u0430\u043b \u0438\u0437\u0443\u0447\u0430\u0442\u044c \u0432\u0442\u043e\u0440\u0443\u044e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443, \u043f\u044b\u0442\u0430\u044f\u0441\u044c \u043f\u043e\u043d\u044f\u0442\u044c, \u043f\u043e\u0447\u0435\u043c\u0443 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0440\u043e\u0433\u043e\u043d \u043f\u043e Array \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u0442\u0430\u043a\u043e\u0435 \u043e\u0433\u0440\u043e\u043c\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f. \u042f \u043d\u0430\u0434\u0435\u044f\u043b\u0441\u044f \u0447\u0442\u043e \u0442\u0430\u043c \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u043f\u0435\u0447\u0430\u0442\u043a\u0430 \u0438\u043b\u0438 \u043e\u0448\u0438\u0431\u043a\u0430, \u043d\u043e \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0447\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0440\u043e\u0431\u0435\u0436\u043a\u0430 \u043f\u043e Array \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u043e\u0433\u0440\u043e\u043c\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f. \u0412\u043e\u0442 \u0438 \u0432\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430.<\/p>\n<h4>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 2 \u2013 Array \u0432 PHP<\/h4>\n<p>  \u0418\u0437\u0443\u0447\u0438\u0432 \u0432\u0441\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u044f \u043f\u043e\u043d\u044f\u043b, \u0447\u0442\u043e PHP \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0441\u0442\u0440\u043e \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u044b. \u041f\u043e\u0447\u0438\u0442\u0430\u0432 \u043d\u0430 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0444\u043e\u0440\u0443\u043c\u0430\u0445, \u044f \u0443\u0432\u0438\u0434\u0435\u043b \u043e\u0431\u0441\u0443\u0436\u0434\u0435\u043d\u0438\u044f, \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u044e\u0449\u0438\u0435 \u044d\u0442\u0443 \u0432\u0435\u0440\u0441\u0438\u044e. \u042d\u0442\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 PHP. \u0411\u044b\u043b\u043e \u0440\u0435\u0448\u0435\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0442\u0435\u0441\u0442 \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0444\u0430\u043a\u0442\u043e\u0432.<\/p>\n<pre><code class=\"php\">&lt;?php $summary[] = array(); $count = 5000; for($i1=0;$i1&lt;$count;++$i1){             $summary[$i1] = $i1; }  $t = microtime(true);  for($i1=0;$i1&lt;$count;++$i1){             for($i2=0;$i2&lt;$count;++$i2){                         if(&quot;5468735354987&quot;!=&quot;654654655465&quot;){                                    $summary[$i1] = $i1*$i2;                         }             } }  echo &quot;&lt;li&gt;time: &quot;.(microtime(true)-$t).' ms&lt;\/li&gt;';  $sum = 0; for($i1=0;$i1&lt;$count;++$i1){             $sum = $sum + $summary[$i1]; } echo &quot;&lt;li&gt;test[&quot;+$sum+&quot;]&quot;; ?&gt; <\/code><\/pre>\n<p>  \u041a\u043e\u0434 \u0431\u044b\u043b \u0441\u043e\u0437\u0434\u0430\u043d \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0442\u0435\u0441\u0442\u0435 \u0438\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u0431\u043e\u0440 5000*5000 = 25\u041a\u041a \u0446\u0438\u043a\u043b\u043e\u0432, \u043f\u0440\u0438\u0447\u0435\u043c \u0434\u0430\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u043e\u0441\u044c ++$i \u0432\u043c\u0435\u0441\u0442\u043e $i++ \u0434\u043b\u044f \u043f\u043e\u0434\u043d\u044f\u0442\u0438\u044f \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438. \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0434\u0430\u043d\u043d\u044b\u0439 \u0442\u0435\u0441\u0442 \u0432\u044b\u0434\u0430\u043b <b>11 \u0441\u0435\u043a<\/b>. \u041f\u043e\u043f\u044b\u0442\u043a\u0430 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u043a\u043e\u0434 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0440\u044f\u043c\u043e \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u0431\u0435\u0437 \u0412\u0435\u0431 \u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u0432\u044b\u0434\u0430\u043b\u043e \u043c\u043d\u0435 <b>10 \u0441\u0435\u043a<\/b>. \u0418 \u044d\u0442\u043e \u0432\u0441\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u043b\u043e\u0441\u044c \u043d\u0430 \u043c\u043e\u0435\u043c \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0435 \u0430 \u043d\u0435 \u043d\u0430 \u0445\u043e\u0441\u0442\u0435 \u0438\u043b\u0438 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u043c \u043c\u0430\u0448\u0438\u043d\u0435, \u0438 \u0432\u0441\u0435 \u043f\u0440\u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438: Intel Core i5, 8GB. PHP 5.3.9<br \/>  \u041f\u043e\u043d\u0438\u043c\u0430\u044f \u0447\u0442\u043e \u0434\u043b\u044f PHP \u044d\u0442\u043e \u043f\u0440\u0435\u0434\u0435\u043b \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0436\u0430\u0442\u044c, \u044f \u0440\u0435\u0448\u0438\u043b \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u043a\u043e\u0434 \u043d\u0430 \u0434\u0440\u0443\u0433\u0438\u0445 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430\u0445, \u0438\u043c\u0435\u044f \u043f\u043e\u0434 \u0440\u0443\u043a\u043e\u0439 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u0443\u044e \u043c\u0430\u0448\u0438\u043d\u0443 c MS Server 2008 R2. \u041a\u043e\u0434 \u0442\u0435\u0441\u0442\u0430 \u0431\u044b\u043b \u043b\u0435\u0433\u043a\u043e \u043f\u0435\u0440\u0435\u043a\u0438\u043d\u0443\u0442 \u0432 ASP, ASPX, WSC,VBS \u0430 \u0442\u0430\u043a\u0436\u0435 NodeJS. \u0412 \u0438\u0442\u043e\u0433\u0435 \u044f \u043f\u043e\u043b\u0443\u0447\u0438\u043b \u0442\u0430\u043a\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435:<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/9d1\/b6c\/347\/9d1b6c3472f562848d4ce6fe76629e5c.jpg\" alt=\"image\"\/><\/p>\n<p>  \u041d\u0430 \u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442\u0435 \u043c\u044b \u0432\u0438\u0434\u0438\u043c \u0442\u0440\u0438 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430 \u0442\u0435\u0441\u0442\u0430. 1) \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u0430\u044f \u043c\u0430\u0448\u0438\u043d\u0430 2) \u043c\u043e\u0439 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440 3) \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 \u043c\u043d\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0435.<\/p>\n<p>  1. PHP \u043d\u0430 \u0443\u0434\u0438\u0432\u043b\u0435\u043d\u0438\u0435 \u0432\u044b\u0434\u0430\u043b \u043e\u0447\u0435\u043d\u044c \u0431\u043b\u0438\u0437\u043a\u0438\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b, \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u044f \u0447\u0442\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u043b\u043e\u0441\u044c \u0432\u0441\u0435 \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u043d\u0430 \u0440\u0430\u0437\u043d\u044b\u0445 \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u0445 \u0438 \u043c\u043e\u0449\u043d\u043e\u0441\u0442\u044f\u0445.<br \/>  2. ASP \u0431\u043b\u0438\u0437\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u043e\u0433 PHP \u0432\u044b\u0434\u0430\u043b \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0445\u0443\u0436\u0435, \u043f\u0440\u0438\u0447\u0435\u043c \u044d\u0442\u043e \u0435\u0449\u0435 \u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u043c\u043e\u0449\u043d\u043e\u0441\u0442\u0435\u0439 \u0441\u0440\u0435\u0434\u044b.<br \/>  3. WCS \u0441\u0438\u043b\u044c\u043d\u043e \u0440\u0430\u0437\u043e\u0447\u0430\u0440\u043e\u0432\u0430\u043b, \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u044f \u0447\u0442\u043e Microsoft \u0435\u0433\u043e \u0432 \u0441\u0432\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u043b \u043a\u0430\u043a \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u043c\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 ASP, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u043e\u043b\u0436\u0435\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0431\u044b\u0441\u0442\u0440\u0435\u0435, \u0447\u0442\u043e \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u043d\u0435 \u0442\u0430\u043a.<br \/>  4. VBS \u044d\u0442\u043e \u0447\u0438\u0441\u0442\u043e \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0441\u043a\u0440\u0438\u043f\u0442\u0430, \u0445\u043e\u0442\u044c \u043e\u043d \u0438 \u043f\u043e\u043a\u0430\u0437\u0430\u043b \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043b\u0443\u0447\u0448\u0435 \u0447\u0435\u043c PHP, \u043d\u043e \u0434\u043b\u044f \u0432\u0435\u0431 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043e\u043d \u043d\u0435\u043f\u0440\u0438\u0435\u043c\u043b\u0435\u043c.<br \/>  5. ASPX \u043f\u043e\u043a\u0430\u0437\u0430\u043b \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0442\u043b\u0438\u0447\u043d\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442. \u0422\u0443\u0442 \u044f \u043d\u0435 \u0443\u0434\u0438\u0432\u043b\u0435\u043d, \u0432\u0441\u0435 \u0442\u0430\u043a\u0438 \u044d\u0442\u043e C#<br \/>  6. NodeJS \u0442\u0430\u043a\u0436\u0435 \u0432\u044b\u0434\u0430\u043b, \u043a\u0430\u043a \u0438 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u043b\u043e\u0441\u044c, \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0442\u043b\u0438\u0447\u043d\u044b\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438.<\/p>\n<p>  \u0412\u043e\u0442 \u0432\u0441\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">test.php<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"php\">&lt;?php $summary[] = array(); $count = 5000; for($i1=0;$i1&lt;$count;++$i1){ \t$summary[$i1] = $i1; }  $t = microtime(true);  for($i1=0;$i1&lt;$count;++$i1){ \tfor($i2=0;$i2&lt;$count;++$i2){ \t\tif(&quot;5468735354987&quot;!=&quot;654654655465&quot;){ \t\t\t$summary[$i1] = $i1*$i2; \t\t} \t} }  echo &quot;&lt;li&gt;time: &quot;.(microtime(true)-$t).' ms&lt;\/li&gt;';  $sum = 0; for($i1=0;$i1&lt;$count;++$i1){ \t$sum = $sum + $summary[$i1]; } echo &quot;&lt;li&gt;test[&quot;+$sum+&quot;]&quot;; ?&gt; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">test.asp<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"vbscript\">&lt;% count = 5000 Dim summary(5000) for i1=0 to count \tsummary(i1) = i1 next  t = timer()  for i1=0 to count \tfor i2=0 to count \t\tif (&quot;5468735354987&quot;&lt;&gt;&quot;654654655465&quot;) then \t\t\tsummary(i1) = i1*i2 \t\tend if \tnext next  response.write timer()-t  sum = 0 for i1=0 to count \tsum = sum + summary(i1) next response.write  &quot;sum:&quot;&sum  response.write  &quot;&lt;br&gt;test-wsc&lt;br&gt;&quot;  Dim obj  Set obj = GetObject(&quot;script:&quot;&Server.MapPath(&quot;test.wsc&quot;)) Call obj.run() %&gt; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">test.wsc<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"vbscript\">&lt;?xml version=&quot;1.0&quot;?&gt; &lt;component&gt;  &lt;?component error=&quot;true&quot; debug=&quot;true&quot;?&gt;  &lt;registration \tdescription=&quot;test&quot; \tprogid=&quot;test&quot; \tversion=&quot;0.1&quot; \tclassid=&quot;{13e4b1b3-c698-40ea-8450-9cbc9b33ef03}&quot; &gt; &lt;\/registration&gt;  &lt;public&gt; \t&lt;method name=&quot;run&quot;\/&gt; &lt;\/public&gt;  &lt;implements type=&quot;ASP&quot; id=&quot;ASP&quot;\/&gt;  &lt;script language=&quot;VBScript&quot;&gt; &lt;![CDATA[  Function run() \tcount = 5000 \tDim summary(5000) \tfor i1=0 to count \t\tsummary(i1) = i1 \tnext  \tDim t : t = timer()  \tfor i1=0 to count \t\tfor i2=0 to count \t\t\tif (&quot;5468735354987&quot;&lt;&gt;&quot;654654655465&quot;) then \t\t\t\tsummary(i1) = i1*i2 \t\t\tend if \t\tnext \tnext  \tresponse.write (timer()-t)  \tsum = 0 \tfor i1=0 to count \t\tsum = sum + summary(i1) \tnext \tresponse.write  &quot;sum:&quot;&sum End Function  ]]&gt; &lt;\/script&gt; &lt;\/component&gt; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">test.vbs<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"vbscript\"> count = 5000 Dim summary(5000) for i1=0 to count \tsummary(i1) = i1 next  t = timer()  for i1=0 to count \tfor i2=0 to count \t\tif (&quot;5468735354987&quot;&lt;&gt;&quot;654654655465&quot;) then \t\t\tsummary(i1) = i1*i2 \t\tend if \tnext next  msgbox (timer()-t)   sum = 0 for i1=0 to count \tsum = sum + summary(i1) next msgbox &quot;sum:&quot;&sum <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">test.aspx<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cs\">&lt;%@ Page validateRequest=&quot;false&quot; Debug=&quot;true&quot; %&gt; &lt;%@ Import Namespace=&quot;System.IO&quot; %&gt; &lt;%@ Import Namespace=&quot;System.Data&quot; %&gt; &lt;%@ Import Namespace=&quot;System.Diagnostics&quot; %&gt; &lt;%@ Import Namespace=&quot;System.Threading&quot; %&gt;  &lt;script language=&quot;C#&quot; runat=&quot;server&quot;&gt; \tpublic void Page_Load(Object sender, EventArgs E) \t{ \t\tint count = 5000; \t\tint[] summary = new int[5000];         for (int i1 = 0; i1 &lt; count; i1++)         {             summary[i1] = i1;         }          Stopwatch stopwatch = new Stopwatch();         stopwatch.Start();                  for (int i1 = 0; i1 &lt; count; ++i1)         {             for (int i2 = 0; i2 &lt; count; ++i2)             { \t\t        if(&quot;5468735354987&quot;!=&quot;654654655465&quot;){ \t\t\t        summary[i1] = i1*i2;                 } \t        }         }                  stopwatch.Stop();         Response.Write(&quot;&lt;li&gt;time: &quot; + (stopwatch.ElapsedMilliseconds) + &quot; ms&lt;\/li&gt;&quot;);          long sum = 0;         for (int i1 = 0; i1 &lt; count; ++i1)         { \t        sum = sum + summary[i1];         }         Response.Write(&quot;&lt;li&gt;test[&quot; + sum + &quot;]&quot;); \t} &lt;\/script&gt;  <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">test_nodejs.js<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"javascript\">var fs = require('fs'), \thttp = require('http');  http.createServer(function (req, res) { \tres.writeHead(200, {'Content-Type': 'text\/html'}); \t \tsummary = new Array(); \tcount = 5000; \tfor(var i1=0;i1&lt;count;++i1){ \t\tsummary[i1] = i1; \t} \tvar start = new Date().getTime(); \tfor(var i1=0;i1&lt;count;++i1){ \t\tfor(var i2=0;i2&lt;count;++i2){ \t\t\tif(&quot;5468735354987&quot;!=&quot;654654655465&quot;){ \t\t\t\tsummary[i1] = i1*i2; \t\t\t} \t\t} \t} \tres.write(&quot;&lt;li&gt;time: &quot;+(new Date().getTime() - start)+&quot; ms&quot;); \tvar sum = 0; \tfor(i1=0;i1&lt;count;++i1){ \t\tsum = sum + summary[i1]; \t} \tres.write(&quot;&lt;li&gt;sum: [&quot;+sum+&quot;]&quot;); \tres.end(); \t }).listen(1337, '127.0.0.1');  console.log('Server running at http:\/\/127.0.0.1:1337\/'); <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0438 \u043d\u0430 \u043c\u044b\u0441\u043b\u044c, \u0447\u0442\u043e JavaScript \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u0435\u043d ASPX \u0438 NodeJS, \u043f\u043e\u0442\u043e\u043c\u0443 \u0431\u044b\u043b\u043e \u0440\u0435\u0448\u0435\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0442\u043e\u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435. \u0421\u043d\u043e\u0432\u0430 \u043a\u043e\u0434 \u043c\u0433\u043d\u043e\u0432\u0435\u043d\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0435\u043b\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u0435\u0441\u0442 \u043f\u043e\u0434 HTML \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"html\">&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; \t&lt;script&gt; \tfunction testClear() \t{ \t\tvar summary = []; \t\tvar count = 5000; \t\tfor(var i1=0;i1&lt;count;++i1){ \t\t\tsummary[i1] = i1; \t\t} \t\tvar start = new Date().getTime(); \t\tfor(var i1=0;i1&lt;count;++i1){ \t\t\tfor(var i2=0;i2&lt;count;++i2){ \t\t\t\tif(&quot;5468735354987&quot;!==&quot;654654655465&quot;){ \t\t\t\t\tsummary[i1] = i1*i2; \t\t\t\t} \t\t\t} \t\t} \t\tdocument.getElementById(&quot;testClear&quot;).innerHTML = &quot;time: &quot;+(new Date().getTime() - start)+&quot; ms&quot;; \t\tvar sum = 0; \t\tfor(i1=0;i1&lt;count;++i1){ \t\t\tsum = sum + summary[i1]; \t\t} \t\talert(&quot;sum: [&quot;+sum+&quot;]&quot;); \t} \t&lt;\/script&gt; &lt;\/head&gt; &lt;body&gt; \t&lt;p&gt;&lt;a href=&quot;#&quot; onclick=&quot;testClear();&quot;&gt;&lt;div&gt;test clear:&lt;span id='testClear'&gt;&lt;\/span&gt;&lt;\/div&gt;&lt;\/a&gt;&lt;\/p&gt; &lt;\/body&gt; &lt;\/html&gt; <\/code><\/pre>\n<p>  \u0417\u0430\u043f\u0443\u0441\u043a \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435 \u0432\u044b\u0434\u0430\u043b \u043c\u043d\u0435 <b>75 ms<\/b>, \u0447\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0442\u043b\u0438\u0447\u043d\u043e. \u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u043f\u043e\u043d\u044f\u0442\u043d\u043e \u0441\u0440\u0430\u0437\u0443 \u2014 \u0432\u044b\u0440\u0435\u0437\u0430\u0442\u044c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0438\u0437 PHP \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u043a\u043b\u0438\u0435\u043d\u0442\u0443 \u0432 \u043c\u0430\u0441\u0441\u0438\u0432, \u0438 \u0442\u0430\u043c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0440\u0430\u0441\u0447\u0435\u0442. \u0427\u0442\u043e \u0431\u044b\u043b\u043e \u0438 \u0441\u0434\u0435\u043b\u0430\u043d\u043e\u2026 \u041d\u041e!.. \u0432\u0440\u0435\u043c\u044f \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u0441\u043d\u043e\u0432\u0430 \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0441\u0432\u044b\u0448\u0435 <b>10 sec<\/b>. \u0412\u0441\u0435 \u0442\u0435\u0441\u0442\u044b \u0438 \u043f\u043e\u0438\u0441\u043a\u0438 \u0432 \u043a\u043e\u0434\u0435, \u0432\u044b\u0432\u0435\u043b\u0438 \u043c\u0435\u043d\u044f \u043d\u0430 \u043d\u043e\u0432\u0443\u044e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c <b>Prototype<\/b>.<\/p>\n<h4>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 3 \u2013 Prototype \u0438 AJAX<\/h4>\n<p>  \u0414\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0432 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u0432\u0441\u0435 \u0431\u044b\u043b\u043e \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u043e \u043d\u0430 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0435 \u0441 AJAX. \u0422.\u0435. \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0441\u0434\u0435\u043b\u0430\u043b\u0438 \u0432 \u0434\u0443\u0445\u0435 Web 2.0, \u043c\u043e\u0434\u043d\u043e \u0438 \u043a\u0440\u0430\u0441\u0438\u0432\u043e. \u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0432\u044b\u0431\u043e\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445, \u043d\u0430\u0436\u0438\u043c\u0430\u0435\u0442 CREATE REPORT \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0430\u044f\u043a\u0441\u043e\u043c \u043d\u0438\u0436\u0435 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0439 \u043e\u0442\u0447\u0435\u0442. \u0412\u0441\u0435 \u0441\u0447\u0438\u0442\u0430\u044e\u0442 \u044d\u0442\u043e \u0441\u0435\u0439\u0447\u0430\u0441 \u0443\u0436\u0435 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043e\u043c, \u0432\u044b\u0434\u0430\u0432\u0430\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0431\u0435\u0437 \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438. \u0412\u043e\u0442 \u0442\u0443\u0442 \u0438 \u043a\u0440\u044b\u043b\u0441\u044f \u043a\u043e\u0432\u0430\u0440\u043d\u044b\u0439 \u0432\u0440\u0430\u0433.<br \/>  \u041e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <b>Prototype<\/b> \u0438\u043c\u0435\u0442 \u0434\u0432\u0430 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b, \u0437\u0430 \u0447\u0442\u043e \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 evalScripts [true\/false]. \u041f\u0440\u0438 (evalScripts=false) Prototype \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0438 \u0432\u044b\u0434\u0430\u0435\u0442 \u0435\u0435 \u043d\u0430 \u044d\u043a\u0440\u0430\u043d \u043f\u0440\u043e\u0441\u0442\u043e \u043a\u0430\u043a \u0442\u0435\u043a\u0441\u0442, \u0438 \u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432\u0441\u0435 \u0431\u043b\u043e\u043a\u0438 \u0441 JavaScript \u043d\u0435 \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u044b. \u0412\u043e\u0442 \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0435 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u043e\u0442\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043b\u0438 \u0438 \u0441\u0442\u0430\u0432\u0438\u0442\u0441\u044f evalScripts=true, \u0438 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0430\u0440\u0441\u0438\u043d\u0433 \u0441 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435\u043c eval() \u0434\u043b\u044f \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0438. \u0412 \u0438\u0442\u043e\u0433\u0435 \u0432\u043c\u0435\u0441\u0442\u043e \u0447\u0438\u0441\u0442\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u0441 \u0435\u0433\u043e <b>75 ms<\/b> \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0430 <b>11 \u0441\u0435\u043a<\/b>!!! \u0414\u043b\u044f \u043c\u0435\u043d\u044f \u044d\u0442\u043e \u0431\u044b\u043b \u0448\u043e\u043a. \u0412\u044b\u0445\u043e\u0434\u0438\u0442, \u0447\u0442\u043e \u043d\u0435\u043b\u044c\u0437\u044f \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u0430\u044f\u043a\u0441\u043e\u043c \u043a\u043e\u0434 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0435\u0433\u043e. \u0418 \u044d\u0442\u043e \u043e\u043f\u0430\u0441\u0435\u043d\u0438\u0435 \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u043b\u043e\u0441\u044c, \u043a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u044f \u0432\u044b\u043d\u0435\u0441 \u0440\u0430\u0441\u0447\u0435\u0442 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u043e\u0442\u0447\u0435\u0442\u0430 \u0432 \u0448\u0430\u043f\u043a\u0443 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430. \u0422.\u0435. \u0432 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u043e\u0441\u0442\u0430\u0432\u0438\u043b Array \u0432\u044b\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0439 PHP \u0438 \u0441\u0434\u0435\u043b\u0430\u043b \u0432\u044b\u0437\u043e\u0432 \u0432\u043d\u0435\u0448\u043d\u0435\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0441 \u0440\u0430\u0441\u0447\u0435\u0442\u043e\u043c \u0438\u0437 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0440\u0435\u0434\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u0432 \u043c\u0430\u0441\u0441\u0438\u0432 \u043a\u0430\u043a \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440, \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u043b \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u0441\u0432\u043e\u0438 <b>75 ms<\/b>.<\/p>\n<p>  \u0414\u0430\u043d\u043d\u044b\u0439 \u0444\u0430\u043a\u0442 \u043d\u0430\u0442\u043e\u043b\u043a\u043d\u0443\u043b \u043c\u0435\u043d\u044f \u043d\u0430 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0430, \u0441 \u0442\u0435\u043c \u0436\u0435 \u043a\u043e\u0434\u043e\u043c \u043d\u043e \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0440\u0430\u0437\u043d\u044b\u0445 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u043e\u0432 \u0438 \u0442\u0430\u043a\u0436\u0435 \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u044c \u0441 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435\u043c \u0430\u044f\u043a\u0441\u0430 \u0432 <b>JQuery<\/b>.<\/p>\n<p>  \u0412 \u0438\u0442\u043e\u0433\u0435 \u044f \u043f\u043e\u043b\u0443\u0447\u0438\u043b \u0432\u043e\u0442 \u0442\u0430\u043a\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435:<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/1ee\/080\/002\/1ee0800022d3ffa6b15bba201fd3b268.jpg\" alt=\"image\"\/><\/p>\n<p>  \u041f\u0440\u0438\u043c\u0435\u0440\u044b \u043a\u043e\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0442\u0443\u0442:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">test.htm<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"html\">&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; \t&lt;script&gt; \tfunction testClear() \t{ \t\tvar summary = []; \t\tvar count = 5000; \t\tfor(var i1=0;i1&lt;count;++i1){ \t\t\tsummary[i1] = i1; \t\t} \t\tvar start = new Date().getTime(); \t\tfor(var i1=0;i1&lt;count;++i1){ \t\t\tfor(var i2=0;i2&lt;count;++i2){ \t\t\t\tif(&quot;5468735354987&quot;!==&quot;654654655465&quot;){ \t\t\t\t\tsummary[i1] = i1*i2; \t\t\t\t} \t\t\t} \t\t} \t\tdocument.getElementById(&quot;testClear&quot;).innerHTML = &quot;time: &quot;+(new Date().getTime() - start)+&quot; ms&quot;; \t\tvar sum = 0; \t\tfor(i1=0;i1&lt;count;++i1){ \t\t\tsum = sum + summary[i1]; \t\t} \t\talert(&quot;sum: [&quot;+sum+&quot;]&quot;); \t} \t&lt;\/script&gt; &lt;\/head&gt; &lt;body&gt; \t&lt;p&gt;&lt;a href=&quot;#&quot; onclick=&quot;testClear();&quot;&gt;&lt;div&gt;test clear:&lt;span id='testClear'&gt;&lt;\/span&gt;&lt;\/div&gt;&lt;\/a&gt;&lt;\/p&gt; &lt;\/body&gt; &lt;\/html&gt; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">test_jquery.htm<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"html\">&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;script type='text\/javascript' src='jquery.js'&gt;&lt;\/script&gt; &lt;script&gt; \tfunction test() \t{ \t\t$('#test').html('loading...'); \t\t$.get('test_ajax.html', function(data) { \t\t\t$('#test').html(data); \t\t}); \t} &lt;\/script&gt; &lt;\/head&gt; &lt;body&gt; \t&lt;p&gt;&lt;a href=&quot;#&quot; onclick=&quot;test();&quot;&gt;&lt;div&gt;test jquery ajax:&lt;span id='test'&gt;&lt;\/span&gt;&lt;\/div&gt;&lt;\/a&gt;&lt;\/p&gt; &lt;\/body&gt; &lt;\/html&gt; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">test_prototype.htm<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"html\">&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;script type='text\/javascript' src='prototype.js'&gt;&lt;\/script&gt; &lt;script&gt; \tfunction testFn() \t{ \t\t$('test').update('loading...'); \t\tnew Ajax.Updater('test','test_ajax.html', { \t\t\tmethod: 'get', \t\t\tasynchronous:true,  \t\t\tevalScripts:true, \t\t\tonSuccess: function(transport) { \t\t\t\t$('test').update('in process...'); \t\t\t}, \t\t\tonFailure: function(transport) { \t\t\t\talert(&quot;Error&quot;); \t\t\t} \t\t}); \t} &lt;\/script&gt; &lt;\/head&gt; &lt;body&gt; \t&lt;p&gt;&lt;a href=&quot;#&quot; onclick=&quot;testFn();&quot;&gt;&lt;div&gt;test prototype ajax:&lt;span id='test'&gt;&lt;\/span&gt;&lt;\/div&gt;&lt;\/a&gt;&lt;\/p&gt; &lt;\/body&gt; &lt;\/html&gt; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">test_ajax.html<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"html\">&lt;script&gt; \tsummary = new Array(); \tcount = 5000; \tfor(i1=0;i1&lt;count;++i1){ \t\tsummary[i1] = i1; \t} \tvar start = new Date().getTime(); \tfor(var i1=0;i1&lt;count;++i1){ \t\tfor(var i2=0;i2&lt;count;++i2){ \t\t\tif(&quot;5468735354987&quot;!=&quot;654654655465&quot;){ \t\t\t\tsummary[i1] = i1*i2; \t\t\t} \t\t} \t} \tdocument.getElementById(&quot;test&quot;).innerHTML = &quot;time: &quot;+(new Date().getTime() - start)+&quot; ms&quot;; \tvar sum = 0; \tfor(i1=0;i1&lt;count;++i1){ \t\tsum = sum + summary[i1]; \t} \talert(&quot;sum: [&quot;+sum+&quot;]&quot;); &lt;\/script&gt; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0412 \u0438\u0442\u043e\u0433\u0435 \u043a\u0430\u0440\u0442\u0438\u043d\u0430 \u0432\u044b\u0448\u043b\u0430 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0442\u0430\u043a\u0438 \u0441\u0442\u0440\u0430\u0448\u043d\u0430\u044f.<br \/>  1. \u041f\u043e\u0447\u0435\u043c\u0443 64bit \u0432\u0430\u0440\u0438\u0430\u043d\u0442 IE \u0441 \u0447\u0438\u0441\u0442\u044b\u043c \u043a\u043e\u0434\u043e\u043c \u0434\u0430\u043b \u0442\u0430\u043a\u0443\u044e \u043f\u043e\u0442\u0435\u0440\u044e \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438, \u0440\u0430\u0431\u043e\u0442\u0430\u044f \u0432 64bit \u0441\u0440\u0435\u0434\u0435, \u044f \u0442\u0430\u043a \u0438 \u043d\u0435 \u043f\u043e\u043d\u044f\u043b<br \/>  2. \u0421\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u044b Javascript \u0438\u0437 \u043f\u043e\u0434 Prototype \u043f\u0440\u043e\u0441\u0442\u043e \u0443\u0436\u0430\u0441\u043d\u0430. \u041c\u0435\u0436\u0434\u0443 \u0447\u0438\u0441\u0442\u044b\u043c \u043a\u043e\u0434\u043e\u043c \u0438 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u043c \u0441 \u0430\u044f\u043a\u0441, \u0440\u0430\u0437\u043d\u0438\u0446\u0430 \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0433\u0440\u043e\u043c\u043d\u0430.<br \/>  3. JQuery \u0442\u043e\u0436\u0435 \u0443\u0434\u0438\u0432\u0438\u043b. \u0425\u043e\u0442\u044c \u0438 \u043d\u0435 \u0442\u0430\u043a \u0441\u0438\u043b\u044c\u043d\u043e, \u043a\u0430\u043a \u0442\u043e\u0442 \u0436\u0435 Propotype, \u043d\u043e \u0442\u043e\u0436\u0435 \u0434\u0430\u043b\u0435\u043a \u043e\u0442 \u0447\u0438\u0441\u0442\u043e\u0433\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f JS \u043a\u043e\u0434\u0430.<br \/>  4. \u0414\u0430\u043b\u044c\u0448\u0435 \u0430\u043d\u0430\u043b\u0438\u0437 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u0432 \u043f\u043e\u043b\u043d\u044b\u0439 \u0442\u0443\u043f\u0438\u043a. \u041f\u043e\u0447\u0435\u043c\u0443 Chrome \u043a\u0430\u043a \u0438 FireFox \u0432\u044b\u0434\u0430\u043b\u0438 \u0442\u0430\u043a\u0438\u0435 \u0443\u0436\u0430\u0441\u043d\u044b\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441 IE. \u041f\u0440\u0438\u0442\u043e\u043c \u0447\u0442\u043e IE9 \u0431\u044b\u043b \u0432 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u0435, \u0430 IE10 \u0443\u0436\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0430 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0435.<\/p>\n<p>  \u0414\u0440\u0443\u0433\u0438\u0445 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u043f\u0435\u0440\u0435\u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043d\u0435 \u043d\u0430\u0448\u043b\u043e\u0441\u044c. \u0427\u0442\u043e \u0431\u044b\u043b\u043e \u043f\u043e\u0434 \u0440\u0443\u043a\u043e\u0439, \u0442\u043e \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b. \u0412\u044b \u0434\u043b\u044f \u0441\u0435\u0431\u044f \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u0430\u043c\u0438 \u0432\u0437\u044f\u0442\u044c \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c. \u041d\u043e \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f \u0443\u0436\u0435, \u0432 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435, \u043f\u043e\u043d\u044f\u0442\u043d\u0430.<\/p>\n<h4>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 4 \u2013 String Replace<\/h4>\n<p>  \u0411\u0443\u043a\u0432\u0430\u043b\u044c\u043d\u043e \u0432 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u044c\u0438, \u043d\u0430\u0442\u043a\u043d\u0443\u043b\u0441\u044f \u0435\u0449\u0435 \u043d\u0430 \u043e\u0434\u043d\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443, \u043d\u043e \u0443\u0436\u0435 \u0432 \u0434\u0440\u0443\u0433\u043e\u043c \u0432\u0435\u0431 \u043f\u0440\u043e\u0435\u043a\u0442\u0435, \u0438 \u0443\u0436\u0435 \u043d\u0430 ASP. \u0422\u0430\u043c \u0431\u0430\u0437\u0430 \u0432\u044b\u0434\u0430\u0432\u0430\u043b\u0430 \u043e\u0442\u0447\u0435\u0442\u043d\u043e\u0441\u0442\u044c, \u0438 \u0432 \u0438\u0442\u043e\u0433\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u043b\u0441\u044f \u0432\u044b\u0432\u043e\u0434 \u043f\u043e\u0440\u044f\u0434\u043a\u0430 3,5Mb, \u0441 \u0440\u0430\u0441\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u043c\u0438 \u043c\u0430\u0440\u043a\u0435\u0440\u0430\u043c\u0438 \u0434\u043b\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f. \u0412 \u0438\u0442\u043e\u0433\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u0441 Replace(), \u0437\u0430\u043d\u0438\u043c\u0430\u043b\u0430 \u043f\u043e\u0440\u044f\u0434\u043a\u0430 11 \u0441\u0435\u043a. \u0420\u0430\u0437\u0431\u0438\u0432\u043a\u0430 \u043d\u0430 \u043a\u0443\u0441\u043a\u0438 \u0441 \u043f\u0440\u043e\u0431\u0435\u0436\u043a\u043e\u0439, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043a\u0430, \u043f\u0440\u0438\u0440\u043e\u0441\u0442\u0430 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u043d\u0435 \u0434\u0430\u043b\u0438. \u0412 \u0438\u0442\u043e\u0433\u0435 \u0431\u044b\u043b \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u0442\u0435\u0441\u0442 \u0434\u043b\u044f \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u0440\u0430\u0437\u043d\u044b\u0445 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c. \u0418\u043c\u0435\u044f \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043e\u0442\u0447\u0435\u0442 HTML, \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c \u0442\u0430\u043a \u043f\u043e\u0434 3,5Mb, \u0440\u0435\u0448\u0438\u043b \u0441\u043a\u043e\u0440\u043c\u0438\u0442\u044c \u0435\u0433\u043e \u043a\u043e\u0434\u0443 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0440\u0435\u043f\u043b\u0435\u0439\u0441 \u043f\u0440\u0438 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0445 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u0445 \u0447\u0442\u043e\u0431\u044b \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u044c \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 Array.<\/p>\n<p>  \u0418\u0442\u0430\u043a, \u043c\u044b \u0438\u043c\u0435\u0435\u043c \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0439 \u0444\u0430\u0439\u043b \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c 3,5\u041c, \u0441 \u0440\u0430\u0441\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u043c\u0438 \u043c\u0435\u0442\u043a\u0430\u043c\u0438 \u043f\u043e \u0442\u0435\u043a\u0441\u0442\u0443 \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u0430, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043e\u0434\u0438\u043d \u0438 \u0442\u043e\u0442 \u0436\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043a\u043e\u0434\u0430, \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043d\u0430 \u0440\u0430\u0437\u043d\u044b\u0435 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b.<\/p>\n<p>  \u041f\u0440\u043e\u0433\u043d\u0430\u0432 \u0442\u0435\u0441\u0442, \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0442\u0430\u043a\u0443\u044e \u043a\u0430\u0440\u0442\u0438\u043d\u0443:<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/0a3\/d88\/368\/0a3d88368d56dc6ca096499d8a3abbde.jpg\" alt=\"image\"\/><\/p>\n<p>  \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0442\u0435\u0441\u0442\u0435 (local host) \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e UsbWebServer, \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0439 \u043d\u0430 \u043c\u043e\u0435\u043c \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0435, \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u044d\u0442\u043e \u0440\u0430\u0437\u043d\u044b\u0435 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u044b, \u043a \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0431\u044b\u043b \u0434\u043e\u0441\u0442\u0443\u043f.<\/p>\n<p>  1. ASP \u0438\u043c\u0435\u0435\u0442 \u043e\u0433\u0440\u043e\u043c\u043d\u044b\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u043e \u0441\u0442\u0440\u043e\u043a\u0430\u043c\u0438. \u0412\u0430\u0440\u0438\u0430\u043d\u0442 \u0441 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043a\u043e\u0439 \u0434\u0430\u0432\u0430\u043b \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0445\u0443\u0436\u0435, \u043a\u0430\u043a \u0438 \u0440\u0430\u0437\u0431\u0438\u0432\u043a\u0430 \u043d\u0430 \u043c\u0435\u043b\u043a\u0438\u0435 \u043a\u0443\u0441\u043a\u0438 \u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430. \u0415\u0449\u0435 \u0438 \u043e\u0433\u0440\u043e\u043c\u043d\u0430\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u043e\u0442 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0438 \u0435\u0433\u043e \u043c\u043e\u0449\u043d\u043e\u0441\u0442\u0435\u0439.<br \/>  2. \u0422\u043e\u0436\u0435 \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0438 \u0441 ASPX \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u043c. \u0412 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u0435 \u0432\u044b\u0434\u0430\u043b\u043e <b>13 \u0441\u0435\u043a<\/b>, \u0430 \u0432\u043e\u0442 \u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u043e\u043c \u0432\u0435\u0431 \u0441\u0435\u0440\u0432\u0435\u0440\u0435, \u0432 \u0441\u0430\u043c\u043e\u043c \u043f\u0440\u043e\u0441\u0442\u043e\u043c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0435 \u0432\u0435\u0431 \u0445\u043e\u0441\u0442\u0430, \u0447\u0442\u043e \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 1and1, \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0443\u043f\u0430\u043b\u0430 \u0432 4 \u0440\u0430\u0437\u0430, \u043f\u0440\u0438\u0442\u043e\u043c \u0447\u0442\u043e \u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u043b \u0441\u043a\u0440\u0438\u043f\u0442 \u0432 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u0435 \u0441 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c\u0438 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u043c\u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c\u0438 \u043f\u043e\u0434 \u043d\u0435\u0435.<br \/>  3. PHP \u0441\u043d\u043e\u0432\u0430 \u043f\u043e\u043a\u0430\u0437\u0430\u043b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u0443\u044e \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e\u0441\u0442\u044c, \u043d\u043e \u0432\u043e\u0442 \u041a\u0438\u0435\u0432\u0441\u043a\u0438\u0439 \u0445\u043e\u0441\u0442\u0435\u0440 \u043f\u043e\u0434\u0432\u0435\u043b, \u0432\u0438\u0434\u0438\u043c\u043e \u0442\u0430\u043c \u0431\u044b\u043b\u043e \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043e \u0441\u043e\u0432\u0441\u0435\u043c \u043c\u0430\u043b\u043e \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u043f\u043e\u0434 \u0445\u043e\u0441\u0442, \u0442\u043e \u043b\u0438 \u0441\u0435\u0440\u0432\u0435\u0440 \u043d\u043e\u0447\u044c\u044e \u0431\u044b\u043b \u0447\u0435\u043c \u0442\u043e \u0437\u0430\u043d\u044f\u0442.<br \/>  4. NodeJS \u0432\u044b\u0434\u0430\u043b \u043b\u0443\u0447\u0448\u0438\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432 \u044d\u0442\u043e\u043c \u0437\u0430\u0431\u0435\u0433\u0435. \u041d\u043e, \u043a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u043d\u0435 \u043f\u043e\u0440\u0430\u0434\u043e\u0432\u0430\u043b \u043c\u0435\u043d\u044f, \u0442\u0430\u043a-\u043a\u0430\u043a \u0431\u043e\u043b\u0435\u0435 <b>2 \u0441\u0435\u043a<\/b> \u2014 \u044d\u0442\u043e \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043a\u0440\u0438\u0442\u0438\u0447\u043d\u043e, \u043f\u0440\u0438\u0442\u043e\u043c \u0447\u0442\u043e \u043e\u0442\u0447\u0435\u0442 \u0431\u044b\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d \u043d\u0435 \u0441\u0430\u043c\u044b\u0439 \u0431\u043e\u043b\u044c\u0448\u043e\u0439. \u0422\u0430\u043a \u0447\u0442\u043e \u0437\u0430\u0434\u0430\u0447\u0443 \u0441 \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u043e\u043c \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0440\u0435\u0448\u0430\u0442\u044c \u043f\u043e\u0438\u0441\u043a\u043e\u043c \u0434\u0440\u0443\u0433\u0438\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432.<\/p>\n<p>  \u0412\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u043a\u043e\u0434\u0430:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">test_replace.asp<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"vbscript\">&lt;% 'time: 13.58594 'time: 58.01563 \tSet FSO = CreateObject(&quot;Scripting.FileSystemObject&quot;) \tSet File = FSO.GetFile(Server.MapPath(&quot;test_replace.txt&quot;))  \tSet Reader = FSO.OpenTextFile(File, 1,False) \tbuffer = Reader.ReadAll \tReader.Close  \tt = timer() \tFor rec=1 to 10 \t\tFor col=0 to 100 \t\t\tbuffer = Replace(buffer,&quot;{{&quot;&rec&&quot;:&quot;&col&&quot;}}&quot;,&quot;-|-&quot;) \t\tNext \tNext \tresponse.write &quot;time: &quot;&timer()-t \tresponse.write &quot;&lt;hr&gt;&quot; \tresponse.write buffer %&gt; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">test_replace.aspx<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code>&lt;%@ Page validateRequest=&quot;false&quot; Debug=&quot;true&quot; %&gt; &lt;%@ Import Namespace=&quot;System.IO&quot; %&gt; &lt;%@ Import Namespace=&quot;System.Data&quot; %&gt; &lt;%@ Import Namespace=&quot;System.Diagnostics&quot; %&gt; &lt;%@ Import Namespace=&quot;System.Threading&quot; %&gt;  &lt;script language=&quot;C#&quot; runat=&quot;server&quot;&gt; \tpublic void Page_Load(Object sender, EventArgs E) \t{         \/\/time: 8736 ms         \/\/time:[1and1] 16183 ms         string buffer = File.ReadAllText(Server.MapPath(&quot;test_replace.txt&quot;));         Stopwatch stopwatch = new Stopwatch();         stopwatch.Start();         for (int rec = 0; rec &lt; 10; rec++)         { \t\t\tfor (int col = 0; col &lt; 100; col++) \t\t\t{                 buffer = buffer.Replace(&quot;{{&quot; + rec + &quot;:&quot; + col + &quot;}}&quot;, &quot;-|-&quot;); \t\t\t}         }         stopwatch.Stop();         Response.Write(&quot;&lt;li&gt;time: &quot; + (stopwatch.ElapsedMilliseconds) + &quot; ms&lt;\/li&gt;&quot;);          Response.Write(buffer); \t} &lt;\/script&gt; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">test_replace.php<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"php\">&lt;?php \/\/time: 4.570 ms \/\/time:ks.ua 10.3491752148 ms \/\/time:servmax 5.7612838745117 ms $buffer = file_get_contents('test_replace.txt');  $t = microtime(true);  for($rec=0;$rec&lt;10;++$rec){ \tfor($col=0;$col&lt;100;++$col){ \t\t$buffer = str_replace( &quot;{{&quot;.$rec.&quot;:&quot;.$col.&quot;}}&quot;,&quot;-|-&quot;, $buffer );  \t} }  echo &quot;time: &quot;.(microtime(true)-$t).' ms'; echo &quot;&lt;hr&gt;&quot;; echo $buffer; ?&gt; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">test_replace_nodejs.js<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"javascript\">var fs = require('fs'), \thttp = require('http');  http.createServer(function (req, res) { \t \t \tfs.readFile('test_replace.txt', function (err, data) { \t\tdata = String(data); \t\tif (err) { \t\t\tres.writeHead(404); \t\t\tres.end(JSON.stringify(err)); \t\t\treturn; \t\t} \t\tres.writeHead(200, {'Content-Type': 'text\/html'}); \t\tvar start = new Date().getTime(); \t\tfor (var rec = 0; rec &lt; 10; ++rec) \t\t{ \t\t\tfor (var col = 0; col &lt; 100; ++col) \t\t\t{ \t\t\t\tdata = data.replace(new RegExp( &quot;{{&quot; + rec + &quot;:&quot; + col + &quot;}}&quot;, &quot;g&quot; ), &quot;-|-&quot;); \t\t\t} \t\t} \t\tconsole.log(new Date().getTime()-start); \t\tres.end(data); \t}); \t }).listen(1337, '127.0.0.1');  console.log('Server running at http:\/\/127.0.0.1:1337\/'); <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<h4>\u0418\u0442\u043e\u0433<\/h4>\n<p>  P.S. \u0425\u043e\u0442\u0435\u043b \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043e\u0440\u043e\u0442\u043a\u043e, \u0432\u044b\u0434\u0430\u0432 \u0442\u043e\u043b\u044c\u043a\u043e \u0446\u0438\u0444\u0440\u044b, \u043d\u043e \u0431\u0435\u0437 \u043f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0439 \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u043a\u043e\u043c\u0443 \u0442\u043e \u043d\u0435\u043f\u043e\u043d\u044f\u0442\u043d\u043e. \u0422\u0430\u043a \u0447\u0442\u043e \u043f\u0440\u0438\u043d\u043e\u0448\u0443 \u0438\u0437\u0432\u0438\u043d\u0435\u043d\u0438\u044f \u0437\u0430 \u0434\u043b\u0438\u043d\u043d\u044b\u0439 \u0442\u0435\u043a\u0441\u0442, \u043d\u0443 \u0438 \u0441\u0442\u0438\u043b\u044c \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f, \u0434\u043b\u044f \u043c\u0435\u043d\u044f \u044d\u0442\u043e \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0442\u0430\u043a\u0438 \u0431\u043e\u043b\u044c\u0448\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u2026 \u043d\u0435 \u043f\u0438\u0441\u0430\u0442\u0435\u043b\u044c \u044f.<\/p>\n<p>  P.S.S. \u041e\u0447\u0435\u043d\u044c \u0441\u0438\u043b\u044c\u043d\u043e \u0441\u043c\u0443\u0449\u0430\u0435\u0442 \u0442\u0435\u043d\u0434\u0435\u043d\u0446\u0438\u044f \u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0432\u0441\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u044b \u043f\u043e \u0434\u0435\u0444\u043e\u043b\u0442\u0443 \u043d\u0430 MySQL. \u0412\u0441\u0435-\u0442\u0430\u043a\u0438 \u044d\u0442\u043e \u0431\u0430\u0437\u0430 \u0442\u0440\u0435\u0442\u044c\u0435\u0433\u043e \u044d\u0448\u0435\u043b\u043e\u043d\u0430, \u0438 \u043e\u043d\u0430 \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f WordPress, \u0444\u043e\u0440\u0443\u043c\u0430 \u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u043c\u0435\u043b\u043a\u0438\u0445 \u0437\u0430\u0434\u0430\u0447. \u0422\u043e \u0447\u0442\u043e \u0431\u0430\u0437\u0430 \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u0430\u044f, \u0432 \u0438\u0442\u043e\u0433\u0435 \u0432\u044b\u0445\u043e\u0434\u0438\u0442 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0434\u043e\u0440\u043e\u0436\u0435. \u0412\u043c\u0435\u0441\u0442\u043e \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0432\u0441\u044e \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0443 \u043f\u0440\u044f\u043c\u043e \u0432 \u0431\u0430\u0437\u0435, \u043f\u043e\u0440\u0443\u0447\u0438\u0432 \u0435\u0439 \u0437\u0430\u043d\u0438\u043c\u0430\u0442\u044c\u0441\u044f \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u0438 \u043a\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0437\u0430\u043d\u0438\u043c\u0430\u044e\u0442\u0441\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c \u043a\u0438\u043b\u043e\u043c\u0435\u0442\u0440\u043e\u0432 \u043a\u043e\u0434\u0430 \u043d\u0430 PHP \u0432\u043c\u0435\u0441\u0442\u043e \u043e\u0434\u043d\u043e\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0432 \u0431\u0430\u0437\u0435. \u0415\u0441\u043b\u0438 \u0432\u043e\u043f\u0440\u043e\u0441 \u0441\u0442\u043e\u0438\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0446\u0435\u043d\u0435, \u0442\u043e \u0432\u043e\u0437\u044c\u043c\u0438\u0442\u0435 MS SQL Server \u0432 \u0440\u0435\u0434\u0430\u043a\u0446\u0438\u0438 Web, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0442\u043e\u0436\u0435 \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u0430, \u043d\u043e \u0434\u0430\u0441\u0442 \u0432\u0430\u043c \u0432\u0441\u0435 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0438, \u0438\u043b\u0438 \u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 Oracle, \u0432\u0441\u0435 \u0442\u0430\u043a\u0438 \u044d\u0442\u043e \u0431\u0430\u0437\u044b \u0432\u044b\u0441\u0448\u0435\u0433\u043e \u044d\u0448\u0435\u043b\u043e\u043d\u0430. PostgresSQL \u043d\u0435 \u0432\u044b\u0434\u0430\u043b \u043f\u0440\u0438\u0435\u043c\u043b\u0435\u043c\u043e\u0433\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430, \u043f\u043e\u0442\u043e\u043c\u0443 \u0431\u044b\u043b \u0441\u0440\u0430\u0437\u0443 \u043e\u0442\u0431\u0440\u043e\u0448\u0435\u043d \u0434\u043b\u044f \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0433\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u0415\u0441\u043b\u0438 \u043a\u043e\u043c\u0443-\u0442\u043e \u0432\u0434\u0440\u0443\u0433 \u0431\u0443\u0434\u0435\u0442 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u0442\u043e \u0432\u043e\u0442 \u0430\u043d\u0430\u043b\u043e\u0433 \u043a\u043e\u0434\u0430 SQL Server \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b \u0441\u043c\u043e\u0436\u0435\u0442\u0435 \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 \u0442\u0443 \u0438\u043b\u0438 \u0438\u043d\u0443\u044e \u0431\u0430\u0437\u0443:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">test.sql<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"sql\">CREATE TABLE test_events ( event_id int IDENTITY (1, 1), event_type int, event_point int, event_date datetime ) -------------- ALTER TABLE [test_events] ADD  CONSTRAINT [IDX_event_type]  DEFAULT ((1)) FOR [event_type] GO ALTER TABLE [test_events] ADD  CONSTRAINT [IDX_event_point]  DEFAULT ((1)) FOR [event_point] GO ALTER TABLE [test_events] ADD  CONSTRAINT [IDX_event_date]  DEFAULT (NULL) FOR [event_date] GO -------------- DECLARE @counter bigint = 0; DECLARE @event_type smallint = 1; -------------- BEGIN TRANSACTION; WHILE @counter &lt; 1000000    BEGIN             IF @event_type=1                         SET @event_type=2             ELSE                         SET @event_type=1             INSERT INTO test_events (event_type,event_point,event_date)             VALUES (@event_type,ROUND(5 * RAND() + 100,0),DATEADD(MINUTE,@counter*10,'1\/1\/2011'))                   SET @counter = @counter + 1    END COMMIT TRAN; --------------  SET NOCOUNT ON  SELECT event_point,SUM(DATEDIFF(hour,event_date,end_date)) FROM ( SELECT     ev1.event_point,ev1.event_date,             (select top 1 event_date from test_events                         where ev1.event_point = event_point                         and event_type = (CASE WHEN ev1.event_type = 1 THEN 2 ELSE 1 END)                         and event_id &gt; ev1.event_id) as end_date FROM test_events as ev1 WHERE     ev1.event_date BETWEEN '2012-1-1' AND '2012-1-31' AND ev1.event_type IN (1 , 2) ) report GROUP BY event_point <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0412\u0441\u0435\u043c \u0441\u043f\u0430\u0441\u0438\u0431\u043e! \u041d\u0430\u0434\u0435\u044e\u0441\u044c \u0447\u0442\u043e \u044d\u0442\u0430 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u0432\u0430\u043c \u043f\u043e\u043b\u0435\u0437\u043d\u0430. \t\t\t \t\t\t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/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=\"http:\/\/habrahabr.ru\/post\/162885\/\"> http:\/\/habrahabr.ru\/post\/162885\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\"> \t\t\t\u0420\u0435\u0447\u044c \u043f\u043e\u0439\u0434\u0435\u0442 \u043e PHP,JavaScript \u0438 MySQL \u043a\u0430\u043a \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u043e\u0439 \u0442\u043e\u0447\u043a\u0435. \u042f \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0443 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0446\u0438\u0444\u0440\u044b \u0442\u0435\u0441\u0442\u043e\u0432 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0438 \u043f\u043e\u0442\u0435\u0440\u0438 \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0443\u0431\u0438\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442, \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u0437 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043d\u0435 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043d\u0435\u0434\u0430\u0432\u043d\u043e \u0432\u0441\u043a\u0440\u044b\u0442\u044c \u043d\u0430 \u043f\u0440\u0435\u0434\u043c\u0435\u0442 \u043f\u043e\u0438\u0441\u043a\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043d\u044b\u0445 \u043c\u0435\u0441\u0442, \u0438 \u043f\u043e\u043a\u0430\u0436\u0443 \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0432 \u0442\u0440\u0438 \u0448\u0430\u0433\u0430 \u0443\u0431\u0438\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442.<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/fbb\/817\/d4f\/fbb817d4f38ac13024eab5e73b880a05.jpg\"\/><\/p>\n<h4>\u041f\u0440\u0435\u0434\u0438\u0441\u043b\u043e\u0432\u0438\u0435.<\/h4>\n<p>  \u041d\u0435\u0434\u0430\u0432\u043d\u043e \u043c\u043d\u0435 \u0431\u044b\u043b\u0430 \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0430 \u0437\u0430\u0434\u0430\u0447\u0430, \u043f\u043e\u043c\u043e\u0447\u044c \u043d\u0430\u0439\u0442\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0432 \u043e\u0434\u043d\u043e\u043c \u0438\u0437 \u0432\u0435\u0431 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0445 \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u043e \u043d\u0430 PHP+MySQL, \u0438 \u0432\u0441\u0435 \u044d\u0442\u043e \u043a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e \u0437\u0430\u0432\u0435\u0440\u043d\u0443\u0442\u043e \u0432 Symfony Framework. \u0411\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u0438\u043b\u044c\u043d\u043e \u0440\u0430\u0441\u0442\u0438, \u0442\u0430\u043a-\u043a\u0430\u043a \u043b\u044e\u0434\u0438 \u0441\u043e\u0431\u0438\u0440\u0430\u043b\u0438 \u044d\u0432\u0435\u043d\u0442\u044b \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f (\u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c \u0430\u0432\u0442\u043e\u043f\u0430\u0440\u043a\u0430) \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u043b\u0438\u0432\u0430\u043b\u0438\u0441\u044c \u0431\u0443\u043a\u0432\u0430\u043b\u044c\u043d\u043e \u043a\u0430\u0436\u0434\u044b\u0435 5 \u043c\u0438\u043d\u0443\u0442. \u0415\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u044d\u0432\u0435\u043d\u0442\u043e\u0432 \u0432\u044b\u0440\u043e\u0441\u043b\u0430, \u0438 \u0434\u0430\u0431\u044b MySQL \u0441 \u043d\u0435\u0439 \u0445\u043e\u0442\u044c \u043a\u0430\u043a \u0442\u043e \u0441\u043f\u0440\u0430\u0432\u043b\u044f\u043b\u0430\u0441\u044c, \u0435\u0435 \u0440\u0430\u0437\u0431\u0438\u043b\u0438 \u043d\u0430 \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u0438. \u0412 \u0438\u0442\u043e\u0433\u0435 \u0432\u0441\u0435 \u044d\u0442\u043e \u0441\u0432\u043e\u0434\u0438\u043b\u043e\u0441\u044c \u043a \u0440\u0430\u0437\u043d\u043e\u0433\u043e \u0440\u043e\u0434\u0430 \u0432\u044b\u0431\u043e\u0440\u043a\u0430\u043c \u0438 \u043e\u0442\u0447\u0435\u0442\u0430\u043c, \u0442.\u0435. \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0435. \u0412 \u0438\u0442\u043e\u0433\u0435, \u0434\u0430\u0436\u0435 \u043f\u0440\u043e\u0441\u0442\u0430\u044f \u0432\u044b\u0431\u043e\u0440\u043a\u0430 \u0437\u0430 \u043f\u0435\u0440\u0438\u043e\u0434, \u043f\u043b\u044e\u0441 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043f\u043e\u0434\u0441\u0447\u0435\u0442, \u0437\u0430\u043d\u0438\u043c\u0430\u043b\u0438 \u043e\u0442 11 \u0441\u0435\u043a \u0438 \u0432\u044b\u0448\u0435. \u0412\u0438\u0434\u0438\u043c\u043e \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0438 \u0431\u044b\u043b\u043e \u043f\u0440\u0438\u043d\u044f\u0442\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435, \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u0442\u044c \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c\u044b\u0439 \u043f\u0435\u0440\u0438\u043e\u0434 \u0432 \u0434\u043d\u044f\u0445.<\/p>\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-162885","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/162885","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=162885"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/162885\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=162885"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=162885"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=162885"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}