{"id":112509,"date":"2023-12-26T15:10:22","date_gmt":"2023-12-26T13:10:22","guid":{"rendered":"https:\/\/prohoster.info\/blog\/novosti-interneta\/dlya-python-predlozhen-jit-kompilyator-ispolzuyushhij-tehniku-copy-and-patch"},"modified":"2023-12-26T15:10:22","modified_gmt":"2023-12-26T13:10:22","slug":"dlya-python-predlozhen-jit-kompilyator-ispolzuyushhij-tehniku-copy-and-patch","status":"publish","type":"post","link":"https:\/\/prohoster.info\/de\/blog\/news\/dlya-python-predlozhen-jit-kompilyator-ispolzuyushhij-tehniku-copy-and-patch","title":{"rendered":"F\u00fcr Python wurde ein JIT-Compiler vorgeschlagen, der die Technik Copy-and-Patch verwendet","gt_translate_keys":[{"key":"rendered","format":"text"}]},"content":{"rendered":"<p>Brandt Bucher von Microsoft, einer der Hauptentwickler von CPython und Mitglied des Teams zur Leistungssteigerung des CPython-Interpreters, hat einen JIT-Compiler f\u00fcr Python ver\u00f6ffentlicht, der die Copy-and-Patch-Technik verwendet. Die JIT-Ver\u00f6ffentlichung f\u00e4llt auf Weihnachten, und die Ank\u00fcndigung ist in Versform verfasst.     <\/p>\n<p>Der vorgeschlagene JIT ist bemerkenswert durch sehr hohe Geschwindigkeiten bei der Codegenerierung, einfache Wartbarkeit und vollst\u00e4ndige Integration mit dem Interpreter. Die vorgeschlagene Methode erm\u00f6glicht es, den in C geschriebenen Interpreter automatisch in einen JIT-Compiler umzuwandeln, ohne separate Logik f\u00fcr die Codegenerierung zu erstellen und ohne manuelle Erstellung von Assembler-Darstellungen. Bei diesem Ansatz f\u00fchrt das Beheben eines Fehlers im Interpreter automatisch auch zur Behebung des gleichen Problems im JIT, da ein gemeinsamer Codegenerator verwendet wird.    <\/p>\n<p>Die Funktionsweise der Copy-and-Patch-Methode beruht darauf, dass die Relokation von Code im Speicher beim Laden durch einen Linker von Objektdateien und das Ersetzen von Maschinenanweisungen durch Bytecode im JIT \u00e4hnliche Aufgaben sind. W\u00e4hrend der JIT-Ausf\u00fchrung wird eine Iteration \u00fcber die vom Interpreter erstellten Bytecode-Anweisungen vorgenommen, wobei f\u00fcr jede Anweisung der bereits kompilierte Maschinen-Code in den Bereich des ausf\u00fchrbaren Codes kopiert wird. Zudem werden die Anweisungen in Echtzeit modifiziert, um die verarbeiteten Daten einzusetzen (JIT kopiert vorgefertigte Vorlagen bereits kompilierter Funktionen und ersetzt die erforderlichen Werte wie Argumente und Konstanten). Auch beim Laden von Objektdateien wird Maschinen-Code in den Speicher kopiert und externe Symbole ersetzt.    <\/p>\n<p>Im Copy-and-Patch JIT wird mit LLVM eine Objektdatei im ELF-Format erstellt, die Daten \u00fcber die Bytecode-Anweisungen und Informationen \u00fcber die erforderliche Datenaustausch enth\u00e4lt. Der JIT ersetzt die w\u00e4hrend der Programmausf\u00fchrung erzeugten Bytecode-Anweisungen durch Darstellungen im Maschinen-Code und setzt dabei die f\u00fcr Berechnungen notwendigen Daten ein. Die Implementierung des JIT erfordert LLVM als Abh\u00e4ngigkeit during der Build-Phase, doch die Runtime-Komponenten sind nicht an externe Abh\u00e4ngigkeiten gebunden und bestehen aus etwa 300 manuell geschriebenen Zeilen in C und 3000 generierten Zeilen C-Code.        <\/p>\n<p>Im Vergleich zu traditionellen JIT-Tools (LLVM -O0) gew\u00e4hrleistet der vorgeschlagene JIT eine 100-mal schnellere Codegenerierung und einen um 15 % schnelleren resultierenden Code. Im Vergleich zur Kompilierung nach WebAssembly (Liftoff) generiert der neue JIT Code f\u00fcnfmal schneller, und der resultierende Code funktioniert 50 % schneller. Vergleicht man den neuen JIT mit einem optimierenden JIT (LuaJIT), der manuell geschriebene Assembler-Code verwendet, so war der vorgeschlagene Ansatz in 13 von 44 Tests schneller, hatte jedoch im Durchschnitt eine 35 % geringere Leistung, was jedoch erhebliche Vereinfachungen bei der Wartung und einen geringeren Implementierungsaufwand mit sich brachte.            <center>  <div class=\"youtube-placeholder\" data-id=\"HxSHIpEQRjs\" onclick=\"loadVideo(this)\">\r\n        <img decoding=\"async\" src=\"https:\/\/img.youtube.com\/vi\/HxSHIpEQRjs\/hqdefault.jpg\" alt=\"Video abspielen\" loading=\"lazy\" width=\"480\" height=\"360\" style=\"width:100%;height:auto;\">\r\n        <div class=\"play-button\"><\/div>\r\n    <\/div><\/center><br \/>\n<br \/>Quelle: <a content=\"nofollow\" rel=\"nofollow\" href=\"https:\/\/www.opennet.ru\/opennews\/art.shtml?num=60352\">opennet.ru<\/a> <\/p>","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"excerpt":{"rendered":"<p>\u0411\u0440\u0430\u043d\u0434\u0442 \u0411\u0443\u043a\u0435\u0440 (Brandt Bucher) \u0438\u0437 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 Microsoft, \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0439 \u0432 \u0447\u0438\u0441\u043b\u043e core-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 CPython \u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u0435, \u0437\u0430\u043d\u0438\u043c\u0430\u044e\u0449\u0435\u0439\u0441\u044f \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u0435\u043c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440\u0430 CPython, \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043b \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e JIT-\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430 \u0434\u043b\u044f Python, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0443\u044e \u0442\u0435\u0445\u043d\u0438\u043a\u0443 Copy-and-Patch. \u041f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044f JIT \u043f\u0440\u0438\u0443\u0440\u043e\u0447\u0435\u043d\u0430 \u043a \u0420\u043e\u0436\u0434\u0435\u0441\u0442\u0432\u0443 \u0438 \u0430\u043d\u043e\u043d\u0441 \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u0432 \u0441\u0442\u0438\u0445\u0430\u0445. \u041f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0439 JIT \u043f\u0440\u0438\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u0435\u043d \u043e\u0447\u0435\u043d\u044c \u0432\u044b\u0441\u043e\u043a\u043e\u0439 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c\u044e \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043a\u043e\u0434\u0430, \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u043e\u0439 \u0441\u043e\u043f\u0440\u043e\u0432\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u0438 \u043f\u043e\u043b\u043d\u043e\u0439 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0435\u0439 \u0441 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440\u043e\u043c. \u041f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 [&hellip;]<\/p>\n","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[702],"tags":[],"class_list":["post-112509","post","type-post","status-publish","format-standard","hentry","category-news"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.0.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"\u0411\u0440\u0430\u043d\u0434\u0442 \u0411\u0443\u043a\u0435\u0440 (Brandt Bucher) \u0438\u0437 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 Microsoft, \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0439 \u0432 \u0447\u0438\u0441\u043b\u043e core-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 CPython \u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u0435, \u0437\u0430\u043d\u0438\u043c\u0430\u044e\u0449\u0435\u0439\u0441\u044f \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u0435\u043c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440\u0430 CPython, \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043b \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e.\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Yuri Gagarin\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/prohoster.info\/de\/blog\/news\/dlya-python-predlozhen-jit-kompilyator-ispolzuyushhij-tehniku-copy-and-patch\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.0.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"de_DE\" \/>\n\t\t<meta property=\"og:site_name\" content=\"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"\ud83e\udd47\u0414\u043b\u044f Python \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d JIT-\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0439 \u0442\u0435\u0445\u043d\u0438\u043a\u0443 copy-and-patch | ProHoster\" \/>\n\t\t<meta property=\"og:description\" content=\"\u0411\u0440\u0430\u043d\u0434\u0442 \u0411\u0443\u043a\u0435\u0440 (Brandt Bucher) \u0438\u0437 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 Microsoft, \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0439 \u0432 \u0447\u0438\u0441\u043b\u043e core-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 CPython \u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u0435, \u0437\u0430\u043d\u0438\u043c\u0430\u044e\u0449\u0435\u0439\u0441\u044f \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u0435\u043c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440\u0430 CPython, \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043b \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e.\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/prohoster.info\/de\/blog\/news\/dlya-python-predlozhen-jit-kompilyator-ispolzuyushhij-tehniku-copy-and-patch\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:width\" content=\"350\" \/>\n\t\t<meta property=\"og:image:height\" content=\"350\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2023-12-26T13:10:22+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2023-12-26T13:10:22+00:00\" \/>\n\t\t<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"\ud83e\udd47Ein JIT-Compiler f\u00fcr Python unter Verwendung der Copy-and-Patch-Technik angeboten | ProHoster","description":"\u0411\u0440\u0430\u043d\u0434\u0442 \u0411\u0443\u043a\u0435\u0440 (Brandt Bucher) \u0438\u0437 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 Microsoft, \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0439 \u0432 \u0447\u0438\u0441\u043b\u043e core-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 CPython \u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u0435, \u0437\u0430\u043d\u0438\u043c\u0430\u044e\u0449\u0435\u0439\u0441\u044f \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u0435\u043c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440\u0430 CPython, \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043b \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e.","canonical_url":"https:\/\/prohoster.info\/de\/blog\/news\/dlya-python-predlozhen-jit-kompilyator-ispolzuyushhij-tehniku-copy-and-patch","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":null,"og:locale":"de_DE","og:site_name":"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b","og:type":"article","og:title":"\ud83e\udd47\u0414\u043b\u044f Python \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d JIT-\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0439 \u0442\u0435\u0445\u043d\u0438\u043a\u0443 copy-and-patch | ProHoster","og:description":"\u0411\u0440\u0430\u043d\u0434\u0442 \u0411\u0443\u043a\u0435\u0440 (Brandt Bucher) \u0438\u0437 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 Microsoft, \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0439 \u0432 \u0447\u0438\u0441\u043b\u043e core-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 CPython \u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u0435, \u0437\u0430\u043d\u0438\u043c\u0430\u044e\u0449\u0435\u0439\u0441\u044f \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u0435\u043c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440\u0430 CPython, \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043b \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e.","og:url":"https:\/\/prohoster.info\/de\/blog\/news\/dlya-python-predlozhen-jit-kompilyator-ispolzuyushhij-tehniku-copy-and-patch","og:image":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:secure_url":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:width":350,"og:image:height":350,"article:published_time":"2023-12-26T13:10:22+00:00","article:modified_time":"2023-12-26T13:10:22+00:00","article:publisher":"https:\/\/www.facebook.com\/prohoster","article:author":"https:\/\/www.facebook.com\/prohoster"},"aioseo_meta_data":[],"gt_translate_keys":[{"key":"link","format":"url"}],"_links":{"self":[{"href":"https:\/\/prohoster.info\/de\/wp-json\/wp\/v2\/posts\/112509","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/prohoster.info\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/prohoster.info\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/prohoster.info\/de\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/prohoster.info\/de\/wp-json\/wp\/v2\/comments?post=112509"}],"version-history":[{"count":0,"href":"https:\/\/prohoster.info\/de\/wp-json\/wp\/v2\/posts\/112509\/revisions"}],"wp:attachment":[{"href":"https:\/\/prohoster.info\/de\/wp-json\/wp\/v2\/media?parent=112509"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/prohoster.info\/de\/wp-json\/wp\/v2\/categories?post=112509"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/prohoster.info\/de\/wp-json\/wp\/v2\/tags?post=112509"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}