{"id":2640,"date":"2021-11-16T16:21:11","date_gmt":"2021-11-16T08:21:11","guid":{"rendered":"http:\/\/ufqi.com\/blog\/?p=2640"},"modified":"2021-11-16T16:22:10","modified_gmt":"2021-11-16T08:22:10","slug":"hanjst-imprv-202111-with-memoline","status":"publish","type":"post","link":"https:\/\/ufqi.com\/blog\/hanjst-imprv-202111-with-memoline\/","title":{"rendered":"Hanjst\u6c49\u5409\u65af\u7279\ud83d\ude4b\u4e0e\u9f99\u4e66\u7f16\u8bd1\u539f\u7406"},"content":{"rendered":"<p>\u65f6\u95f4\u8fc7\u5f97\u65f6\u800c\u98de\u5feb\uff0c\u65f6\u800c\u7f13\u6162\u3002\u6211\u4eec\u4eba\u7c7b\u5df2\u7ecf\u4e0e\u65b0\u51a0\u80ba\u708e\u75ab\u60c5\u594b\u6218\u4e86\u5feb\u4e24\u5e74\u4e86\uff0c\u597d\u6d88\u606f\u662f\u968f\u7740\u75ab\u82d7\u7684\u4e0d\u65ad\u6539\u8fdb\u548c\u6301\u7eed\u7684\u666e\u53ca\u9632\u62a4\u80fd\u529b\u5728\u63d0\u5347\uff0c\u968f\u7740\u53e3\u670d\u7279\u6548\u836f\u9762\u4e16\u548c\u4e0d\u65ad\u4f18\u5316\u5347\u7ea7\u4eba\u7c7b\u4e5f\u4e0d\u518d\u4e0d\u582a\u4e00\u51fb\u4e86\u3002<\/p>\n<p>\u5c31\u50cf\u4e0d\u65ad\u6539\u8fdb\u548c\u589e\u5f3a\u7684\u75ab\u82d7\u548c\u7279\u6548\u836f\u4e00\u6837\uff0cHanjst\u6c49\u5409\u65af\u7279\ud83d\ude4b(\u00a0https:\/\/ufqi.com\/dev\/hanjst\/ )\u4e5f\u5728\u6301\u7eed\u7684\u4f18\u5316\u6539\u8fdb\u5347\u7ea7\u3002\u56de\u987e\u4e0a\u4e00\u6b21\u66f4\u65b0\u662f\u5728 2021\u5e743\u6708\u4efd\uff1aHanjst\u6c49\u5409\u65af\u7279\ud83d\ude4b\u4f18\u5316\u5347\u7ea7\u5f00\u53d1\u8005\u6a21\u5f0f\uff08\u00a0https:\/\/ufqi.com\/blog\/hanjst-updt-with-safari-tel\/ \uff09\uff0c\u5dee\u4e0d\u591a\u662f\u5e74\u5934\u4e00\u6b21\u4e3b\u8981\u5347\u7ea7\uff0c\u5e74\u5c3e\u4e00\u6b21\u4e3b\u8981\u5347\u7ea7\u3002\u8fd9\u6b21\u9488\u5bf9Hanjst\u6c49\u5409\u65af\u7279\ud83d\ude4b\u6539\u8fdb\uff0c\u4e5f\u662f\u534a\u5e74\u591a\u6765\u7684\u7d2f\u79ef\u6539\u8fdb\uff0c\u5176\u4e2d\u8f83\u5927\u7684\u4eae\u70b9\u4e4b\u4e00\u662f\u6539\u8fdb\u9488\u5bf9\u6ce8\u91ca\u8bed\u53e5\u7684\u66ff\u6362\u7684\u64cd\u4f5c\u3002<\/p>\n<p>\u5728Hanjst\u6c49\u5409\u65af\u7279\ud83d\ude4b\u7684\u6a21\u677f\u8bed\u8a00\u4e2d\uff0c\u65e2\u6709HTML\u7684\u8868\u8ff0\u8bed\u8a00\uff0c\u4e5f\u6709\u539f\u751f\u7684JavaScript\u7a0b\u5e8f\u4ee3\u7801\uff0c\u76f8\u5e94\u5730\u4f1a\u6709HTML\u7684\u6ce8\u91ca\u8bed\u53e5\uff0c\u5982 <br \/>&lt;!&#8211; \u8fd9\u662fHTML\u6ce8\u91ca\u5185\u5bb9 &#8211;&gt; \uff0c<\/p>\n<p>\u4e5f\u4f1a\u6709JavaScript\u7684\u6ce8\u91ca\u8bed\u53e5\uff0c\u5982 <br \/>\/\/- \u8fd9\u662f\u4e00\u4e2aJavaScript\u6ce8\u91ca\u884c\uff0c\u00a0<br \/>\/* \u6ce8\u91ca\u6bb5\u843d JavaScript\u884c1<br \/>\u00a0 \u00a0 \u00a0\u884c2<br \/>\u00a0 \u00a0 \u00a0\u6ce8\u91ca\u6bb5\u843d\u5c3e\u90e8<br \/>*\/<\/p>\n<p>\u5176\u4e2d\u5728 JavaScript\u7684\u5355\u884c\u6ce8\u91ca\u65f6\uff0c\u8fd9\u4e2a\u6ce8\u91ca\u65e2\u53ef\u4ee5\u662f\u4e00\u4e2a\u5355\u72ec\u7684\u5185\u5bb9\u884c\uff0c\u4e5f\u53ef\u80fd\u662f\u7d27\u7d27\u8ddf\u968f\u5728\u4e00\u6bb5\u4ee3\u7801\u4e4b\u540e\uff0c\u5982<br \/>const aString = \u201ca-string-sample&#8221;; \/\/- \u58f0\u660e\u4e00\u4e2aJavaScript\u5b57\u7b26\u4e32\u53d8\u91cf<\/p>\n<p>\u4e3a\u517c\u5bb9\u5404\u79cd\u60c5\u51b5\uff0c\u7a0b\u5e8f\u903b\u8f91\u4e8b\u60c5\u53d8\u5f97\u5f02\u5e38\u7684\u7cdf\u7cd5\uff0c\u7ecf\u8fc7\u5f88\u591a\u6b21\u5c1d\u8bd5\u4e4b\u540e\uff0c\u6211\u4eec\u5c0f\u7ed3\u6240\u9047\u5230\u7684\u56f0\u5883\u548c\u53ef\u80fd\u7684\u51fa\u8def\u65f6\uff0c\u76ee\u5149\u4e00\u4e0b\u5b50\u805a\u7126\u5230\u88ab\u79f0\u4e4b\u4e3a\u201d\u9f99\u4e66\uff08Dragon book\uff09\u201d\u7684\u8ba1\u7b97\u673a\u7a0b\u5e8f\u7f16\u8bd1\u7684\u300a\u7f16\u8bd1\u539f\u7406\u300b\u8fd9\u672c\u4e66\u3002\u8fd9\u672c\u4e66\u7684\u5168\u6c11\u662f Compiler: Principles, Techniques and Tools (\u7f16\u8bd1\u5668: \u539f\u7406\uff0c\u6280\u672f\u548c\u5de5\u5177\uff09\uff0c \u5728\u7ebf\u5185\u5bb9\u6536\u5f55\u5728 \u6709\u798f\u7ecf\u5178UfqiLong: https:\/\/ufqi.com\/news\/clscpage.1075.html?tit=\u7f16\u8bd1\u539f\u7406 Compilers: Principles, Techniques, and Tools \u3002<\/p>\n<p>\u4ece\u672c\u8d28\u4e0a\u8bf4\uff0c\u4ece\u6a21\u677f\u8bed\u8a00\u5230\u53ef\u6267\u884c\u7684\u751f\u6210\u7ec8\u7aef\u9875\u9762\u5448\u73b0HTML\u7684\u5176\u4ed6\u7a0b\u5e8f\u8bed\u8a00\uff0c\u5c31\u662f\u4e00\u6b21\u7f16\u8bd1\u8fc7\u7a0b\uff0c\u8fd9\u4e2a\u8fc7\u7a0b\u4e0e\u9f99\u4e66\u7f16\u8bd1\u539f\u7406\u6240\u63cf\u8ff0\u7684\u8fc7\u7a0b\u4e00\u4e2a\u6a21\u6837\u3002<br \/><img src=\"https:\/\/ufqi.com\/news\/view\/ueditor\/php\/upload\/image\/202111\/121636681774328686.png\" alt=\"compiler-fig-02.PNG\" \/><\/p>\n<p>\u4fa0\u4e49\u7684\u7f16\u8bd1\u662f\u5c06\u4eba\u7c7b\u6613\u8bfb\u901a\u7528\u7684\u7a0b\u5e8f\u8bed\u8a00\u4ee3\u7801\u201c\u7ffb\u8bd1\u201d\u6210\u4e3a\u673a\u5668\u53ef\u4ee5\u6267\u884c\u7684\u673a\u5668\u8bed\u8a00\u4ee3\u7801\u3002\u6bd4\u5982\uff0c\u5c06C\u8bed\u8a00\u7a0b\u5e8f\u4ee3\u7801\u201c\u7ffb\u8bd1\u201d\u6210\u4e3a\u673a\u5668\u8bed\u8a00\u4ee3\u7801\uff0c\u5c06Java\u8bed\u8a00\u7a0b\u5e8f\u4ee3\u7801\u201c\u7ffb\u8bd1\u201d\u6210\u4e3a\u673a\u5668\u8bed\u8a00\u4ee3\u7801\u3002<br \/>Hanjst\u6c49\u5409\u65af\u7279\ud83d\ude4b\u4e5f\u505a\u4e86\u7c7b\u4f3c\u7684\u5de5\u4f5c\u3002\u6574\u4e2a\u7ffb\u8bd1\u903b\u8f91\u8fc7\u7a0b\u5982\u4e0b\uff1a<\/p>\n<p>Hanjst\u6a21\u677f\u8bed\u8a00\u4ee3\u7801 &#8211;&gt; \uff08\u7ffb\u8bd1\u8fc7\u7a0b\uff09 &#8211;&gt; JavaScript \u8bed\u8a00\u7a0b\u5e8f\u4ee3\u7801 &#8211;&gt; \uff08\u7ffb\u8bd1\u8fc7\u7a0b\uff09 &#8211;&gt; \u673a\u5668\u8bed\u8a00\u4ee3\u7801<\/p>\n<p>\u8fd9\u5176\u4e2d\u7684\u201c\u7ffb\u8bd1\u8fc7\u7a0b\u201d\uff0c\u5c31\u662f\u7f16\u8bd1\u5668\u7684\u5de5\u4f5c\u8fc7\u7a0b\uff0c\u8d1f\u8d23\u8bfb\u5165\u539f\u8bed\u8a00\u4ee3\u7801\uff0c\u7ecf\u8fc7\u4e00\u7cfb\u5217\u7684\u8f6c\u6362\u89c4\u5219\u8fc7\u6ee4\u4e0e\u7ea6\u675f\u548c\u6539\u5934\u6362\u9762\u7684\u64cd\u4f5c\u6b65\u9aa4\uff0c\u6700\u7ec8\u8f93\u51fa\u53ef\u4f9b\u6267\u884c\u7684\u76ee\u6807\u8bed\u8a00\u4ee3\u7801\u7a0b\u5e8f\u3002<br \/>\u5982\u679c\u6240\u751f\u6210\u7684\u76ee\u6807\u4ee3\u7801\u7a0b\u5e8f\u662f\u9759\u6001\u7684\u6587\u4ef6\u7a0b\u5e8f\u4ee3\u7801\uff0c\u79f0\u4e4b\u4e3a\u9759\u6001\u8bed\u8a00\uff0c\u5982\u679c\u4eceabc.c \u7a0b\u5e8f\u539f\u4ee3\u7801\u5230\u53ef\u6267\u884c\u7684 abc.out.exe \u7a0b\u5e8f\u6587\u4ef6\u3002<br \/>\u5bf9\u5e94\u7684\uff0c\u5982\u679c\u6240\u751f\u6210\u7684\u76ee\u6807\u7a0b\u5e8f\u662f\u4e34\u65f6\u7684\u5185\u5b58\u6001\u6216\u8005\u5176\u4ed6\u8fc7\u7a0b\u6027\u4e34\u65f6\u6587\u4ef6\uff0c\u5219\u79f0\u4e4b\u4e3a\u89e3\u91ca\u578b\u8bed\u8a00\uff0c\u6216\u8005 \u52a8\u6001\u8bed\u8a00\uff0c\u5982\u76f4\u63a5\u6267\u884c abc.js \u6216\u8005 abc.pl \u7b49\uff0c\u5176\u7f16\u8bd1\u540e\u7684\u4e34\u65f6\u6587\u4ef6\u53ea\u5728\u8fd0\u884c\u65f6\u5b58\u5728\uff0c\u6267\u884c\u5b8c\u4e86\u6216\u7f13\u5b58\u4e0b\u6765\u6216\u5c31\u76f4\u63a5\u88ab\u629b\u5f03\u4e86\u3002<br \/>\u6574\u4e2a\u94fe\u6761\u4e2d\uff0cHanjst\u6c49\u5409\u65af\u7279\u53ea\u662f\u505a\u4e86\u7b2c\u4e00\u4e2a\u7ffb\u8bd1\u8fc7\u7a0b\uff0c\u7b2c\u4e8c\u4e2a\u7ffb\u8bd1\u8fc7\u7a0b\u901a\u5e38\u662f\u6709\u6d4f\u89c8\u5668\u81ea\u5e26\u7684 JavaScript\u7f16\u8bd1\u548c\u6267\u884c\u5f15\u64ce\u6765\u5b8c\u6210\uff0c\u6bd4\u5982 \u5728 Google Chrome\u7b49\u6d4f\u89c8\u5668\u4e2d\u7528\u5230\u7684 JavaScript V8 \u5f15\u64ce (\u00a0https:\/\/v8.dev\/ )\u3002<\/p>\n<blockquote>\n<h1>What is V8?<\/h1>\n<p>V8 is Google\u2019s open source high-performance JavaScript and WebAssembly engine, written in C++. It is used in Chrome and in Node.js, among others. It implements\u00a0<a href=\"https:\/\/tc39.es\/ecma262\/\">ECMAScript<\/a>\u00a0and\u00a0<a href=\"https:\/\/webassembly.github.io\/spec\/core\/\">WebAssembly<\/a>, and runs on Windows 7 or later, macOS 10.12+, and Linux systems that use x64, IA-32, ARM, or MIPS processors. V8 can run standalone, or can be embedded into any C++ application.<\/p>\n<\/blockquote>\n<p>\u5982\u679c\u4e8b\u60c5\u518d\u5f80\u590d\u6742\u65b9\u5411\u7ee7\u7eed\u53d1\u5c55\uff0c\u6211\u4eec\u5c06\u4e0d\u5f97\u4e0d\u9762\u4e34\u5347\u7ea7 Hanjst\u6c49\u5409\u65af\u7279\u7684\u7f16\u8bd1\u5f15\u64ce\u5230\u901a\u7528\u7f16\u8bd1\u5668\u7684\u903b\u8f91\u90a3\u6837\uff1a<br \/>1)\u8bcd\u6cd5\u5206\u6790 Lexical\u00a0 Analysis , <br \/>2)\u8bed\u6cd5\u5206\u6790 Syntax Anaylsis,<br \/>3) \u8bed\u4e49\u5206\u6790 Semantic Analysis<br \/><img src=\"https:\/\/ufqi.com\/news\/view\/ueditor\/php\/upload\/image\/202111\/121636682088110223.png\" alt=\"\u7f16\u8bd1\u539f\u7406 \u9f99\u4e66 Compiler, Dragon Book-4\uff1a\u7b2c\u4e00\u7ae0\uff1a\u5f15\u8bba-2\" \/><\/p>\n<p>\u76ee\u524d\uff0cHanjst\u6c49\u5409\u65af\u7279\u5bf9\u6a21\u677f\u8bed\u8a00\u7684\u7ffb\u8bd1\u5c1a\u672a\u4ece\u6700\u57fa\u7840\u7684\u8bcd\u6cd5\u5206\u6790\uff0c\u800c\u662f\u8df3\u8fc7\u5c06\u7a0b\u5e8f\u4ee3\u7801\u8fdb\u884c\u201c\u6807\u7b7e\u5316\uff08Tokenized\uff09\u201d \u7684\u8fc7\u7a0b\uff0c\u4e0a\u6765\u5c31\u4ece\u8bed\u6cd5\u5206\u6790\u5165\u624b\uff0c\u9010\u884c\u5bf9\u6a21\u677f\u8bed\u53e5\u8fdb\u884c\u626b\u63cf\uff0c\u4f7f\u7528\u57fa\u4e8e\u5173\u952e\u8bcd\u7684\u6b63\u5219\u8868\u8fbe\u5f0f\u5bf9\u6a21\u677f\u8bed\u53e5\u8fdb\u884c\u8bed\u4e49\u5206\u6790\u3002\u7ecf\u5206\u6790\u662f\u5f53\u524d\u884c\u5305\u62ec\u6709 Hanjst\u6c49\u5409\u65af\u7279\u5b9a\u4e49\u7684\u8bed\u6cd5\u5173\u952e\u8bcd\u53ca\u76f8\u5e94\u8868\u8fbe\u5f0f\u65f6\uff0c\u505a\u5982\u4e0b\u8f6c\u6362\uff1a<\/p>\n<p>Hanjst\u6a21\u677f\u8bed\u8a00\u4ee3\u7801 &#8211;&gt; \uff08\u7ffb\u8bd1\u8fc7\u7a0b\uff09 &#8211;&gt; JavaScript \u8bed\u8a00\u7a0b\u5e8f\u4ee3\u7801\u00a0<\/p>\n<p>\u5982\u679c\u53d1\u73b0\uff0c\u5f53\u524d\u884c\u7684\u5185\u5bb9\u6ca1\u6709\u76f8\u5173\u5173\u952e\u8bcd\u53ca\u76f8\u5e94\u7684\u8868\u8fbe\u5f0f\u65f6\uff0c\u76f4\u63a5\u8df3\u8fc7\uff0c\u5c06\u5f53\u524d\u884c\u89c6\u4e3a\u4e00\u4e2a\u666e\u901a\u5e38\u91cf\u5b57\u7b26\u4e32\u6570\u636e\u3002<\/p>\n<p>\u66f4\u4e0a\u4e00\u5c42\u7684\u8bed\u4e49\u5206\u6790\u7684\u5b9e\u73b0\uff0c\u5219\u662f\u57fa\u4e8e\u8bed\u6cd5\u8bed\u53e5\u5206\u6790\u7684\u57fa\u7840\u4e0a\uff0c\u5bf9\u5305\u62ec\u6761\u4ef6\u63a7\u5236\u8bed\u53e5\u3001\u5faa\u73af\u3001\u9000\u51fa\u7b49\u60c5\u51b5\u7684\u5904\u7406\uff0c\u9700\u8981\u8fdb\u884c\u7ed3\u675f\u6761\u4ef6\u63a7\u5236\u3001\u5173\u95ed\u5faa\u73af\u7b49\u8bed\u4e49\u5c42\u7684\u64cd\u4f5c\u65f6\uff0c\u6839\u636e\u4e00\u4e2a\u7ed3\u6784\u6570\u636e\u8868\u6765\u8fdb\u884c\u4e00\u4e00\u5bf9\u5e94\u8865\u5168\u3002<br \/>\u8fd9\u6837\u7684\u7ed3\u6784\u8bbe\u8ba1\u53ef\u4ee5\u5e94\u4ed8\u8bf8\u5982\u6a21\u677f\u8bed\u8a00\u8fd9\u6837\u7684\u7b80\u5355\u8868\u8fbe\uff0c\u540c\u65f6\u4e5f\u907f\u514d\u4e0a\u6765\u5c31\u8fdb\u884cTokenized \u7684\u8ba1\u7b97\u5f00\u9500\uff0c\u53ef\u80fd\u662f\u56e0\u5730\u5236\u5b9c\u7684\u5e73\u8861\u4e4b\u9053\u5427\u3002<\/p>\n<p>\u7136\u800c\uff0c\u5982\u679c\u518d\u590d\u6742\u4e00\u4e9b\u7684\u60c5\u51b5\uff0c\u6bd4\u5982 Hanjst\u6c49\u5409\u65af\u7279\u8fd9\u6b21\u4fee\u6539\u7684\u4e00\u4e2a\u91cd\u70b9\u5c31\u662f\u517c\u5bb9\u884c\u5982\u4e0b\u9762\u7684\u6ce8\u91ca\u884c\uff0c<\/p>\n<p>const aString = \u201ca-string-sample&#8221;; \/\/- \u58f0\u660e\u4e00\u4e2aJavaScript\u5b57\u7b26\u4e32\u53d8\u91cf<\/p>\n<p>\u867d\u7136\u51e0\u7ecf\u5468\u6298\uff0c\u7ed3\u5408\u5173\u952e\u8bcd\u548c\u6b63\u5219\u8868\u8fbe\u5f0f\u6210\u529f\u5728\u4e00\u4e9b\u5e94\u7528\u573a\u666f\u5b9e\u73b0\u4e86\u9884\u671f\u76ee\u6807\uff0c\u4f46\u4e5f\u662f\u903c\u4ec4\u5f0f\u7684\u91c7\u7528\u4e86\u5404\u79cd\u201c\u5947\u6280\u6deb\u5de7\u201d\u2014\u2014\u7ecf\u9a8c\u4e0a\u770b\uff0c\u7ea6\u675f\u6761\u4ef6\u8d8a\u591a\uff0c\u5176\u666e\u9002\u6027\u5c31\u4f1a\u8d8a\u5dee\uff0c\u751a\u81f3\u53ef\u4ee5\u9047\u89c1\uff0c\u8fd8\u6709\u6211\u4eec\u65e0\u6cd5\u611f\u77e5\u5230\u7684\u573a\u666f\u672a\u88ab\u8986\u76d6\uff0c\u201c\u9ed1\u5929\u9e45\u201d\u4e5f\u8bb8\u5c31\u5728\u8fdc\u65b9\u3002<br \/>\u8fd9\u4e5f\u8bb8\u5c31\u662f\u5f52\u7eb3\u6cd5\u8303\u5f0f\u5929\u7136\u7684\u7f3a\u9677\u3002<\/p>\n<p>\u4e5f\u8bb8\uff0c\u5f53\u4e0b\u4e00\u53ea\u201c\u9ed1\u5929\u9e45\u201d\u518d\u51fa\u73b0\u65f6\uff0c\u5c31\u89e6\u53ca\u6211\u4eec\u5f53\u524d\u7b97\u6cd5\u80cc\u540e\u7684\u6781\u9650\uff0c\u4e0d\u5f97\u4e0d\u4f7f\u7528\u300a\u7f16\u8bd1\u539f\u7406\u300b\u4e2d\u7684\u540d\u95e8\u6b63\u6d3e\u7684\u529f\u592b\u6765\u5e94\u5bf9\u66f4\u52a0\u590d\u6742\u7684\u573a\u666f\uff0c\u4ee5\u6f14\u7ece\u3001\u63a8\u7406\u7684\u5f62\u5f0f\u5f7b\u5e95\u89e3\u51b3\u65e0\u7a77\u5c3d\u7684\u5e94\u7528\u573a\u666f\u3002<\/p>\n<p>1)\u8bcd\u6cd5\u5206\u6790 Lexical\u00a0 Analysis , &#8211;&gt; \u6807\u7b7e\u6d41Tokens Stream<br \/>2)\u8bed\u6cd5\u5206\u6790 Syntax Analysis, &#8211;&gt; \u8bed\u6cd5\u6811 Syntax Tree<br \/>3) \u8bed\u4e49\u5206\u6790 Semantic Analysis &#8211;&gt; \u8bed\u6cd5\u6811 Syntax Tree.<\/p>\n<p>\u9644\u52a01:<br \/>\u6765\u81eaJavaScript V8 Engine\u7684\u9875\u9762JavaScipt\u63d0\u901f\u4f18\u5316\u5efa\u8bae<br \/>1)\u00a0<strong>Improve download time,\u00a0<\/strong>\u63d0\u9ad8JavaScript\u7684\u811a\u6b65\u7a0b\u5e8f\u4e0b\u8f7d\u901f\u5ea6\uff0c\u4e00\u822c\u4e0d\u8981\u8d85\u8fc7 50KB , \u518d\u5927\u4e86\u5c31\u62c6\u5c0f\u70b9\uff0c \u5bf9\u79fb\u52a8\u7aef\u5c24\u5176\u8d8a\u8981\u518d\u5c0f\u4e9b\u3002<\/p>\n<p>2)\u00a0<strong>Improve execution time, <\/strong>\u63d0\u5347\u6267\u884c\u901f\u5ea6\uff0c\u907f\u514d\u5728\u4e3b\u7ebf\u7a0b\u4e2d\u653e\u5165 Long tasks. \u8fd9\u6837\u624d\u80fd\u63d0\u5347\u9875\u9762\u6e32\u67d3\u901f\u5ea6\uff0c\u5c3d\u65e9\u5448\u73b0\u51fa\u6765\u3002<br \/>Long tasks \u662f\u90a3\u4e9b\u6267\u884c\u65f6\u95f4\u8d85\u8fc7 50ms \u7684\u4efb\u52a1\uff0cHanjst\u6c49\u5409\u65af\u7279\u5b8c\u6210\u7ffb\u8bd1\u4e00\u4e2a\u4e2d\u7b49\u590d\u6742\u7a0b\u5ea6\u7684\u9875\u9762\u6267\u884c\u65f6\u95f4\u901a\u5e38\u5728 30ms\u5de6\u53f3\u3002<\/p>\n<blockquote>\n<h3 id=\"long_task\"><a title=\"Permalink to Long task\" href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/API\/Long_Tasks_API#long_task\">Long task<\/a><\/h3>\n<div>\n<p>Any uninterrupted period where the main UI thread is busy for 50 ms or longer. Common examples include:<\/p>\n<ul>\n<li>Long running event handlers.<\/li>\n<li>Expensive reflows and other re-renders.<\/li>\n<li>Work the browser does between different turns of the event loop that exceeds 50 ms.<\/li>\n<\/ul>\n<\/div>\n<\/blockquote>\n<p>3)\u00a0<strong>Avoid large inline scripts,\u00a0<\/strong>\u907f\u514d\u9875\u9762\u5185\u76f4\u63a5\u4e66\u5199\u592a\u957fJavaScript\u7a0b\u5e8f\u4ee3\u7801\uff0c\u5982\u679c\u5185\u5d4c\u4ee3\u7801\u957f\u5ea6\u8d85\u8fc7 1KB\uff0c\u5c31\u8003\u8651\u5c06\u5176\u79fb\u5165\u67d0\u4e2a .js \u7a0b\u5e8f\u6587\u4ef6\u4e2d\u3002<\/p>\n<p>4) JSON parse is faster than Object, \u8fd9\u4f3c\u4e4e\u8d85\u51fa\u666e\u901a\u8ba4\u77e5\u4e86&#8230;<\/p>\n<pre class=\"language-js\"><code class=\"language-js\"><span class=\"token keyword\">const<\/span> data <span class=\"token operator\">=<\/span> <span class=\"token punctuation\">{<\/span> foo<span class=\"token operator\">:<\/span> <span class=\"token number\">42<\/span><span class=\"token punctuation\">,<\/span> bar<span class=\"token operator\">:<\/span> <span class=\"token number\">1337<\/span> <span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">;<\/span> <span class=\"token comment\">\/\/ \ud83d\udc0c<\/span><\/code><\/pre>\n<pre class=\"language-js\"><code class=\"language-js\"><span class=\"token keyword\">const<\/span> data <span class=\"token operator\">=<\/span> <span class=\"token constant\">JSON<\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">parse<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">'{\"foo\":42,\"bar\":1337}'<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span> <span class=\"token comment\">\/\/ \ud83d\ude80<\/span><\/code><\/pre>\n<hr \/>\n<p>Hanjst \u6c49\u5409\u65af\u7279 2021\u5e74\u8fd1\u4e00\u5e74\u6765\u7684\u4e3b\u8981\u66f4\u65b0\u6458\u8981:<\/p>\n<p>* 09:08 2021-03-17, imprvs for debug in mobile browsers, +support for if conditionExpr<br \/> * 17:09 2021-04-26, + _enSafeExprAsCondition .<br \/> * 21:32 2021-05-19, bugfix for remedyMemoLine .<br \/> * 12:31 2021-05-21, bugfix for &amp;amp; .<br \/> * 09:04 2021-06-07, add more _enSafeExpr .<br \/> * 21:51 2021-06-29, +comment: use Firefox to figure out exact error lineNumber and columnNumber in tpl2code in new Function<br \/> * 21:55 2021-11-11, imprvs for remedyMemoLine<\/p>\n<p>\u66f4\u591a\u53c2\u8003 Hanjst\u6c49\u5409\u65af\u7279\u5b98\u7f51\uff1ahttps:\/\/ufqi.com\/dev\/hanjst\/<\/p>\n<p>&nbsp;<\/p>\n<hr \/>\n<p><img loading=\"lazy\" class=\"\" src=\"https:\/\/ufqi.com\/dev\/hanjst\/hanjst-logo.2020.v2.png\" alt=\"Hanjst\" width=\"366\" height=\"161\" \/><br \/>Hanjst \u6c49\u5409\u65af\u7279 Logo<\/p>\n<p><span class=\"emoji\">\ud83d\ude4b<\/span>Hanjst\u6c49\u5409\u65af\u7279 \u662f\u4e00\u79cd\u57fa\u4e8eJavaScript\u7684\u6a21\u677f\u8bed\u8a00\u53ca\u6a21\u7248\u89e3\u6790\u5f15\u64ce\uff0c\u5979\u8fd0\u884c\u5728\u5ba2\u6237\u7aef\u6216\u670d\u52a1\u5668\u7aef\u3002<\/p>\n<p>\ud83d\ude4bHanjst\u6c49\u5409\u65af\u7279 \u80fd\u591f\u8868\u8ff0\u903b\u8f91\u63a7\u5236\uff0c\u80fd\u591f\u5b9e\u73b0\u4e0e\u670d\u52a1\u5668\u7aef\u6a21\u7248\u8bed\u8a00\u76f8\u540c\u7684\u5f3a\u5927\u529f\u80fd\u3002<\/p>\n<ul>\n<li>\n<p>Hanjst\u5f53\u5b8c\u5168\u5728\u5ba2\u6237\u7aef\u89e3\u6790\u65f6\uff0c\u8282\u7701\u670d\u52a1\u5668\u7aef\u8ba1\u7b97\u8d44\u6e90;<\/p>\n<\/li>\n<li>\n<p>Hanjst\u6a21\u677f\u8bed\u8a00\u72ec\u7acb\uff0c\u4e0d\u4e0e\u670d\u52a1\u5668\u7aef\u8d44\u6e90\u505a\u4efb\u4f55\u7ed1\u5b9a\uff1b<\/p>\n<\/li>\n<li>\n<p>\u7eaf\u7cb9\u7684MVC\uff0c\u5c42\u95f4\u6570\u636e\u7528JSON\u683c\u5f0f\u4f20\u9012\uff1b<\/p>\n<\/li>\n<li>\n<p>\u5e38\u89c1\u6a21\u677f\u8bed\u8a00\u529f\u80fd\u5168\u652f\u6301\uff0c\u9644\u5e26\u590d\u6742\u800c\u5f3a\u5927\u7684JavaScript\u7f16\u7a0b\u80fd\u529b\uff1b<\/p>\n<\/li>\n<li>\n<p>\u65e0\u5b66\u4e60\u6210\u672c\uff0c\u76f4\u63a5\u4f7f\u7528JavaScript\u4e66\u5199\u6a21\u677f\u8bed\u8a00\uff1b<\/p>\n<\/li>\n<li>\n<p>\u2026.<\/p>\n<\/li>\n<\/ul>\n<p>Hanjst is a JavaScript-based templating language and parsing engine that runs on both the client-side and\/or server-side.<\/p>\n<p>Hanjst can express logical controls and achieve the same functionalities as the server-side templating languages.<\/p>\n<ul>\n<li>\n<p>Hanjst\u2019s Run-time in client-side, reduce computing render in server-side;<\/p>\n<\/li>\n<li>\n<p>Hanjst is Language-independent, not-bound with back-end scripts or languages;<\/p>\n<\/li>\n<li>\n<p>Totally-isolated between MVC, data transfer with JSON;<\/p>\n<\/li>\n<li>\n<p>Full-support template tags with built-in logic and customized JavaScript functions;<\/p>\n<\/li>\n<li>\n<p>No more tags languages to be learned, just JavaScript;<\/p>\n<\/li>\n<li>\n<p>\u2026.<\/p>\n<\/li>\n<\/ul>\n<blockquote class=\"wp-embedded-content\" data-secret=\"3nIOqyvceX\"><p><a href=\"https:\/\/ufqi.com\/blog\/hanjst-imprv-202111-with-memoline\/\">Hanjst\u6c49\u5409\u65af\u7279\ud83d\ude4b\u4e0e\u9f99\u4e66\u7f16\u8bd1\u539f\u7406<\/a><\/p><\/blockquote>\n<p><iframe class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" src=\"https:\/\/ufqi.com\/blog\/hanjst-imprv-202111-with-memoline\/embed\/#?secret=3nIOqyvceX\" data-secret=\"3nIOqyvceX\" width=\"600\" height=\"338\" title=\"\u300aHanjst\u6c49\u5409\u65af\u7279\ud83d\ude4b\u4e0e\u9f99\u4e66\u7f16\u8bd1\u539f\u7406\u300b\u2014-UFQI-Blog\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u65f6\u95f4\u8fc7\u5f97\u65f6\u800c\u98de\u5feb\uff0c\u65f6\u800c\u7f13\u6162\u3002\u6211\u4eec\u4eba\u7c7b\u5df2\u7ecf\u4e0e\u65b0\u51a0\u80ba\u708e\u75ab\u60c5\u594b\u6218\u4e86\u5feb\u4e24\u5e74\u4e86\uff0c\u597d\u6d88\u606f\u662f\u968f &hellip; <a href=\"https:\/\/ufqi.com\/blog\/hanjst-imprv-202111-with-memoline\/\">\u7ee7\u7eed\u9605\u8bfb <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[96,301,6,2],"tags":[440,293,294,441,439],"_links":{"self":[{"href":"https:\/\/ufqi.com\/blog\/wp-json\/wp\/v2\/posts\/2640"}],"collection":[{"href":"https:\/\/ufqi.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ufqi.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ufqi.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/ufqi.com\/blog\/wp-json\/wp\/v2\/comments?post=2640"}],"version-history":[{"count":4,"href":"https:\/\/ufqi.com\/blog\/wp-json\/wp\/v2\/posts\/2640\/revisions"}],"predecessor-version":[{"id":2644,"href":"https:\/\/ufqi.com\/blog\/wp-json\/wp\/v2\/posts\/2640\/revisions\/2644"}],"wp:attachment":[{"href":"https:\/\/ufqi.com\/blog\/wp-json\/wp\/v2\/media?parent=2640"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ufqi.com\/blog\/wp-json\/wp\/v2\/categories?post=2640"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ufqi.com\/blog\/wp-json\/wp\/v2\/tags?post=2640"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}