{"id":99908,"date":"2022-07-07T11:02:45","date_gmt":"2022-07-07T02:02:45","guid":{"rendered":"https:\/\/softantenna.com\/blog\/?p=99908"},"modified":"2022-07-07T11:02:45","modified_gmt":"2022-07-07T02:02:45","slug":"python-3-11-faster","status":"publish","type":"post","link":"https:\/\/softantenna.com\/blog\/python-3-11-faster\/","title":{"rendered":"Python 3.11\u306fPython 3.10\u3088\u308a10\u301c60%\u9ad8\u901f"},"content":{"rendered":"<p><img decoding=\"async\" style=\"display:block; margin-left:auto; margin-right:auto;\" src=\"https:\/\/softantenna.com\/blog\/wp-content\/uploads\/2022\/07\/s_20220707_104059.jpg\" alt=\"S 20220707 104059\" title=\"s_20220707_104059.jpg\" border=\"0\" width=\"860\" height=\"560\" \/><\/p>\n<p>Python\u306e\u6b21\u671f\u30d0\u30fc\u30b8\u30e7\u30f3\u300cPython 3.11\u300d\u306f\u3001\u73fe\u884c\u306e\u300cPython 3.10\u300d\u3088\u308a<a href=\"https:\/\/docs.python.org\/3.11\/whatsnew\/3.11.html#faster-cpython\">\u5e73\u5747\u306725%\u9ad8\u901f<\/a>\u3067\u3042\u308b\u3053\u3068\u304c\u308f\u304b\u308a\u307e\u3057\u305f(<a href=\"https:\/\/www.reddit.com\/r\/programming\/comments\/vswllm\/python_311_is_up_to_1060_faster_than_python_310\/\">Reddit<\/a>)\u3002<\/p>\n<p>Ubuntu Linux\u4e0a\u3067GCC\u3092\u4f7f\u3063\u3066\u30b3\u30f3\u30d1\u30a4\u30eb\u3057\u3001pyperformance benchmark suite\u3067\u6e2c\u5b9a\u3057\u305f\u3068\u3053\u308d\u3001CPython 3.10\u3088\u308a\u5e73\u5747 25%\u901f\u304f\u306a\u308a\u3001\u4f5c\u696d\u8ca0\u8377\u306b\u3088\u3063\u3066\u306f\u3001\u6700\u5927\u306710\u301c60%\u9ad8\u901f\u5316\u3055\u308c\u308b\u53ef\u80fd\u6027\u304c\u3042\u308b\u3068\u306e\u3053\u3068\u3002<\/p>\n<p>\u30d9\u30f3\u30c1\u30de\u30fc\u30af\u306e\u7d50\u679c\u306f<a href=\"https:\/\/github.com\/faster-cpython\/ideas\/blob\/main\/main-vs-310.rst\">\u3053\u3061\u3089<\/a>\u3067\u78ba\u8a8d\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<p><img decoding=\"async\" style=\"display:block; margin-left:auto; margin-right:auto;\" src=\"https:\/\/softantenna.com\/blog\/wp-content\/uploads\/2022\/07\/s_20220707_104443.jpg\" alt=\"S 20220707 104443\" title=\"s_20220707_104443.jpg\" border=\"0\" width=\"957\" height=\"626\" \/><\/p>\n<p>Python 3.11\u3067\u306f\u3001\u8d77\u52d5\u306e\u9ad8\u901f\u5316\u3084\u3001\u30e9\u30f3\u30bf\u30a4\u30e0\u306e\u9ad8\u901f\u5316\u3001\u305d\u306e\u4ed6\u306e\u6700\u9069\u5316\u306b\u3088\u3063\u3066\u3001\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u306e\u5411\u4e0a\u304c\u56f3\u3089\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u8d77\u52d5\u6642\u9593\u3092\u9ad8\u901f\u5316\u3059\u308b\u305f\u3081\u3001Python 3.11\u3067\u306f\u3001Python\u306e\u8d77\u52d5\u306b\u4e0d\u53ef\u6b20\u306a\u30b3\u30a2\u30e2\u30b8\u30e5\u30fc\u30eb\u304c\u300c\u51cd\u7d50\u300d\u3055\u308c\u3001\u30b3\u30fc\u30c9\u30aa\u30d6\u30b8\u30a7\u30af\u30c8(\u304a\u3088\u3073\u30d0\u30a4\u30c8\u30b3\u30fc\u30c9)\u304c\u30a4\u30f3\u30bf\u30d7\u30ea\u30bf\u306b\u3088\u3063\u3066\u9759\u7684\u306b\u5272\u308a\u5f53\u3066\u3089\u308c\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u5b9f\u884c\u51e6\u7406\u306e\u30b9\u30c6\u30c3\u30d7\u304c\u77ed\u7e2e\u3055\u308c\u308b\u3053\u3068\u3067\u3001\u30a4\u30f3\u30bf\u30d7\u30ea\u30bf\u306e\u8d77\u52d5\u304c10-15%\u9ad8\u901f\u5316\u3057\u3066\u3044\u307e\u3059\u3002\u3053\u308c\u306f\u3001\u7279\u306b\u77ed\u6642\u9593\u5b9f\u884c\u3055\u308c\u308b\u30d7\u30ed\u30b0\u30e9\u30e0\u306b\u3068\u3063\u3066\u5927\u304d\u306a\u30a4\u30f3\u30d1\u30af\u30c8\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u307e\u305f\u3001\u30e9\u30f3\u30bf\u30a4\u30e0\u3082\u9ad8\u901f\u5316\u3055\u308c\u3066\u304a\u308a\u3001\u3053\u308c\u306b\u306f\u3001Python\u95a2\u6570\u3092\u547c\u3073\u51fa\u3059\u305f\u3073\u306b\u4f5c\u6210\u3055\u308c\u3001\u5b9f\u884c\u60c5\u5831\u3092\u4fdd\u6301\u3059\u308b\u30d5\u30ec\u30fc\u30e0\u306e\u4f5c\u6210\u51e6\u7406\u306e\u6539\u826f\u304c\u542b\u307e\u308c\u3066\u3044\u307e\u3059\u3002\u53e4\u3044\u30b9\u30bf\u30a4\u30eb\u306e\u30d5\u30ec\u30fc\u30e0\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306f\u3001\u307b\u3068\u3093\u3069\u4f5c\u6210\u3055\u308c\u306a\u304f\u306a\u308a\u3001Python\u95a2\u6570\u306e\u547c\u3073\u51fa\u3057\u304c\u5927\u5e45\u306b\u9ad8\u901f\u5316\u3055\u308c\u307e\u3057\u305f\u3002\u307e\u305f\u3001C\u30a4\u30f3\u30bf\u30d7\u30ea\u30bf\u95a2\u6570\u306e\u547c\u3073\u51fa\u3057\u3092\u56de\u907f\u3059\u308b\u3053\u3068\u3067\u3001Python\u306e\u30a4\u30f3\u30e9\u30a4\u30f3\u95a2\u6570\u306e\u547c\u3073\u51fa\u3057\u3082\u9ad8\u901f\u5316\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u307e\u305f\u4ee5\u4e0b\u306b\u793a\u3059\u6700\u9069\u5316\u3082\u884c\u308f\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<blockquote>\n<ul class=\"simple\">\n<li>\n<p>Compiler now optimizes simple C-style formatting with literal format<br \/>\ncontaining only format codes <code class=\"docutils literal notranslate\"><span class=\"pre\">%s<\/span><\/code>, <code class=\"docutils literal notranslate\"><span class=\"pre\">%r<\/span><\/code> and <code class=\"docutils literal notranslate\"><span class=\"pre\">%a<\/span><\/code> and makes it as<br \/>\nfast as corresponding f-string expression.<br \/>\n(Contributed by Serhiy Storchaka in <a class=\"reference external\" href=\"https:\/\/bugs.python.org\/issue?@action=redirect&amp;bpo=28307\">bpo-28307<\/a>.)<\/p>\n<\/li>\n<li>\n<p>\u201cZero-cost\u201d exceptions are implemented. The cost of <code class=\"docutils literal notranslate\"><span class=\"pre\">try<\/span><\/code> statements is<br \/>\nalmost eliminated when no exception is raised.<br \/>\n(Contributed by Mark Shannon in <a class=\"reference external\" href=\"https:\/\/bugs.python.org\/issue?@action=redirect&amp;bpo=40222\">bpo-40222<\/a>.)<\/p>\n<\/li>\n<li>\n<p>Pure ASCII strings are now normalized in constant time by <a class=\"reference internal\" href=\"..\/library\/unicodedata.html#unicodedata.normalize\" title=\"unicodedata.normalize\"><code class=\"xref py py-func docutils literal notranslate\"><span class=\"pre\">unicodedata.normalize()<\/span><\/code><\/a>.<br \/>\n(Contributed by Dong-hee Na in <a class=\"reference external\" href=\"https:\/\/bugs.python.org\/issue?@action=redirect&amp;bpo=44987\">bpo-44987<\/a>.)<\/p>\n<\/li>\n<li>\n<p><a class=\"reference internal\" href=\"..\/library\/math.html#module-math\" title=\"math: Mathematical functions (sin() etc.).\"><code class=\"xref py py-mod docutils literal notranslate\"><span class=\"pre\">math<\/span><\/code><\/a> functions <a class=\"reference internal\" href=\"..\/library\/math.html#math.comb\" title=\"math.comb\"><code class=\"xref py py-func docutils literal notranslate\"><span class=\"pre\">comb()<\/span><\/code><\/a> and <a class=\"reference internal\" href=\"..\/library\/math.html#math.perm\" title=\"math.perm\"><code class=\"xref py py-func docutils literal notranslate\"><span class=\"pre\">perm()<\/span><\/code><\/a> are now up<br \/>\nto 10 times or more faster for large arguments (the speed up is larger for<br \/>\nlarger <em>k<\/em>).<br \/>\n(Contributed by Serhiy Storchaka in <a class=\"reference external\" href=\"https:\/\/bugs.python.org\/issue?@action=redirect&amp;bpo=37295\">bpo-37295<\/a>.)<\/p>\n<\/li>\n<li>\n<p>Dict don\u2019t store hash value when all inserted keys are Unicode objects.<br \/>\nThis reduces dict size. For example, <code class=\"docutils literal notranslate\"><span class=\"pre\">sys.getsizeof(dict.fromkeys(\"abcdefg\"))<\/span><\/code><br \/>\nbecomes 272 bytes from 352 bytes on 64bit platform.<br \/>\n(Contributed by Inada Naoki in <a class=\"reference external\" href=\"https:\/\/bugs.python.org\/issue?@action=redirect&amp;bpo=46845\">bpo-46845<\/a>.)<\/p>\n<\/li>\n<li>\n<p><a class=\"reference internal\" href=\"..\/library\/re.html#module-re\" title=\"re: Regular expression operations.\"><code class=\"xref py py-mod docutils literal notranslate\"><span class=\"pre\">re<\/span><\/code><\/a>\u2019s regular expression matching engine has been partially refactored,<br \/>\nand now uses computed gotos (or \u201cthreaded code\u201d) on supported platforms. As a<br \/>\nresult, Python 3.11 executes the <a class=\"reference external\" href=\"https:\/\/pyperformance.readthedocs.io\/benchmarks.html#regex-dna\">pyperformance regular expression benchmarks<\/a> up to 10%<br \/>\nfaster than Python 3.10.<\/p>\n<\/li>\n<\/ul>\n<\/blockquote>\n<p>\u5f53\u521d10\u6708\u306b\u4e88\u5b9a\u3055\u308c\u3066\u3044\u305fPython 3.11\u306e\u30ea\u30ea\u30fc\u30b9\u304c\u9045\u308c\u308b\u306e\u3067\u306f\u306a\u3044\u304b\u3068\u306e<a href=\"https:\/\/softantenna.com\/blog\/python-3-11-release-delay-to-december\/\">\u60c5\u5831<\/a>\u3082\u6d41\u308c\u3066\u3044\u307e\u3059\u304c\u3001Python 3.11\u306f\u3001Python\u30e6\u30fc\u30b6\u30fc\u306b\u3068\u3063\u3066\u306f\u6ce8\u76ee\u306e\u30ea\u30ea\u30fc\u30b9\u3068\u306a\u308a\u305d\u3046\u3067\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Python\u306e\u6b21\u671f\u30d0\u30fc\u30b8\u30e7\u30f3\u300cPython 3.11\u300d\u306f\u3001\u73fe\u884c\u306e\u300cPython 3.10\u300d\u3088\u308a\u5e73\u5747\u306725%\u9ad8\u901f\u3067\u3042\u308b\u3053\u3068\u304c\u308f\u304b\u308a\u307e\u3057\u305f(Reddit)\u3002 Ubuntu Linux\u4e0a\u3067GCC\u3092\u4f7f\u3063\u3066\u30b3\u30f3\u30d1\u30a4\u30eb\u3057\u3001pyper [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":99909,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"swell_btn_cv_data":"","footnotes":""},"categories":[75],"tags":[703],"class_list":["post-99908","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-software","tag-python"],"_links":{"self":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/posts\/99908","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/comments?post=99908"}],"version-history":[{"count":0,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/posts\/99908\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/media\/99909"}],"wp:attachment":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/media?parent=99908"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/categories?post=99908"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/tags?post=99908"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}