Anjana Vakil - Exploring Python Bytecode

Ғылым және технология

Anjana Vakil - Exploring Python Bytecode
[EuroPython 2016]
[20 July 2016]
[Bilbao, Euskadi, Spain]
(ep2016.europython.eu//confere...)
Do you ever wonder how your Python code looks to the interpreter? What
those `.pyc` files are? Why one program outperforms another, even if
the code is similar? Then let’s dive into Python bytecode! Bytecode is
the "intermediate language" that expresses your source code as machine
instructions the interpreter can understand. In this talk we’ll see
what role it plays in executing Python programs, learn to read it with
the `dis` module, and analyze it to better understand a program’s
performance.
-----
Do you ever wonder what your simple, beautiful Python code looks like
to the interpreter? Are you starting to get curious about those `.pyc`
files that always pop up in your project, and you always ignore? Would
you like to start investigating your Python code's performance, and
learn why some programs you write run faster than others, even if the
code looks more or less the same? Have you simply fallen so completely
in love with Python that you're ready to peer deep inside its soul?
If you, like me, answered "yes" to any of these questions, join me in
an illuminating adventure into the world of Python bytecode! Bytecode
is the "intermediate language" that expresses your Python source code
as machine instructions the interpreter (specifically CPython, the
"standard" interpreter) can understand. Together we'll investigate
what that means, and what role bytecode plays in the execution of a
Python program. We'll discover how we simple humans can read this
machine language using the `dis` module, and inspect the bytecode for
some simple programs. We'll learn the meaning of a few instructions
that often appear in our bytecode, and we'll find out how to learn the
rest. Finally, we'll use bytecode to understand why a piece of Python
code runs faster if we put it inside of a function.
When you go home, you'll be able to use bytecode to get a deeper
understanding of your Python code and its performance. The adventure
simply starts here; where it ends is up to you!

Пікірлер: 19

  • @lezwon
    @lezwon3 жыл бұрын

    Wow. this talk was really helpful. Got a lot of my confusion cleared. Thanks, Anjana. \m/

  • @DaniEIdiomas
    @DaniEIdiomas7 жыл бұрын

    This has been an incredibly useful video to take notes from. Thanks for the presentation and uploading the video!

  • @tekenateifranklyn3922
    @tekenateifranklyn3922 Жыл бұрын

    Thank you so much Anjana, you've just clear my doubt on python bytecode and the dis method.

  • @AlejandroVillamarin
    @AlejandroVillamarin7 жыл бұрын

    Shame I missed it on the Conference...this is just great!

  • @ibrahimk6729
    @ibrahimk67294 жыл бұрын

    Thanks for the talk,

  • @samshanmukh
    @samshanmukh7 жыл бұрын

    that was really nice and important.

  • @MrMultikopi
    @MrMultikopi3 жыл бұрын

    Anjana is the best. Love her.

  • @victortrevino6330
    @victortrevino63307 жыл бұрын

    Great talk. :thumbsup:

  • @cavink5342
    @cavink53425 жыл бұрын

    good presentation

  • @arjunkirpal9776
    @arjunkirpal97766 жыл бұрын

    Awesome

  • @myronww
    @myronww5 жыл бұрын

    The reason the return did not show up with a line number is because you used an implied return. If you put an actual line of code at the end of your function with a return, it will get a line of code. FYI, if there is a line of code you can hang a breakpoint on return

  • @yashsvidixit7169
    @yashsvidixit71692 жыл бұрын

    I'm here only because of Anjana ❤️

  • @gowthamtech4109
    @gowthamtech41095 жыл бұрын

    I like your speech anjana😍

  • @sntshkmr60
    @sntshkmr607 жыл бұрын

    Love you Anjana!

  • @mohmutakin791
    @mohmutakin7912 жыл бұрын

    Any tool to fast back modul dis to bytecode

  • @tanphamnhat804
    @tanphamnhat8047 жыл бұрын

    i dont understand what she said but i really love her

  • @nononnomonohjghdgdshrsrhsjgd
    @nononnomonohjghdgdshrsrhsjgd2 жыл бұрын

    she nerves as hell

  • @rajdep561
    @rajdep5615 жыл бұрын

    It's a waste of time

  • @sawajaysharma

    @sawajaysharma

    3 жыл бұрын

    Why?

Келесі