Why is Python 3.7 fastest

Why is Python 3.7 fastest

CPython 3.7 버전이 릴리즈되면서 많은 성능 최적화가 이루어졌습니다.
파이썬 시작 시간이 최대 30% 감소했을 뿐 아니라 클래스의 함수 호출이 20% 빨라졌고, 15배 빨라진 asyncio, 7배 빨라진 typing 모듈, 자주쓰이는 함수인 sorted, dict.copy가 각각 40%, 5.5배 빨라졌으며 이외에도 다양한 부분에서 성능 개선이 이루어지면서 파이썬 3.7은 가장 빠른 CPython 버전이 되었습니다.
본 세션에선 코드 레벨, 필요하다면 C언어 구현단까지 들어가 이전코드와 개선된 코드를 비교하며 어떻게 극적인 또 전반적인 성능 개선이 이루어졌는지 알아봅니다.

레퍼런스 - https://docs.python.org/3/whatsnew/3.7.html#optimizations

22b02091761ba790122dd89436bce02c?s=128

Winter Jung

August 17, 2019
Tweet

Transcript

  1. PyCon Korea 2019 ౵੉ॆ 3.7 যଧ Ӓۧѱ ࡈۄ઎ա ੿ѹ਎

  2. !2 ডр જইೡ ࢎۈ݅ જইೡ ઱ઁ ߊ಴ ࣗѐ

  3. !3 ੉۠ ઱ઁ۽ ߊ಴ܳ ೞח ੉ਬ ߊ಴ ࣗѐ

  4. !4 ࢜ ߡ੹੉ ܾܻૉؼ ٸ݃׮ ୃѹࠁѱ غח What's New In

    Python 3.x ߊ಴ ࣗѐ
  5. !5 3.7 ੉੹ীب performance improvement৬ optimizationী ؀ೠ ೦ݾ਷ ઓ੤ ߊ಴

    ࣗѐ
  6. • 3~5ߓ ࡈۄ૓ os.walk() ೣࣻ • bytes(int) ѐࢶ • 10%

    ࡈۄ૓ ੿ӏ಴അध ౵य • 25% ࡈۄ૓ property() getter ഐ୹ • ١١ ੗ੜೠ ѐࢶ !6 Python 3.5 Optimizations ߊ಴ ࣗѐ
  7. • C۽ ҳഅೠ asyncio.Future, asyncio.Task • 30ߓ ࡅܲ typing ݽٕ

    • ~4ߓ ࡈۄ૓ os.scandir() !7 Python 3.6 Optimizations ߊ಴ ࣗѐ
  8. !8 3.7ীࢶ ௐ ૘য ঱әೠ Optimizations ߊ಴ ࣗѐ

  9. !9 ߊ಴ ࣗѐ

  10. !10 ߊ಴ ࣗѐ

  11. !11 ୊਺ 3.7੉ ܾܻૉغҊ Ӓٺ Ӓր 'য় ࡈۄ઎ҳա જ֎' ߊ಴

    ࣗѐ
  12. !12 3ର ௑࢟۞٘ - ߛ௼࢟۞٘ ౵੉ॆݍ ۨदೖ ߊ಴ ߊ಴ ࣗѐ

  13. !13 ߊ಴ ࣗѐ ౵੉ॆ 3.7੉ о੢ ࡅܲ ۠ఋ੐ ߡ੹੉ۄ ࣗѐ

  14. !14 ੉ ٸب Ӓր 'о੢ ࡅܰҳա' ߊ಴ ࣗѐ

  15. !15 ৵ ࡅܲ૑ ࢓ಝࠁ۰Ҋ ೞӟ೮ਵա... ߊ಴ ࣗѐ

  16. !16 ਺ bpo-xxxxx? ੉Ѥ ަө... Issue#2334 ੉۠Ѥ ঌѷחؘ... ߊ಴ ࣗѐ

  17. !17 ই bugs.python.org ۽ ҙܻೞח ੉ग ֈߡ݂੉ҳա ٜযоࠁ੗ ߊ಴ ࣗѐ

  18. !18 ߊ಴ ࣗѐ bpo-29300

  19. !19 ߊ಴ ࣗѐ bpo-29300 ੉ѱ ޤঠ...

  20. !20 ղѱ ੊ࣼೠѤ ੉۠ ചݶੋؘ... ߊ಴ ࣗѐ

  21. !21 PR ߑध੉ ੊ࣼೞ؍ աীѱ ц੗ӝ ࠙ਤӝ patch ߊ಴ ࣗѐ

    bpo-29300
  22. !22 ߊ಴ ࣗѐ

  23. !23 ߊ಴ ࣗѐ

  24. !24 ଵҊ۽ 2017֙ 2ਘࠗఠ CPython ѐߊ਷ hgীࢲ GitHubਵ۽ ੉زೣ ੉ग౟ېఊب

    GitHub Issueܳ ࢎਊೞ੗ח PEP-581੉ थੋغয ૓೯ ઺ ߊ಴ ࣗѐ
  25. !25 Ӓۧѱ ױ֛ೞҊ ૑ղ؍ ઺ ߊ಴ ࣗѐ

  26. !26 ߊ಴ ࣗѐ

  27. !27 ߊ಴ ࣗѐ Ӓې! աب ݽܰחѦ ߊ಴೧ࠁ੗ Ӓ۞ݶ র૑۽ۄب ׮

    ࡸࣿ ࣻ ੓ѷ૑?!
  28. !28 ౵੉௑ ߊ಴ ૑ਗ ই... ߊ಴઱ઁ ߄Եࣻ ੓ח૑ ޛযࠅө... ߊ಴

    ࣗѐ
  29. • ੷ب C ੜ ݽܵפ׮ • ࢜܂ѱ ୶оػ OPCODE੄ ࣁࠗ

    ҳഅҗ line by line ೧ࢳ • 2,000઴੉ ֈח re-implement in C PR ܻ࠭ೞӝ • ੿ӏ ಴അध ౵ࢲ ৮੹ ੿ࠂ !29 য়ט ݈ೞ૑ ঋਸ ղਊ ߊ಴ ࣗѐ
  30. • ࢿמ ѐࢶਸ ਤ೧ যڃ ই੉٣যо ੓঻ա • ؊ ঌҊर׮ݶ

    য٣ܳ ࠁݶ ؼ૑ • Ӓېب ৮੹ য۵૑݅਷ ঋ਷ C ௏٘ !30 য়ט ݈ೡ ղਊ ߊ಴ ࣗѐ
  31. !31 ੿ѹ਎ Jung Winter ߛ௼࢟۞٘ ߔূ٘ ূ૑פয res_tin JungWinter ߊ಴੗

  32. !32 Index 01 ӝࠄ ݫࢲ٘ ഐ୹ 02 ౵੉ॆ द੘ दр

    03 ੋझఢझ ݫࢲ٘ ഐ୹ 04 asyncio.sleep 05 ੉߮౟ ܖ೐ оઉয়ӝ 06 زदী प೯ೞӝ 07 asyncio.ensure_future 08 typing ݽٕ оઉয়ӝ 09 ܻझ౟ ੿۳ 10 ٤࣊ցܻ ࠂࢎ 11 ੿ӏ಴അध __enter__() __exit__()
  33. 01 ӝࠄ ݫࢲ٘ ഐ୹

  34. !34 The overhead of calling many methods of various standard

    library classes implemented in C has been significantly reduced by porting more code to use the METH_FASTCALL convention. bpo-29300 bpo-29507 bpo-29452 bpo-29286 01 ӝࠄ ݫࢲ٘ ഐ୹
  35. • ಴ળ ۄ੉࠳۞ܻী ࣘೠ ௿ېझী ੓ח ৈ۞ ݫࢲٜ٘ਸ ୭੸ച೮׮. •

    METH_FASTCALL ஶ߮࣌ਸ ٮܰب۾ ߄Ծ׮. !35 ੉ ѐࢶ੄ ઱ ղਊ 01 ӝࠄ ݫࢲ٘ ഐ୹
  36. • ಴ળ ۄ੉࠳۞ܻী ࣘೠ ௿ېझী ੓ח ৈ۞ ݫࢲٜ٘ਸ ୭੸ച೮׮. •

    METH_FASTCALL ஶ߮࣌ਸ ٮܰب۾ ߄Ծ׮. !36 ੉ ѐࢶ੄ ઱ ղਊ collections.deque੄ index(), insert(), rotate() 01 ӝࠄ ݫࢲ٘ ഐ୹
  37. • ಴ળ ۄ੉࠳۞ܻী ࣘೠ ௿ېझী ੓ח ৈ۞ ݫࢲٜ٘ਸ ୭੸ച೮׮. •

    METH_FASTCALL ஶ߮࣌ਸ ٮܰب۾ ߄Ծ׮. !37 ੉ ѐࢶ੄ ઱ ղਊ collections.deque੄ index(), insert(), rotate() __getitem__() 01 ӝࠄ ݫࢲ٘ ഐ୹
  38. • ಴ળ ۄ੉࠳۞ܻী ࣘೠ ௿ېझী ੓ח ৈ۞ ݫࢲٜ٘ਸ ୭੸ച೮׮. •

    METH_FASTCALL ஶ߮࣌ਸ ٮܰب۾ ߄Ծ׮. !38 ੉ ѐࢶ੄ ઱ ղਊ collections.deque੄ index(), insert(), rotate() __getitem__() str੄ replace(), ljust(), rjust(), strip(), upper() ١ 01 ӝࠄ ݫࢲ٘ ഐ୹
  39. !39 METH_FASTCALL੉ ޤӡې 01 ӝࠄ ݫࢲ٘ ഐ୹

  40. • ࢤӟѤ opcode୊ۢ ࢤ҂૑݅ ࢎप C ೣࣻ ࢶ঱ ஶ߮࣌ •

    METH_FASTCALL ஶ߮࣌ী ݏ୾ ೣࣻܳ ࢶ঱ೞݶ ࢿמ࢚ ੉ٙ੉ ੓਺ • ӝઓূ METH_VARARGS ஶ߮࣌ ࢎਊ • ౵੉ॆ tuple → PyObject੄ C ߓৌ !40 METH_FASTCALL 01 ӝࠄ ݫࢲ٘ ഐ୹
  41. • ࢤӟѤ opcode୊ۢ ࢤ҂૑݅ ࢎप C ೣࣻ ࢶ঱ ஶ߮࣌ •

    METH_FASTCALL ஶ߮࣌ী ݏ୾ ೣࣻܳ ࢶ঱ೞݶ ࢿמ࢚ ੉ٙ੉ ੓਺ • ӝઓূ METH_VARARGS ஶ߮࣌ ࢎਊ • ౵੉ॆ tuple → PyObject੄ C ߓৌ !41 METH_FASTCALL 01 ӝࠄ ݫࢲ٘ ഐ୹ ؊ Өѱ ঌҊर׮ݶ bpo-27810, ҙ۲ mailing list
  42. !42 01 ӝࠄ ݫࢲ٘ ഐ୹ Python/C API Reference Manual: Common

    Object Structures
  43. !43 Python 3.8ী ୶оػ positional arguments ѐ֛ METH_FASTCALL਷ ࡅܲ؀न keyword

    arguments ॶ ࣻ হ਺ 01 ӝࠄ ݫࢲ٘ ഐ୹ Python/C API Reference Manual: Common Object Structures
  44. !44 01 ӝࠄ ݫࢲ٘ ഐ୹ GitHub - ipython

  45. !45 01 ӝࠄ ݫࢲ٘ ഐ୹ Review: Use FASTCALL for collections.deque

    methods: index, insert, rotate ੉۠धਵ۽ ೣࣻ੄ दӒפ୛৬ ౵य۽૒੉ ߄Պ
  46. • ೣࣻ ߸ജҗ ࢤࢿਸ ب৬઱ח بҳ • CPython ղ੢ ೣࣻ

    ੋࣻ ୊ܻܳ ذח DSL • PEP-436җ how to clinic ޙࢲ !46 Argument Clinic 01 ӝࠄ ݫࢲ٘ ഐ୹
  47. • ೣࣻ ߸ജҗ ࢤࢿਸ ب৬઱ח بҳ • CPython ղ੢ ೣࣻ

    ੋࣻ ୊ܻܳ ذח DSL • PEP-436җ how to clinic ޙࢲ !47 Argument Clinic 01 ӝࠄ ݫࢲ٘ ഐ୹
  48. !48 ׮নೠ ݫࢲٜ٘੉ ~30% ੿ب ࡈۄ૗ 01 ӝࠄ ݫࢲ٘ ഐ୹

  49. 02 ౵੉ॆ द੘ दр

  50. !50 Various optimizations have reduced Python startup time by 10%

    on Linux and up to 30% on macOS. bpo-31333: Implement ABCMeta in C bpo-29585: site.py imports relatively large `sysconfig` module 02 ౵੉ॆ द੘ दр
  51. • abcݽٕਸ C۽ ׮द ૧׮. • site.pyо ࢎਊೞח sysconfig.py੄ ౠ੿

    ೣࣻܳ import ೞ૑ ঋҊ ࠂࢎ೧ࢲ ࢎਊೞ ب۾ ߄Ծ׮. • ؒਵ۽ isinstance৬ issubclassب 1.5ߓ ࡈۄ઎׮. !51 ੉ ѐࢶ੄ ઱ ղਊ 02 ౵੉ॆ द੘ दр
  52. !52 C۽ ׮द ૠ abc ݽٕ 02 ౵੉ॆ द੘ दр

  53. !53 02 ౵੉ॆ द੘ दр ղਊ਷ Ӓր abc ݽٕਸ C۽

    ૧׮. ؊ ঌҊ र׮ݶ #5273 PR
  54. !54 02 ౵੉ॆ द੘ दр ೠ ׳р

  55. !55 02 ౵੉ॆ द੘ दр ೠ ׳р

  56. !56 02 ౵੉ॆ द੘ दр ೠ ׳р ড 300ѐ੄ ܻ࠭

  57. !57 02 ౵੉ॆ द੘ दр ೠ ׳р ড 300ѐ੄ ܻ࠭

    2,000઴੉ ֈח ߸҃
  58. !58 ૑ࣘ оמೠ ਬ૑ࠁࣻܳ ୶ҳೞח ݽण 02 ౵੉ॆ द੘ दр

  59. !59 site.pyীࢲ sysconfig import ઁѢ 02 ౵੉ॆ द੘ दр

  60. • site ݽٕ਷ ੋఠ೐ܻఠܳ प೯ೡ ٸ ੗زਵ۽ import غח ݽٕ.

    site-package੄ ҃ ۽ܳ ଺Ҋ ୶оೣ • ࢎਊೞ۰ח sysconfig੄ ೣࣻܳ site.py۽ оઉ১ • ׼ো൤ աয়ח ਬ૑ࠁࣻ ਋۰. ف ݽٕ ࢎ੉੄ ঐޗ੸ੋ ҙ҅ • ׮݅ ݽٕਸ C۽ ׮द ੘ࢿೞѢա য়ېغҊ ௾ ݽٕীࢲ ೙ਃೠ ࠗ࠙݅ ܻ࠙ೞח Ѥ ց ޖ ௾ ੘স੉޲۽ ٯ ೙ਃೠ ࠗ࠙݅ оઉয়Ҋ ਬ૑ࠁࣻܳ ਤೠ ઱ࢳਸ ׮ח Ѫਵ۽ ೤੄ • ֿܻझীࢶ 5% ࡈۄ઎Ҋ macOSীࢶ 30% ࡈۄ૗   02 ౵੉ॆ द੘ दр
  61. !61 02 ౵੉ॆ द੘ दр

  62. 03 ੋझఢझ ݫࢲ٘ ഐ୹

  63. !63 Method calls are now up to 20% faster due

    to the bytecode changes which avoid creating bound method instances. bpo-26110: Speedup method calls 1.2x 03 ੋझఢझ ݫࢲ٘ ഐ୹
  64. • positional arguments ೣࣻ ഐ୹ী ؀ೠ ࢜۽਍ opcode 2ѐ ୶о

    • LOAD_METHOD, CALL_METHOD • ӝઓ opcodeܳ ߄Լب ع૑݅ ੉ۡ҃਋ ݆਷ ࠗ࠙ীࢲ য়൤۰ ࢿמ ೞۅ !64 ੉ ѐࢶ੄ ઱ ղਊ 03 ੋझఢझ ݫࢲ٘ ഐ୹
  65. • positional arguments ೣࣻ ഐ୹ী ؀ೠ ࢜۽਍ opcode 2ѐ ୶о

    • LOAD_METHOD, CALL_METHOD • ӝઓ opcodeܳ ߄Լب ع૑݅ ੉ۡ҃਋ ݆਷ ࠗ࠙ীࢲ য়൤۰ ࢿמ ೞۅ !65 ੉ ѐࢶ੄ ઱ ղਊ 03 ੋझఢझ ݫࢲ٘ ഐ୹ ؊ ঌҊ र׮ݶ bpo-26110: Patch Set
  66. !66 TMI 03 ੋझఢझ ݫࢲ٘ ഐ୹ ӈب ߈ ۽ࢻ੉ Ӓزউ

    s.startswith('abc')੉ s[:3] == 'abc' ࠁ׮ ו۷׮ݶࢲ ই੉٣যܳ જইೣ ই૒ ੸ਊغ૓ ঋই ৈ੹൤ s[:3] == 'abc'о ؊ ࡅܰ૑݅ ա઺ী ੸ਊ оמ
  67. 04 asyncio.sleep

  68. !68 ਫ਼द एযоח दр рױೠ ই੉٣য۽ ࢿמ ೱ࢚ਸ ੉ܞմ PRب

    ੓਺ 04 asyncio.sleep
  69. !69 asyncio.sleep() is now up to 2 times faster when

    the delay argument is zero or negative. bpo-32351: Use fastpath in asyncio.sleep if delay<0 04 asyncio.sleep
  70. asyncio.sleepਵ۽ ֈযৡ delayо ਺ࣻݶ Futureب উٜ݅Ҋ loopী झாે݂ب ೞ૑ঋب۾ ߄Պ

    !70 ੉ ѐࢶ੄ ઱ ղਊ 04 asyncio.sleep #4908 PR
  71. !71 04 asyncio.sleep

  72. !72 04 asyncio.sleep ܖ೐ оઉ৬ Future ݅٘ח җ੿

  73. !73 04 asyncio.sleep ܖ೐ী झாે݂ ೞח җ੿

  74. !74 ׼ੌզ ઁউغҊ ׼ੌզ PRৢۄ৬ 2दр ݅ী ݠ૑ؽ 04 asyncio.sleep

  75. 05 ੉߮౟ ܖ೐ оઉয়ӝ

  76. !76 The asyncio.get_event_loop() function has been reimplemented in C to

    make it up to 15 times faster. bpo-32296: Implement asyncio._get_running_loop() and get_event_loop() in C 05 ੉߮౟ ܖ೐ оઉয়ӝ
  77. • asyncio.get_event_loop, get_running_loop ೣࣻܳ C۽ ૞ࢲ 4ߓ ࡅܰѱ ݅ٝ •

    get_running_loopܳ ژ ѐࢶ೧ࢲ 4ߓ ࡅܰѱ ݅ٝ • நय ࢎਊ • os.getpid()؀न getpid() ܳ ࢎਊೞب۾ ѐࢶೣ !77 ੉ ѐࢶ੄ ઱ ղਊ 05 ੉߮౟ ܖ೐ оઉয়ӝ
  78. • asyncio.get_event_loop, get_running_loop ೣࣻܳ C۽ ૞ࢲ 4ߓ ࡅܰѱ ݅ٝ •

    get_running_loopܳ ژ ѐࢶ೧ࢲ 4ߓ ࡅܰѱ ݅ٝ • நय ࢎਊ • os.getpid()؀न getpid() ܳ ࢎਊೞب۾ ѐࢶೣ !78 ੉ ѐࢶ੄ ઱ ղਊ ࢿמ ೱ࢚੄ 80% ਃੋ 05 ੉߮౟ ܖ೐ оઉয়ӝ
  79. !79 C۽ ׮द ૠ get_event_loop 05 ੉߮౟ ܖ೐ оઉয়ӝ

  80. !80 05 ੉߮౟ ܖ೐ оઉয়ӝ #4827 PR: Python - get_event_loop

    ੉ۧѱ рױೠ ౵੉ॆ ௏٘ب
  81. !81 05 ੉߮౟ ܖ೐ оઉয়ӝ #4827 PR: C - get_event_loop

    C۽ ૠ׮ݶ ੉ۧѱ ੢ട೧૓׮
  82. !82 05 ੉߮౟ ܖ೐ оઉয়ӝ

  83. !83 ѐࢶػ getpid() 05 ੉߮౟ ܖ೐ оઉয়ӝ

  84. !84 05 ੉߮౟ ܖ೐ оઉয়ӝ #5277 PR

  85. !85 05 ੉߮౟ ܖ೐ оઉয়ӝ #5277 PR ౵੉ॆ੄ os.getpid()ܳ ഐ୹ೞҊ

  86. !86 05 ੉߮౟ ܖ೐ оઉয়ӝ #5277 PR ఋੑਸ ࠺Ү

  87. !87 05 ੉߮౟ ܖ೐ оઉয়ӝ #5277 PR

  88. • ӝઓীח ࡅܰѱ ॳҊ र׮ݶ uvloopо ୭ࢶ • ੉ ߸҃

    ࢎ೦ਵ۽ uvloop۽ب ࣘبо ࡈۄ૕ ࣻ হ঻؍ ࠗ࠙ਸ ѐࢶೣ • uvloopח event loop policyܳ ా೧ ੉߮౟ ܖ೐ ੗୓ী ؀ೠ ࠗ࠙ਸ ѐࢶೞӝ ٸޙ • അ੤ ੉߮౟ ܖ೐ܳ оઉয়Ҋ ߈ജೞחѤ API۽ ઁҕೞ૑ ঋওӝী Ѥܾ٘ ࣻ হ਺   05 ੉߮౟ ܖ೐ оઉয়ӝ
  89. !89 05 ੉߮౟ ܖ೐ оઉয়ӝ uvloopо ѐࢶೡ ࣻ ੓ח ৔৉

  90. 06 زदী प೯ೞӝ

  91. !91 async ҙ۲ ѐࢶ਷ খਵ۽ ૣ਷Ѣ ೞա݅ ؊ թওणפ׮! 06

    زदী प೯ೞӝ
  92. !92 asyncio.gather() is now up to 15% faster. bpo-32355: Optimize

    asyncio.gather() 06 زदী प೯ೞӝ
  93. asyncio.gather ৘ઁ 06 زदী प೯ೞӝ

  94. • ੋ੗۽ ٜযৡ ௏ܖ౯ ೞաೞա݃׮ functools.partial ೞ؍ ࠗ࠙ਸ ઁѢ •

    ensure_future৬ ઺ࠂغח ۽૒ ઁѢ !94 ੉ ѐࢶ੄ ઱ ղਊ 06 زदী प೯ೞӝ
  95. !95 functools.partial ઁѢ 05 ੉߮౟ ܖ೐ оઉয়ӝ

  96. !96 06 زदী प೯ೞӝ #4913 PR

  97. !97 06 زदী प೯ೞӝ #4913 PR ӝઓূ ೞա ՘զ ٸ݃׮

    Ѿҗܳ ੷੢೮׮ݶ ѐࢶ റূ ׮ ՘աݶ Ӓٸࢲঠ Ѿҗܳ ੷੢
  98. 07 asyncio.ensure_future

  99. !99 bpo-33505: Optimize asyncio.ensure_future by reordering if conditions Optimize asyncio.ensure_future()

    by reordering if checks: 1.17x faster. 07 asyncio.ensure_future
  100. • ensure_futureח ੋ੗о futureо ইפݶ future۽ ߸ജ • future.isfuture()۽ futureੋ૑

    ݢ੷ ѨࢎೞҊ coroutines.iscoroutine()۽ ௏ ܖ౯ੋ૑ Ѩࢎೣ • Ӓؘ۠ पઁ۽ ࢎਊೞחѦ ࠁݶ ؀ࠗ࠙ run_until_complete()ی async ೣࣻо ֈয ৡ gather() ীࢲ ࢎਊؽ • Ӓ۞޲۽ ௏ܖ౯ਸ ݢ੷ Ѩࢎೞب۾ ifޙ ࣽࢲܳ ߄Է !100 ੉ ѐࢶ੄ ઱ ղਊ 07 asyncio.ensure_future
  101. • ensure_futureח ੋ੗о futureо ইפݶ future۽ ߸ജ • future.isfuture()۽ futureੋ૑

    ݢ੷ ѨࢎೞҊ coroutines.iscoroutine()۽ ௏ ܖ౯ੋ૑ Ѩࢎೣ • Ӓؘ۠ पઁ۽ ࢎਊೞחѦ ࠁݶ ؀ࠗ࠙ run_until_complete()ی async ೣࣻо ֈয ৡ gather() ীࢲ ࢎਊؽ • Ӓ۞޲۽ ௏ܖ౯ਸ ݢ੷ Ѩࢎೞب۾ ifޙ ࣽࢲܳ ߄Է !101 ੉ ѐࢶ੄ ઱ ղਊ 07 asyncio.ensure_future tmi: async def۽ ࢶ঱ೠ ೣࣻח ௏ܖ౯ਸ ࢤࢿ ೞח ೣࣻо ؽ
  102. ইө ৘ઁ 07 asyncio.ensure_future

  103. 08 typing ݽٕ оઉয়ӝ

  104. !104 As a result of PEP 560 work, the import

    time of typing has been reduced by a factor of 7, and many typing operations are now faster. bpo-32226: Implement PEP 560: Core support for typing module and generic types 08 typing ݽٕ оઉয়ӝ
  105. • ઁ֎ܼ ഋधਸ ؊ ੜ ૑ਗೞӝ ਤ೧ ౠࣻ ݫࢲ٘ܳ ୶о

    • __class_getitem__, __mro_entries__ !105 ੉ ѐࢶ੄ ઱ ղਊ 08 typing ݽٕ оઉয়ӝ
  106. • ఋੑ ൦౴ਸ ઁউೠ PEP-484਷ ੋఠ೐ܻఠ ۨ߰੄ ߸҃਷ হب۾ ٣੗ੋؽ

    • Ӓېࢲ Generic[T], Iterable[int], List[str] ١ਸ ҳഅೞӝ ਤ೧ࢶ ৈ۞о૑ ౟ܼ ਸ ࢎਊೡ ࣻ ߆ী হ঻਺. __getitem__਷ ੋझఢझীࢲ݅ ز੘ೞҊ ௿ېझীࢶ ز੘ೞ ૑ ঋ਺ • Ӓؘ۠ ੉ઃ ఋ੉ೝ, ఋੑ ൦౟о օܻ ࢎਊغפ ੉ ઁೠਸ ಽয ઁ֎ܼ ഋध ૑ਗਸ ਤೠ ౠࣻ ݫࢲ٘ܳ ୶оೣ. ੉ѱ PEP-560੄ ղਊ !106 ੉ ѐࢶ੄ ઱ ղਊ 08 typing ݽٕ оઉয়ӝ
  107. • ఋੑ ൦౴ਸ ઁউೠ PEP-484਷ ੋఠ೐ܻఠ ۨ߰੄ ߸҃਷ হب۾ ٣੗ੋؽ

    • Ӓېࢲ Generic[T], Iterable[int], List[str] ١ਸ ҳഅೞӝ ਤ೧ࢶ ৈ۞о૑ ౟ܼ ਸ ࢎਊೡ ࣻ ߆ী হ঻਺. __getitem__਷ ੋझఢझীࢲ݅ ز੘ೞҊ ௿ېझীࢶ ز੘ೞ ૑ ঋ਺ • Ӓؘ۠ ੉ઃ ఋ੉ೝ, ఋੑ ൦౟о օܻ ࢎਊغפ ੉ ઁೠਸ ಽয ઁ֎ܼ ഋध ૑ਗਸ ਤೠ ౠࣻ ݫࢲ٘ܳ ୶оೣ. ੉ѱ PEP-560੄ ղਊ !107 ੉ ѐࢶ੄ ઱ ղਊ 08 typing ݽٕ оઉয়ӝ
  108. • ఋੑ ൦౴ਸ ઁউೠ PEP-484਷ ੋఠ೐ܻఠ ۨ߰੄ ߸҃਷ হب۾ ٣੗ੋؽ

    • Ӓېࢲ Generic[T], Iterable[int], List[str] ١ਸ ҳഅೞӝ ਤ೧ࢶ ৈ۞о૑ ౟ܼ ਸ ࢎਊೡ ࣻ ߆ী হ঻਺. __getitem__਷ ੋझఢझীࢲ݅ ز੘ೞҊ ௿ېझীࢶ ز੘ೞ ૑ ঋ਺ • Ӓؘ۠ ੉ઃ ఋ੉ೝ, ఋੑ ൦౟о օܻ ࢎਊغפ ੉ ઁೠਸ ಽয ઁ֎ܼ ഋध ૑ਗਸ ਤೠ ౠࣻ ݫࢲ٘ܳ ୶оೣ. ੉ѱ PEP-560੄ ղਊ !108 ੉ ѐࢶ੄ ઱ ղਊ 08 typing ݽٕ оઉয়ӝ
  109. • ࢜܂ѱ ୶оػ __class_getitem__੉ যڌѱ ࢿמਸ ѐࢶदௌח૑ח #4906 PRী 2,400઴੄

    diff۽ ੗ࣁ൤ ա৬੓਺. • Ӓزউ typing ݽٕ੉ importо ו۷חؘ Ѣ੄ ઁ֎ܼఋੑ ٸޙ੉঻਺ • ੉ ߸҃ਵ۽ ݽٕ importח 7ߓ, ઁ֎ܼ ௿ېझ ࢤࢿ਷ 4ߓ ࡈۄ૗ • ਬੌೠ ࠳ۨ੉ఊ ୓ੋ૑ח ೧׼ ؍؊ݫࣗ٘ܳ ੐੄۽ ҳഅ೧ ׮ܲ ਊب۽ ॳҊ੓؍ ௏٘ • ೞ૑݅ ੉޷ ؍؊ݫࣗ٘ח ҃Ҋহ੉ ӵ૕ࣻ੓׮Ҋ ੸যְӝী ޙઁ হ਺ !109 ੉ ѐࢶ੄ ઱ ղਊ 08 typing ݽٕ оઉয়ӝ
  110. • ࢜܂ѱ ୶оػ __class_getitem__੉ যڌѱ ࢿמਸ ѐࢶदௌח૑ח #4906 PRী 2,400઴੄

    diff۽ ੗ࣁ൤ ա৬੓਺. • Ӓزউ typing ݽٕ੉ importо ו۷חؘ Ѣ੄ ઁ֎ܼఋੑ ٸޙ੉঻਺ • ੉ ߸҃ਵ۽ ݽٕ importח 7ߓ, ઁ֎ܼ ௿ېझ ࢤࢿ਷ 4ߓ ࡈۄ૗ • ਬੌೠ ࠳ۨ੉ఊ ୓ੋ૑ח ೧׼ ؍؊ݫࣗ٘ܳ ੐੄۽ ҳഅ೧ ׮ܲ ਊب۽ ॳҊ੓؍ ௏٘ • ೞ૑݅ ੉޷ ؍؊ݫࣗ٘ח ҃Ҋহ੉ ӵ૕ࣻ੓׮Ҋ ੸যְӝী ޙઁ হ਺ !110 ੉ ѐࢶ੄ ઱ ղਊ 08 typing ݽٕ оઉয়ӝ
  111. • ࢜܂ѱ ୶оػ __class_getitem__੉ যڌѱ ࢿמਸ ѐࢶदௌח૑ח #4906 PRী 2,400઴੄

    diff۽ ੗ࣁ൤ ա৬੓਺. • Ӓزউ typing ݽٕ੉ importо ו۷חؘ Ѣ੄ ઁ֎ܼఋੑ ٸޙ੉঻਺ • ੉ ߸҃ਵ۽ ݽٕ importח 7ߓ, ઁ֎ܼ ௿ېझ ࢤࢿ਷ 4ߓ ࡈۄ૗ • ਬੌೠ ࠳ۨ੉ఊ ୓ੋ૑ח ೧׼ ؍؊ݫࣗ٘ܳ ੐੄۽ ҳഅ೧ ׮ܲ ਊب۽ ॳҊ੓؍ ௏٘ • ೞ૑݅ ੉޷ ؍؊ݫࣗ٘ח ҃Ҋহ੉ ӵ૕ࣻ੓׮Ҋ ੸যְӝী ޙઁ হ਺ !111 ੉ ѐࢶ੄ ઱ ղਊ 08 typing ݽٕ оઉয়ӝ
  112. • ࢜܂ѱ ୶оػ __class_getitem__੉ যڌѱ ࢿמਸ ѐࢶदௌח૑ח #4906 PRী 2,400઴੄

    diff۽ ੗ࣁ൤ ա৬੓਺. • Ӓزউ typing ݽٕ੉ importо ו۷חؘ Ѣ੄ ઁ֎ܼఋੑ ٸޙ੉঻਺ • ੉ ߸҃ਵ۽ ݽٕ importח 7ߓ, ઁ֎ܼ ௿ېझ ࢤࢿ਷ 4ߓ ࡈۄ૗ • ਬੌೠ ࠳ۨ੉ఊ ୓ੋ૑ח ೧׼ ؍؊ݫࣗ٘ܳ ੐੄۽ ҳഅ೧ ׮ܲ ਊب۽ ॳҊ੓؍ ௏٘ • ೞ૑݅ ੉޷ ؍؊ݫࣗ٘ח ҃Ҋহ੉ ӵ૕ࣻ੓׮Ҋ ੸যְӝী ޙઁ হ਺ !112 ੉ ѐࢶ੄ ઱ ղਊ 08 typing ݽٕ оઉয়ӝ
  113. 09 ܻझ౟ ੿۳

  114. !114 sorted() and list.sort() have been optimized for common cases

    to be up to 40-75% faster. bpo-28685: Optimizing list.sort() by performing safety checks in advance 09 ܻझ౟ ੿۳
  115. • ੿۳ ঌҊ્ܻਸ ߸҃ೠ Ѫ੉ ইש • ܻझ౟ܳ ੿۳ೡ ٸ

    ؀ࠗ࠙੄ ҃਋ чٜ੉ ࢲ۽ زੌೠ ఋੑ੉ۄҊ о੿ • ݒߣ чਸ ࠺Үೡ ٸ݃׮ ఋੑ Ѩࢎೞ૑ ݈Ҋ ޷ܻ ೠ ߣ݅ ೧ف੗! о ই੉٣য !115 ੉ ѐࢶ੄ ઱ ղਊ 09 ܻझ౟ ੿۳
  116. • ੿۳ ঌҊ્ܻਸ ߸҃ೠ Ѫ੉ ইש • ܻझ౟ܳ ੿۳ೡ ٸ

    ؀ࠗ࠙੄ ҃਋ чٜ੉ ࢲ۽ زੌೠ ఋੑ੉ۄҊ о੿ • ݒߣ чਸ ࠺Үೡ ٸ݃׮ ఋੑ Ѩࢎೞ૑ ݈Ҋ ޷ܻ ೠ ߣ݅ ೧ف੗! о ই੉٣য !116 ੉ ѐࢶ੄ ઱ ղਊ 09 ܻझ౟ ੿۳
  117. • ৈ۞о૑ о੿ਸ ࣁ਋Ҋ pre-check stageܳ ݅ٝ • safe_object_compare: ৈ۞

    ఋੑ੉ ੓׮Ҋ о੿, ӝઓী ࢎਊೞ؍ উ੹ೠ ߑध • unsafe_object_compare: ೠ ఋੑ੉ۄҊ о੿ • unsafe_latin_compare: Latin ޙ੗ৌ੉ۄҊ о੿ • Ӓ ৻ int, float, tuple۽ ੉ܖয૓ ܻझ౟ۄҊ о੿ • о੿ਸ ѨૐೞҊ ੸ਊ೧ ࠺ਊ੉ ࠺ऴ উ੿ࢿ Ѩࢎܳ ਋ഥೞח ୭੸ച ࠺Ү ೣࣻ ࢎਊ !117 ੉ ѐࢶ੄ ઱ ղਊ 09 ܻझ౟ ੿۳
  118. !118 09 ܻझ౟ ੿۳ #582 PR

  119. !119 09 ܻझ౟ ੿۳ #582 PR п о੿ٜਸ Ѩૐೞח C

    ௏٘৬ ୭੸ചػ ࠺Ү ೣࣻח যڌѱ ࢤ҂ח૑ח ࢤۚ
  120. !120 ই઱ ୭ঈ੄ ҃਋ ਤ੄ о੿ٜ੉ ݽف ౣܻѱ غҊ ӝࠄز੘ੋ

    safe_object_compare۽ ֈযоӝө૑ pre-check ٸޙী 15%੿ب ו۰૗ 09 ܻझ౟ ੿۳
  121. 10 ٤࣊ցܻ ࠂࢎ

  122. !122 dict.copy() is now up to 5.5 times faster. bpo-31179:

    Speed-up dict.copy() up to 5.5 times. 10 ٤࣊ցܻ ࠂࢎ
  123. • ਗېח ࠼ dictܳ ٜ݅Ҋ key, valueܳ ೞաঀ ୶о •

    ӝઓ dict ੹୓ key, value ৔৉੄ ݫݽܻܳ ా૩۽ ࠂࢎ(memcpy)ೞҊ ۨಌ۠झ ஠਍౟ ܳ ט۰઱੗(increfs)! о ই੉٣য • ܻ࠭যо ੗઱ ࢎਊೞ૑ ঋח ӝמٸޙী 50઴੄ C ௏٘ܳ ୶оೠ׮Ҋ ਬ૑ࠁࣻ ஏݶী ࢲ ৏۰ೣ • ೞ૑݅ ੷੗о 50݅ ઴ ੉࢚੄ ೐۽ં౟ա ORMীࢲ dict.copyח ഝߊ൤ ࢎਊೠ׮ ঱ әೞݴ 5.5ߓ ࡅܰѱೞחѤ ୽࠙൤ ੄޷੓׮Ҋ ࢸٙ. tmi: ੷੗ח asyncpg੄ ݫੋప੉ց !123 ੉ ѐࢶ੄ ઱ ղਊ 10 ٤࣊ցܻ ࠂࢎ
  124. • ਗېח ࠼ dictܳ ٜ݅Ҋ key, valueܳ ೞաঀ ୶о •

    ӝઓ dict ੹୓ key, value ৔৉੄ ݫݽܻܳ ా૩۽ ࠂࢎ(memcpy)ೞҊ ۨಌ۠झ ஠਍౟ ܳ ט۰઱੗(increfs)! о ই੉٣য • ܻ࠭যо ੗઱ ࢎਊೞ૑ ঋח ӝמٸޙী 50઴੄ C ௏٘ܳ ୶оೠ׮Ҋ ਬ૑ࠁࣻ ஏݶী ࢲ ৏۰ೣ • ೞ૑݅ ੷੗о 50݅ ઴ ੉࢚੄ ೐۽ં౟ա ORMীࢲ dict.copyח ഝߊ൤ ࢎਊೠ׮ ঱ әೞݴ 5.5ߓ ࡅܰѱೞחѤ ୽࠙൤ ੄޷੓׮Ҋ ࢸٙ. tmi: ੷੗ח asyncpg੄ ݫੋప੉ց !124 ੉ ѐࢶ੄ ઱ ղਊ 10 ٤࣊ցܻ ࠂࢎ
  125. 11 ੿ӏ಴അध

  126. !126 Optimized case-insensitive matching and searching of regular expressions. Searching

    some patterns can now be up to 20 times faster. bpo-30285: Optimize case-insensitive regular expressions 11 ੿ӏ಴അध
  127. • ӝઓ੄ case-insensitive ݽ٘(re.IGNORECASE)ח ݽٚ ޙ੗ܳ lower case۽ ٜ݅Ҋ ݻо૑

    ୭੸ചܳ ࠺ഝࢿചೣ • ೞ૑݅ য়۽૑ 2669ѐ੄ Ӗ੗݅੉ lower/upper case ҳ࠙੉ ੓਺ • ब૑য ইझః ݽ٘(re.ASCII)ীࢶ ױ 52Ӗ੗ • ೧׼ Ӗ੗ٜ݅ ٮ۽ ୊ܻೞҊ աݠ૑ ݽٚ Ӗ੗ী ؀೧ࢶ case-sensitive ݽ٘੄ ୭੸ച ب ੸ਊ೧ ࡅܲ ࣘب۽ ୊ܻೞѱՔ ѐࢶ !127 ੉ ѐࢶ੄ ઱ ղਊ 11 ੿ӏ಴അध
  128. __exit__():

  129. Python 3.6 vs 3.7 ӝࠄ ݫࢲ٘ ഐ୹ ౵੉ॆ द੘ दр

    ੋझఢझ ݫࢲ٘ ഐ୹ asyncio.sleep ੉߮౟ ܖ೐ оઉয়ӝ زदী प೯ೞӝ asyncio.ensure_future typing ݽٕ оઉয়ӝ ܻझ౟ ੿۳ ٤࣊ցܻ ࠂࢎ ੿ӏ಴അध ՘ਵ۽
  130. Python 3.6 vs 3.7 ӝࠄ ݫࢲ٘ ഐ୹ ౵੉ॆ द੘ दр

    ੋझఢझ ݫࢲ٘ ഐ୹ asyncio.sleep ੉߮౟ ܖ೐ оઉয়ӝ زदী प೯ೞӝ asyncio.ensure_future typing ݽٕ оઉয়ӝ ܻझ౟ ੿۳ ٤࣊ցܻ ࠂࢎ ੿ӏ಴അध ՘ਵ۽
  131. Python 3.6 vs 3.7 ՘ਵ۽

  132. Python 3.6 vs 3.7 ՘ਵ۽ pyperf

  133. Python 3.6 vs 3.7 ՘ਵ۽

  134. • ౵੉ॆ 3.7 ୶ୌ೤פ׮, ౠ൤ ࠺زӝܳ ॵ׮ݶ ؊਌ • ౵੉ॆ਷

    ו݀פ׮, ೞ૑݅ न҃ॳ૑ ঋणפ׮ • ಌನݢझী ӝৈ೧઱न ஶ౟ܻ࠭ఠٜ࠙ хࢎ೤פ׮ !134 ೞҊर਷ ݈ Victor Stinner Inada Naoki Ivan Levkivskyi Yury Selivanov Sethiy Storchaka else: ՘ਵ۽
  135. !135 ਺ ࡅܰҳա Ӓա݃ ...

  136. !136 য় ࡅܰҳա ੉ېࢲ !

  137. session.close()