{"id":272200,"date":"2023-05-21T09:00:28","date_gmt":"2023-05-21T01:00:28","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=272200"},"modified":"2023-05-18T09:51:32","modified_gmt":"2023-05-18T01:51:32","slug":"many-performance-improvements","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/many-performance-improvements.html","title":{"rendered":"Ruby 3.3.0-preview1\u53d1\u5e03,\u8fdb\u884c\u4e86\u8bb8\u591a\u6027\u80fd\u6539\u8fdb"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\nRuby 3.3.0-preview1\u7684\u53d1\u5e03\u3002 Ruby 3.3\u589e\u52a0\u4e86\u4e00\u4e2a\u65b0\u7684\u540d\u4e3aRJIT\u7684\u7eafRuby JIT\u7f16\u8bd1\u5668\uff0c\u4f7f\u7528Lrama\u4f5c\u4e3a\u5206\u6790\u5668\u751f\u6210\u5668\uff0c\u5e76\u7279\u522b\u5bf9YJIT\u8fdb\u884c\u4e86\u8bb8\u591a\u6027\u80fd\u6539\u8fdb\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\"\"<\/p>\n

RJIT<\/strong><\/div>\n
    \n
  1. \u5f15\u5165\u4e86\u4e00\u4e2a\u7eafRuby JIT\u7f16\u8bd1\u5668RJIT\u5e76\u53d6\u4ee3\u4e86MJIT\u3002<\/li>\n
  2. RJIT\u53ea\u652f\u6301Unix\u5e73\u53f0\u4e0a\u7684x86_64\u67b6\u6784\u3002<\/li>\n
  3. \u4e0eMJIT\u4e0d\u540c\uff0c\u5b83\u5728\u8fd0\u884c\u65f6\u4e0d\u9700\u8981C\u7f16\u8bd1\u5668\u3002<\/li>\n
  4. RJIT\u7684\u5b58\u5728\u53ea\u662f\u4e3a\u4e86\u8bd5\u9a8c\u6027\u7684\u76ee\u7684\u3002<\/li>\n
  5. \u4f60\u5e94\u8be5\u5728\u751f\u4ea7\u4e2d\u7ee7\u7eed\u4f7f\u7528 YJIT\u3002<\/li>\n
  6. \u5982\u679c\u4f60\u5bf9\u4e3aRuby\u5f00\u53d1JIT\u611f\u5174\u8da3\uff0c\u8bf7\u67e5\u770bk0kubun\u5728RubyKaigi\u7b2c\u4e09\u5929\u7684\u6f14\u8bb2\u3002<\/li>\n
  7. \u4f7f\u7528Lrama\u800c\u4e0d\u662fBison<\/li>\n
  8. \u7528Lrama LALR\u5206\u6790\u5668\u751f\u6210\u5668\u4ee3\u66ffBison Feature #19637<\/li>\n
  9. \u5982\u679c\u4f60\u6709\u5174\u8da3\uff0c\u8bf7\u770bRuby\u89e3\u6790\u5668\u7684\u672a\u6765\u613f\u666f<\/li>\n<\/ol>\n
    YJIT<\/strong><\/div>\n
      \n
    1. \u6bd43.2\u6709\u4e86\u660e\u663e\u7684\u6027\u80fd\u6539\u8fdb<\/li>\n
    2. \u5bf9Splat\u548crest\u53c2\u6570\u7684\u652f\u6301\u5f97\u5230\u4e86\u6539\u8fdb\u3002<\/li>\n
    3. \u4e3a\u865a\u62df\u673a\u7684\u5806\u6808\u64cd\u4f5c\u5206\u914d\u4e86\u5bc4\u5b58\u5668\u3002<\/li>\n
    4. \u66f4\u591a\u5e26\u6709\u53ef\u9009\u53c2\u6570\u7684\u8c03\u7528\u88ab\u7f16\u8bd1\u4e86\u3002<\/li>\n
    5. Integer#!=, String#!=, Kernel#block_given?, Kernel#is_a?, Kernel#instance_of?, Module#===\u88ab\u7279\u522b\u4f18\u5316\u3002<\/li>\n
    6. \u5b9e\u4f8b\u53d8\u91cf\u4e0d\u518d\u5411\u89e3\u91ca\u5668\u8f93\u51fa\u5de8\u5f62\u5bf9\u8c61\u7684\u5f62\u72b6\u3002<\/li>\n
    7. \u7f16\u8bd1\u4ee3\u7801\u7684\u5143\u6570\u636e\u4f7f\u7528\u4e86\u66f4\u5c11\u7684\u5185\u5b58\u3002<\/li>\n
    8. \u6539\u8fdb\u4e86ARM64\u4e0a\u7684\u4ee3\u7801\u751f\u6210<\/li>\n
    9. \u53ef\u4ee5\u9009\u62e9\u5728\u6682\u505c\u6a21\u5f0f\u4e0b\u542f\u52a8YJIT\uff0c\u4e4b\u540e\u518d\u624b\u52a8\u542f\u7528\u5b83<\/li>\n
    10. \u2013yjit-pause \u548c RubyVM::YJIT.resume<\/li>\n
    11. \u8fd9\u53ef\u4ee5\u7528\u6765\u5728\u4f60\u7684\u5e94\u7528\u7a0b\u5e8f\u5b8c\u6210\u542f\u52a8\u540e\u624d\u542f\u7528YJIT\u3002<\/li>\n
    12. \u9000\u51fa\u8ffd\u8e2a\u9009\u9879\u73b0\u5728\u652f\u6301\u91c7\u6837<\/li>\n
    13. \u2013trace-exits-sample-rate=N<\/li>\n
    14. \u591a\u4e2a\u9519\u8bef\u4fee\u590d<\/li>\n<\/ol>\n
      \u5176\u4ed6\u503c\u5f97\u6ce8\u610f\u7684\u65b0\u529f\u80fd<\/strong><\/div>\n
      \u6027\u80fd\u6539\u8fdb<\/strong><\/span><\/div>\n

      define?(@ivar)\u5728\u4f7f\u7528\u5bf9\u8c61\u5f62\u72b6\u65f6\u8fdb\u884c\u4e86\u4f18\u5316\u3002<\/p>\n

      \u81ea3.2\u4ee5\u6765\u5176\u4ed6\u503c\u5f97\u6ce8\u610f\u7684\u53d8\u5316<\/p>\n

      \u517c\u5bb9\u6027\u95ee\u9898<\/strong><\/span><\/div>\n

      \u6ce8\u610f\uff1a\u4e0d\u5305\u62ec\u529f\u80fd\u9519\u8bef\u7684\u4fee\u590d\u3002<\/p>\n

      \u79fb\u9664\u7684\u5e38\u91cf<\/strong><\/span><\/div>\n

      \u4ee5\u4e0b\u5e9f\u5f03\u7684\u5e38\u91cf\u5df2\u88ab\u5220\u9664\u3002<\/p>\n

      \u79fb\u9664\u7684\u65b9\u6cd5<\/strong><\/span><\/div>\n

      \u5220\u9664\u4e86\u4ee5\u4e0b\u5e9f\u5f03\u7684\u65b9\u6cd5\u3002<\/p>\n

      Stdlib\u517c\u5bb9\u6027\u95ee\u9898<\/strong><\/span><\/div>\n

      ext\/readline\u5df2\u7ecf\u9000\u5f79<\/p>\n

      \u6211\u4eec\u6709reline\uff0c\u5b83\u662f\u4e0eext\/readline API\u517c\u5bb9\u7684\u7eafRuby\u5b9e\u73b0\u3002\u6211\u4eec\u5728\u672a\u6765\u4f9d\u9760reline\u3002\u5982\u679c\u4f60\u9700\u8981\u4f7f\u7528ext\/readline\uff0c\u4f60\u53ef\u4ee5\u901a\u8fc7rubygems.org\u7528gem install readline-ext\u6765\u5b89\u88c5ext\/readline\u3002
      \n\u6211\u4eec\u4e0d\u518d\u9700\u8981\u5b89\u88c5 libreadline \u6216 libedit \u7b49\u5e93\u3002<\/p>\n

      C\u8bed\u8a00API\u66f4\u65b0<\/strong><\/span><\/div>\n

      \u66f4\u65b0\u7684 C \u8bed\u8a00 API<\/p>\n

      \u4ee5\u4e0b API \u5df2\u88ab\u66f4\u65b0\u3002<\/p>\n

      \u79fb\u9664\u7684 C \u8bed\u8a00 API<\/strong><\/span><\/div>\n

      \u5220\u9664\u4e86\u4ee5\u4e0b\u5e9f\u5f03\u7684API\u3002<\/p>\n

      \u6807\u51c6\u5e93\u66f4\u65b0<\/strong><\/span><\/div>\n

      \u66f4\u65b0\u4e86\u4ee5\u4e0b\u9ed8\u8ba4\u5b9d\u77f3\u3002<\/p>\n

        \n
      1. RubyGems 3.5.0.dev<\/li>\n
      2. bigdecimal 3.1.4<\/li>\n
      3. bundler 2.5.0.dev<\/li>\n
      4. csv 3.2.7<\/li>\n
      5. fiddle 1.1.2<\/li>\n
      6. fileutils 1.7.1<\/li>\n
      7. irb 1.6.4<\/li>\n
      8. optparse 0.4.0.pre.1<\/li>\n
      9. \u5fc3\u7406\u5b66 5.1.0<\/li>\n
      10. \u7edb\u7ea2 0.3.3<\/li>\n
      11. stringio 3.0.7<\/li>\n
      12. strscan 3.0.7<\/li>\n
      13. \u8bed\u6cd5\u5efa\u8bae 1.0.4<\/li>\n
      14. \u65f6\u95f4 0.2.2<\/li>\n
      15. \u8d85\u65f6 0.3.2<\/li>\n
      16. uri 0.12.1<\/li>\n<\/ol>\n

        \u4ee5\u4e0b\u6346\u7ed1\u7684gems \u5df2\u7ecf\u66f4\u65b0\u3002<\/strong><\/p>\n

          \n
        1. minitest 5.18.0<\/li>\n
        2. rbs 3.1.0<\/li>\n
        3. typeprof 0.21.7<\/li>\n
        4. debug 1.8.0<\/li>\n<\/ol>\n

          \u52a0\u4e0a\u8fd9\u4e9b\u53d8\u5316\uff0c\u81eaRuby 3.2.0\u4ee5\u6765\uff0c\u67091922\u4e2a\u6587\u4ef6\u88ab\u6539\u53d8\uff0c75283\u4e2a\u63d2\u5165\uff08+\uff09\uff0c44896\u4e2a\u5220\u9664\uff08-\uff09!<\/p>\n

          Download<\/strong><\/div>\n
            \n
          1. https:\/\/cache.ruby-lang.org\/pub\/ruby\/3.3\/ruby-3.3.0-preview1.tar.gz<\/li>\n
            SIZE: 20428213\r\nSHA1: 5445eec1cd9ddb44e03e74568cac94209c91b42d\r\nSHA256: c3454a911779b8d747ab0ea87041030d002d533edacb2485fe558b7084da25ed\r\nSHA512: 0f891f140ddc6372aa7c4459f8784126e0c341db7b80e72c51e441c5153c43c2d7b965f7807c076862ac84b9b8b0c6a66bbf66fc341746016151397bb21c782a<\/pre>\n
          2. https:\/\/cache.ruby-lang.org\/pub\/ruby\/3.3\/ruby-3.3.0-preview1.tar.xz<\/li>\n
            SIZE: 15074600\r\nSHA1: 4c22ebca287c87811e1050bf4d59b7d32255b212\r\nSHA256: ae300b49e06c13087dd163b97eddd38db895dc8e0c9904284119795d75303fbb\r\nSHA512: 46c1134dba5810847f7f6b4298900a91f5225679d7873548b271f4ef2ad1dc168722562a2e468a2ccf136314176ee613d8c7792fd4411a3f7a44c80b93b417ee<\/pre>\n
          3. https:\/\/cache.ruby-lang.org\/pub\/ruby\/3.3\/ruby-3.3.0-preview1.zip<\/li>\n
            SIZE: 24846962\r\nSHA1: 31774fa653c54107b6afc30adda3a0350d8f41d2\r\nSHA256: 6ecafecf83f2cacf446b2326012f2b6ee1a0614d8dd29bb1fb3f105c27e2c553\r\nSHA512: 794bef847fefbbdbbdced85975a00c9289ef6464810408af3f0f2055052d6b5ef5576dbd41e0d87bb73f1ad276d8e27c36018610f8e2b9936828c0e692f611f0<\/pre>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"

            \u5f15\u5165\u4e86\u4e00\u4e2a\u7eafRuby JIT\u7f16\u8bd1\u5668RJIT\u5e76\u53d6\u4ee3\u4e86MJIT\u3002 RJIT\u53ea\u652f\u6301Unix\u5e73\u53f0\u4e0a\u7684x86_64\u67b6\u6784\u3002 […]<\/p>\n","protected":false},"author":1481,"featured_media":272202,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[21],"tags":[],"class_list":["post-272200","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-news"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/272200","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/1481"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=272200"}],"version-history":[{"count":4,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/272200\/revisions"}],"predecessor-version":[{"id":272548,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/272200\/revisions\/272548"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/272202"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=272200"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=272200"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=272200"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}