Tuplex: Data Science in Python at Native Code Speed

Total Page:16

File Type:pdf, Size:1020Kb

Tuplex: Data Science in Python at Native Code Speed Tuplex: Data Science in Python at Native Code Speed Leonhard Spiegelberg Rahul Yesantharao Malte Schwarzkopf Tim Kraska [email protected] [email protected] [email protected] [email protected] Brown University MIT Brown University MIT Abstract compute a flight’s distance covered from kilometers to miles Data science pipelines today are either written in Python via a UDF after joining with a carrier table: or contain user-defined functions (UDFs) written in Python. carriers= spark.read.load( 'carriers.csv') But executing interpreted Python code is slow, and arbitrary fun= udf( lambda m: m* 1.609, DoubleType()) Python UDFs cannot be compiled to optimized machine code. spark.read.load('flights.csv') We present Tuplex, the first data analytics framework that .join(carriers, 'code', 'inner') just-in-time compiles developers’ natural Python UDFs into .withColumn('distance', fun('distance')) efficient, end-to-end optimized native code. Tuplex introduces .write.csv('output.csv') a novel dual-mode execution model that compiles an opti- mized fast path for the common case, and falls back on slower This code will run data loading and the join using Spark’s exception code paths for data that fail to match the fast path’s compiled Scala operators, but must execute the Python UDF assumptions. Dual-mode execution is crucial to making end- passed to withColumn in a Python interpreter. This requires to-end optimizing compilation tractable: by focusing on the passing data between the Python interpreter and the JVM [41], common case, Tuplex keeps the code simple enough to apply and prevents generating end-to-end optimized code across the aggressive optimizations. Thanks to dual-mode execution, Tu- UDFs—for example, an optimized pipeline might apply the plex pipelines always complete even if exceptions occur, and UDF to distance while loading data from flights.csv. Tuplex’s post-facto exception handling simplifies debugging. Could we instead generate native code from the Python We evaluate Tuplex with data science pipelines over real- UDF and optimize it end-to-end with the rest of the pipeline? world datasets. Compared to Spark and Dask, Tuplex im- Unfortunately, this is not feasible today. Generating, compil- proves end-to-end pipeline runtime by 5×–109×, and comes ing, and optimizing code that handles all possible code paths within 22% of a hand-optimized C++ baseline. Optimizations through a Python program is not tractable because of the com- enabled by dual-mode processing improve runtime by up to plexity of Python’s dynamic typing. Dynamic typing (“duck 3×; Tuplex outperforms other Python compilers by 5×; and typing”) requires that code always be prepared to handle any Tuplex performs well in a distributed setting. type: while the above UDF expects a numeric value for m, it may actually receive an integer, a float, a string, a null value, 1 Introduction or even a list. The Python interpreter handles these possi- Data scientists today predominantly write code in Python, bilities through extra checks and exception handlers, but the as the language is easy to learn and convenient to use. But sheer number of cases to handle makes it difficult to compile the features that make Python convenient for programming— optimized code even for this simple UDF. dynamic typing, automatic memory management, and a huge Tuplex is a new analytics framework that generates op- module ecosystem—come at the cost of low performance timized end-to-end native code for data analytics pipelines compared to hand-optimized code and an often frustrating with Python UDFs. Developers write their Tuplex pipelines debugging experience. using a LINQ-style API similar to PySpark’s, and use Python Python code executes in a bytecode interpreter, which inter- UDFs without any type annotations. Tuplex compiles these prets instructions, tracks object types, manages memory, and pipelines into efficient native code by relying on a new dual handles exceptions. This infrastructure imposes a heavy over- mode execution model. Dual-mode execution separates the head, particularly if Python user-defined functions (UDFs) are common case, for which code generation offers the greatest inlined in a larger parallel computation, such as a Spark [70] benefit, from exceptional cases, which complicate code gener- job. For example, a PySpark job over flight data [63] might ation and inhibit optimization, but have minimal performance 1 impact. Our key insight is that separating these cases and 32×, and its generated code comes within 2× of the per- leveraging the regular structure of LINQ-style data analytics formance of Weld [49] and Hyper [26] for pure query exec- pipelines makes Python UDF compilation tractable, as the Tu- tion time, while achieving 2× faster end-to-end runtime in plex compiler faces a simpler and more constrained problem a realistic data analytics setting (§6.2). Tuplex’s dual-mode than a general Python compiler. processing facilitates end-to-end optimizations that improve Making dual-mode processing work required us to over- runtime by up to 3× over simple UDF compilation (§6.3). come several challenges. First, Tuplex must establish what Finally, Tuplex performs well on a single server and distribut- the common case is. Tuplex’s key idea is to sample the input, edly across a cluster of AWS Lambda functions (§6.4); and derive the common case from this sample, and infer types and anecdotal evidence suggests that it simplifies the development expected cases across the pipeline. Second, Tuplex’s gener- and debugging of data science pipelines (§7). We will release ated native code must represent a semantically-correct Python Tuplex as open-source software. execution in the interpreter. To guarantee this, Tuplex sepa- 2 Background and Related Work rates the input data into records for which the native code’s behavior is identical to Python’s, and ones for which it is not Prior attempts to speed up data science via compilation or and which must be processed in the interpreter. Third, Tu- to compile Python to native code exist, but they fall short of plex’s generated code must offer a fast bail-out mechanism if the ideal of compiling end-to-end optimized native code from exceptions occur within UDFs (e.g., a division by zero), and UDFs written in natural Python. We discuss key approaches resolve these in line with Python semantics. Tuplex achieves and systems in the following; Table1 summarizes the key this by adding lightweight checks to generated code, and points. leverages the fact that UDFs are stateless to re-process the of- Python compilers. Building compilers for arbitrary Python fending records for resolution. Fourth, Tuplex must generate programs, which lack the static types required for optimiz- code with high optimization potential but also achieve fast JIT ing compilation, is challenging. PyPy [54] reimplements the compilation, which it does using tuned LLVM compilation. Python interpreter in a compilable subset of Python, which In addition to enabling compilation, dual-mode processing it JIT-compiles via LLVM (i.e., it creates a self-compiling has another big advantage: it can help developers write more interpreter). GraalPython [16] uses the Truffle [61] language robust pipelines that never fail at runtime due to dirty data interpreter to implement a similar approach while generating or unhandled exceptions. Tuplex detects exception cases, re- JVM bytecode for JIT compilation. Numba [31] JIT-compiles solves them via slow-path execution if possible, and presents a Python bytecode for annotated functions on which it can per- summary of the unresolved cases to the user. This helps proto- form type inference. Numba supports a subset of Python type data wrangling pipelines but also helps make production and targets array-structured data from numeric libraries like pipelines more robust to data glitches. NumPy [2]. All of these compilers either myopically focus While the focus of this paper is primarily on multi-threaded on optimizing hotspots without attention to high-level pro- processing efficiency of a single server, Tuplex is a distributed gram structure, or are limited to a small subset of the Python system, and we show results for a preliminary backend based language (e.g., numeric code only, no strings or exceptions). on AWS lambda functions. While Pyston [40] sought to create a full Python compiler us- In summary, we make the following principal contributions: ing LLVM, it was abandoned due to insufficient performance, 1. We combine ideas from query compilation with specula- memory management problems, and complexity [39]. tive compilation techniques in the dual-mode processing Python transpilers. model for data analytics: an optimized common-case Other approaches seek to cross- code path processes the bulk of the data, and a slower compile Python into languages for which optimizing compil- fallback path handles rare, non-conforming data. ers exist. Cython [4] unrolls the CPython interpreter and a 2. We observe that data analytics pipelines with Python Python module into C code, which interfaces with standard UDFs—unlike general Python programs—have suffi- Python code. Nuitka [18] cross-compiles Python to C++ and cient structure to make compilation without type annota- also unrolls the interpreter when cross-compilation is not pos- tions feasible. sible. The unrolled code represents a specific execution of the 3. We build and evaluate Tuplex, the first data analytics interpreter, which the compiler may optimize, but still runs system to embed a Python UDF compiler with a query the interpreter code, which compromises performance and compiler. inhibits end-to-end optimization. We evaluated our Tuplex prototype over real-world datasets, Data-parallel IRs. Special-purpose native code in libraries including Zillow real estate adverts, a decade of U.S. flight like NumPy can speed up some UDFs [24], but such pre- data [63], and web server logs from a large university.
Recommended publications
  • Biblioteksentralen Som Utviklingsaktør På Toten Med Lærer- Bakgrunn Og
    Bibliotekaren Tidsskrift for Bibliotekarforbundet Biblioteksentralen som utviklingsaktør på Toten Oppgjørenes time Med lærer- bakgrunn og bibliotekar framtid BFs økonomi under Skadd på jobb god kontroll - hva gjør jeg? 8 2004 Innhold: Bibliotekaren ISSN 0804-4147 Lederen har ordet side 3 ISSN 1503-836X (online) Forbundsstyrets junimøte side 4 Bibliotekaren er Bibliotekarforbundets BF mot forskriftsendring nå side 7 tidsskrift og utkommer hver måned. Ansvarlig redaktør Oppgjørenes timer Erling Bergan - Det er to bibliotekarer i Norge som sitter midt i begivenhetenes sentrum når det gjelder både sentrale forhandlinger og megling. Det er oss to fra Bibliotekaforbundet - rådgiver Thor Bjarne Stadshaug og meg. Vi sitter der 8 Redaksjonens adresse det skjer og har innpass i det som foregår, sier forbundsleder Monica Deil- Runnen 4, 6800 FØRDE dok i dette intervjuet etter at årets sentrale tariffoppgjør er unnagjort Tlf.: 57 82 07 65 Mobil: 91 31 80 01 Faks: 85 03 16 64 Lokale forhandlinger i KS-sektoren side 11 Epost: [email protected] Med lærerbakgrunn og bibliotekarframtid Stoff Etter 22 år som lærer i grunnskolen gjorde Anne Elisabeth Waage opp Vi mottar stoff i alle former. Tekster status: Hun fant ikke mange lærerkollegaer som var over 50. Skolehver- foretrekker vi som fi ler i RiktTekstFor- dagen ble simpelthen for stri i lengden. Anne Elisabeth valgte å skifte 12 mat (rtf). Usignerte artikler står for fil. Hun studerer nå bibliotekfag i Bergen. redaktørens regning. Fornøyd i staten? side 15 Abonnement Kr. 290,- pr. år betales til BFs girokonto Bibliotekvaktens søketips: 6039.05.64093. Merk innbetalingen Detektor – et katalogisert utgangspunkt side 16 «Abonnement». Alle henvendelser om abonnement rettes til BFs sekretariat i Lakkegata 21, 0187 Oslo, tlf.
    [Show full text]
  • How to Access Python for Doing Scientific Computing
    How to access Python for doing scientific computing1 Hans Petter Langtangen1,2 1Center for Biomedical Computing, Simula Research Laboratory 2Department of Informatics, University of Oslo Mar 23, 2015 A comprehensive eco system for scientific computing with Python used to be quite a challenge to install on a computer, especially for newcomers. This problem is more or less solved today. There are several options for getting easy access to Python and the most important packages for scientific computations, so the biggest issue for a newcomer is to make a proper choice. An overview of the possibilities together with my own recommendations appears next. Contents 1 Required software2 2 Installing software on your laptop: Mac OS X and Windows3 3 Anaconda and Spyder4 3.1 Spyder on Mac............................4 3.2 Installation of additional packages.................5 3.3 Installing SciTools on Mac......................5 3.4 Installing SciTools on Windows...................5 4 VMWare Fusion virtual machine5 4.1 Installing Ubuntu...........................6 4.2 Installing software on Ubuntu....................7 4.3 File sharing..............................7 5 Dual boot on Windows8 6 Vagrant virtual machine9 1The material in this document is taken from a chapter in the book A Primer on Scientific Programming with Python, 4th edition, by the same author, published by Springer, 2014. 7 How to write and run a Python program9 7.1 The need for a text editor......................9 7.2 Spyder................................. 10 7.3 Text editors.............................. 10 7.4 Terminal windows.......................... 11 7.5 Using a plain text editor and a terminal window......... 12 8 The SageMathCloud and Wakari web services 12 8.1 Basic intro to SageMathCloud...................
    [Show full text]
  • Goless Documentation Release 0.6.0
    goless Documentation Release 0.6.0 Rob Galanakis July 11, 2014 Contents 1 Intro 3 2 Goroutines 5 3 Channels 7 4 The select function 9 5 Exception Handling 11 6 Examples 13 7 Benchmarks 15 8 Backends 17 9 Compatibility Details 19 9.1 PyPy................................................... 19 9.2 Python 2 (CPython)........................................... 19 9.3 Python 3 (CPython)........................................... 19 9.4 Stackless Python............................................. 20 10 goless and the GIL 21 11 References 23 12 Contributing 25 13 Miscellany 27 14 Indices and tables 29 i ii goless Documentation, Release 0.6.0 • Intro • Goroutines • Channels • The select function • Exception Handling • Examples • Benchmarks • Backends • Compatibility Details • goless and the GIL • References • Contributing • Miscellany • Indices and tables Contents 1 goless Documentation, Release 0.6.0 2 Contents CHAPTER 1 Intro The goless library provides Go programming language semantics built on top of gevent, PyPy, or Stackless Python. For an example of what goless can do, here is the Go program at https://gobyexample.com/select reimplemented with goless: c1= goless.chan() c2= goless.chan() def func1(): time.sleep(1) c1.send(’one’) goless.go(func1) def func2(): time.sleep(2) c2.send(’two’) goless.go(func2) for i in range(2): case, val= goless.select([goless.rcase(c1), goless.rcase(c2)]) print(val) It is surely a testament to Go’s style that it isn’t much less Python code than Go code, but I quite like this. Don’t you? 3 goless Documentation, Release 0.6.0 4 Chapter 1. Intro CHAPTER 2 Goroutines The goless.go() function mimics Go’s goroutines by, unsurprisingly, running the routine in a tasklet/greenlet.
    [Show full text]
  • IMPLEMENTING OPTION PRICING MODELS USING PYTHON and CYTHON Sanjiv Dasa and Brian Grangerb
    JOURNAL OF INVESTMENT MANAGEMENT, Vol. 8, No. 4, (2010), pp. 1–12 © JOIM 2010 JOIM www.joim.com IMPLEMENTING OPTION PRICING MODELS USING PYTHON AND CYTHON Sanjiv Dasa and Brian Grangerb In this article we propose a new approach for implementing option pricing models in finance. Financial engineers typically prototype such models in an interactive language (such as Matlab) and then use a compiled language such as C/C++ for production systems. Code is therefore written twice. In this article we show that the Python programming language and the Cython compiler allows prototyping in a Matlab-like manner, followed by direct generation of optimized C code with very minor code modifications. The approach is able to call upon powerful scientific libraries, uses only open source tools, and is free of any licensing costs. We provide examples where Cython speeds up a prototype version by over 500 times. These performance gains in conjunction with vast savings in programmer time make the approach very promising. 1 Introduction production version in a compiled language like C, C++, or Fortran. This duplication of effort slows Computing in financial engineering needs to be fast the deployment of new algorithms and creates ongo- in two critical ways. First, the software development ing software maintenance problems, not to mention process must be fast for human developers; pro- added development costs. grams must be easy and time efficient to write and maintain. Second, the programs themselves must In this paper we describe an approach to tech- be fast when they are run. Traditionally, to meet nical software development that enables a single both of these requirements, at least two versions of version of a program to be written that is both easy a program have to be developed and maintained; a to develop and maintain and achieves high levels prototype in a high-level interactive language like of performance.
    [Show full text]
  • MIAMI UNIVERSITY the Graduate School Certification for Approving
    MIAMI UNIVERSITY The Graduate School Certification for Approving the Dissertation We hereby approve the Dissertation of Stephen Hess Candidate for the Degree: Doctor of Philosophy ____________________________________ Director (Dr. Venelin Ganev) ____________________________________ Reader (Dr. Gulnaz Sharafutdinova) ____________________________________ Reader (Dr. Adeed Dawisha) ____________________________________ Graduate School Representative (Dr. Stanley Toops) ABSTRACT AUTHORITARIAN LANDSCAPES: STATE DECENTRALIZATION, POPULAR MOBILIZATION, AND THE INSTITUTIONAL SOURCES OF RESILIENCE IN NONDEMOCRACIES by Stephen Hess Beginning with the insight that highly-centralized state structures have historically provided a unifying target and fulcrum for the mobilization of contentious nationwide social movements, this dissertation investigates the hypothesis that decentralized state structures in authoritarian regimes impede the development of forms of popular contention sustained and coordinated on a national scale. As defined in this work, in a decentralized state, local officials assume greater discretionary control over public expenditures, authority over the implementation of government policies, and latitude in managing outbreaks of social unrest within their jurisdictions. As a result, they become the direct targets of most protests aimed at the state and the primary mediators of actions directed at third-party, non-state actors. A decentralized state therefore presents not one but a multitude of loci for protests, diminishing claimants‘ ability to use the central state as a unifying target and fulcrum for organizing national contentious movements. For this reason, decentralized autocracies are expected to face more fragmented popular oppositions and exhibit higher levels of durability than their more centralized counterparts. To examine this claim, I conduct four comparative case studies, organized into pairs of autocracies that share a common regime type but vary in terms of state decentralization.
    [Show full text]
  • High-Performance Computation with Python | Python Academy | Training IT
    Training: Python Academy High-Performance Computation with Python Training: Python Academy High-Performance Computation with Python TRAINING GOALS: The requirement for extensive and challenging computations is far older than the computing industry. Today, software is a mere means to a specific end, it needs to be newly developed or adapted in countless places in order to achieve the special goals of the users and to run their specific calculations efficiently. Nothing is of more avail to this need than a programming language that is easy for users to learn and that enables them to actively follow and form the realisation of their requirements. Python is this programming language. It is easy to learn, to use and to read. The language makes it easy to write maintainable code and to use it as a basis for communication with other people. Moreover, it makes it easy to optimise and specialise this code in order to use it for challenging and time critical computations. This is the main subject of this course. CONSPECT: Optimizing Python programs Guidelines for optimization. Optimization strategies - Pystone benchmarking concept, CPU usage profiling with cProfile, memory measuring with Guppy_PE Framework. Participants are encouraged to bring their own programs for profiling to the course. Algorithms and anti-patterns - examples of algorithms that are especially slow or fast in Python. The right data structure - comparation of built-in data structures: lists, sets, deque and defaulddict - big-O notation will be exemplified. Caching - deterministic and non-deterministic look on caching and developing decorates for these purposes. The example - we will use a computionally demanding example and implement it first in pure Python.
    [Show full text]
  • Python Guide Documentation 0.0.1
    Python Guide Documentation 0.0.1 Kenneth Reitz 2015 11 07 Contents 1 3 1.1......................................................3 1.2 Python..................................................5 1.3 Mac OS XPython.............................................5 1.4 WindowsPython.............................................6 1.5 LinuxPython...............................................8 2 9 2.1......................................................9 2.2...................................................... 15 2.3...................................................... 24 2.4...................................................... 25 2.5...................................................... 27 2.6 Logging.................................................. 31 2.7...................................................... 34 2.8...................................................... 37 3 / 39 3.1...................................................... 39 3.2 Web................................................... 40 3.3 HTML.................................................. 47 3.4...................................................... 48 3.5 GUI.................................................... 49 3.6...................................................... 51 3.7...................................................... 52 3.8...................................................... 53 3.9...................................................... 58 3.10...................................................... 59 3.11...................................................... 62
    [Show full text]
  • Jacob Austin Matthew Bowers Rebecca Cawkwell Sanford Miller
    Coral Jacob Austin Matthew Bowers Rebecca Cawkwell Sanford Miller * please note that this presentation theme is also called Coral The Coral Team* Rebecca Cawkwell Matthew Bowers Sanford Miller Jacob Austin Manager & Codegen Language Guru Semant Architect Tester Architect Loves Coral Snakes are nice Passionately I lik snek Snakes hates snakes *with guidance by Lauren Arnett Our Inspiration ● Coral to Python as TypeScript to Javascript ● Type Safety: optional static typing enforced at compile and runtime. ● Optimization: use type-inference to generate code as fast as C. Source: Pintrest What is ● Dynamically typed programming language ● Cross compatible with Python ● Optional static typing enforced by the compiler and runtime environment ● Type inference and optimization based on static typing ● Types: int, char, float, boolean, strings, lists ● First class functions ● No classes (no time) ● Compile and runtime exceptions Implementation Architectural Design Code source.cl Scanner Parser Semant coral.native Generation LLC executable Coral v Python ● Coral is a smaller version of Python with extended support for typing. PYTHON ● Coral uses the same syntax as Python, allowing for cross compatibility ● The difference between Coral and Python is our optimization and CORAL Haskell safety OCaml The Speed of C The Safety of C Comparison to Python Wall-time on simple programs allows comparison between Coral and Python. For a program like this: performance is about 40 times faster (.4 seconds to 23.4 seconds wall time). Key Features Syntax & Grammar ● Coral strictly follows the current Python 3.7 syntax, and any valid Coral program can also be run and compiled by an up-to-date Python 3.7 interpreter.
    [Show full text]
  • Python Guide Documentation Publicación 0.0.1
    Python Guide Documentation Publicación 0.0.1 Kenneth Reitz 17 de May de 2018 Índice general 1. Empezando con Python 3 1.1. Eligiendo un Interprete Python (3 vs. 2).................................3 1.2. Instalando Python Correctamente....................................5 1.3. Instalando Python 3 en Mac OS X....................................6 1.4. Instalando Python 3 en Windows....................................8 1.5. Instalando Python 3 en Linux......................................9 1.6. Installing Python 2 on Mac OS X.................................... 10 1.7. Instalando Python 2 en Windows.................................... 12 1.8. Installing Python 2 on Linux....................................... 13 1.9. Pipenv & Ambientes Virtuales...................................... 14 1.10. Un nivel más bajo: virtualenv...................................... 17 2. Ambientes de Desarrollo de Python 21 2.1. Your Development Environment..................................... 21 2.2. Further Configuration of Pip and Virtualenv............................... 26 3. Escribiendo Buen Código Python 29 3.1. Estructurando tu Proyecto........................................ 29 3.2. Code Style................................................ 40 3.3. Reading Great Code........................................... 49 3.4. Documentation.............................................. 50 3.5. Testing Your Code............................................ 53 3.6. Logging.................................................. 57 3.7. Common Gotchas...........................................
    [Show full text]
  • Introduction to Python (Or E7 in a Day ...Plus How to Install)
    What is \Python" Getting Started \Matrix Lab" How to Get it All Intricacies Introduction to Python (Or E7 in a Day ...plus how to install) Daniel Driver E177-Advanced MATLAB March 31, 2015 What is \Python" Getting Started \Matrix Lab" How to Get it All Intricacies Overview 1 What is \Python" 2 Getting Started 3 \Matrix Lab" 4 How to Get it All 5 Intricacies What is \Python" Getting Started \Matrix Lab" How to Get it All Intricacies What is \Python" What is "Python" What is \Python" Getting Started \Matrix Lab" How to Get it All Intricacies What is Python Interpreted Language Code Read at Run Time Dynamic Variables like MATLAB A='I am a string' A=3 Open Source Two Major Versions python 2.x -Older python 3.x -Newer Largely the Same for in Day to Figure : Python Logo Day use Will discuss differences later https://www.python.org/downloads/ What is \Python" Getting Started \Matrix Lab" How to Get it All Intricacies CPython-The \Python" You Think of CPython is Python implemented in C Generally when people say \Python" This is probably what they are referring to This is what we will be referring in this presentation. Python code interpreted at Run time Turns into byte code Byte code on Python Virtual Machine Not to be confused with Cython (which is a python library that compiles python into C code) http://www.thepythontree.in/python-vs-cython-vs-jython-vs- ironpython/ What is \Python" Getting Started \Matrix Lab" How to Get it All Intricacies Other Implementations of Python Python interface also implemented in Java:Jython-bytecode runs on Java
    [Show full text]
  • Nuitka User Manual Contents
    Nuitka User Manual Contents Overview 1 Usage 1 Requirements 1 Command Line 3 Installation 3 License 3 Tutorial Setup and build on Windows 3 Setup 4 Install Python 4 Install Nuitka 4 Write some code and test 4 Create a folder for the Python code 4 Test your program 4 Build it using 4 Run it 5 Distribute 5 Use Cases 5 Use Case 1 - Program compilation with all modules embedded 5 Use Case 2 - Extension Module compilation 6 Use Case 3 - Package compilation 7 Use Case 4 - Program Distribution 7 Tweaks 8 Icons 8 Splash screen 9 Typical Problems 9 Memory issues and compiler bugs 9 Avoid 32 bit C compiler/assembler memory limits 9 Use LTO compilation or not 10 Switch the C compiler to clang 10 Add a larger swap file to your embedded Linux 10 Limit the amount of compilation jobs 10 Dynamic sys.path 10 Missing data files in standalone 10 Missing DLLs in standalone 10 Dependency creep in standalone 10 Onefile: Finding files 11 Windows Programs without console give no errors 11 Tips 11 Nuitka Options in the code 11 Python command line flags 12 Caching compilation results 12 Control where Caches live 12 Runners 12 Fastest C Compilers 12 Unexpected Slowdowns 13 Standalone executables and dependencies 13 Windows errors with resources 13 Windows standalone program redistribuation 13 Detecting Nuitka at run time 14 Performance 14 pystone results 14 Where to go next 14 Follow me on Twitter 14 Report issues or bugs 14 Word of Warning 15 Join Nuitka 15 Donations 15 Unsupported functionality 15 The co_code attribute of code objects 15 PDB 16 Optimization 16
    [Show full text]
  • Picolibc a C Library for Smaller Systems
    picolibc A C Library for Smaller Systems Keith Packard -9 Senior Principal Technologist Amazon [email protected] c Hello !y name is Keith Packard" # $ork in the De&ice 'S gro(p at Amazon as a Senior Principal )ngineer. Today" #*m going to talk abo(t picolibc" a C library designed for embedded +,- and ./- bit microcontrollers. picolibc ● 0hy start another C library pro1ect2 ● How picolibc $as de&eloped? ● 0hat are the results2 ● 0ho is using picolibc2 ● 0here is picolibc going in the future2 #n this presentation" #*ll describe $hat # see as the re3(irements for an embedded C library" the pieces from $hich picolibc $as b(ilt" ho$ de&elopment progressed" res(lts of that de&elopment along $ith se&eral pro1ects that ha&e picolibc s(pport integrated into them. Finally" #*ll brie5y to(ch on f(t(re $ork that # hope to see done in picolibc. Small System Considerations ● Small !emory 6think k7" not 879 – RA! is more constrained than :'! – A&oid using the heap ● Limited 5oating point – !ay have only +,-bit 5oats – !ay have none at all ● 8etting started is hard Small systems are small. They can be really small. The embedded hard$are # 5y (ses systems $ith +,k7 to ;,<k7 or :'! and /k7 to +,k7 of :A!. They often (se lo$-performance +,-bit cores" some have a +,-bit 4P=" b(t many ha&e no 4PU at all. De&elopers $riting long-r(nning embedded soft$are often $ant to a&oid depending on dynamic allocation as it*s easist to pro&e malloc $ill ne&er fail if malloc is not linked into the application.
    [Show full text]