Sebastian Witowski - Writing faster Python

Поделиться
HTML-код
  • Опубликовано: 19 ноя 2024

Комментарии • 60

  • @mateuszkurowski4510
    @mateuszkurowski4510 6 лет назад +125

    One more thing the guy has missed: watching RUclips videos at x2 speed makes you write faster Python

  • @LaurentLaborde
    @LaurentLaborde 4 года назад +10

    FINALLY a performance oriented talk that actually helped me ! now i hate python slightly less that an hour ago :D

  • @vermaprashant15
    @vermaprashant15 3 года назад +7

    Great conferences. I liked and watched it at 1.75x to 2x 😂

  • @ukrainian333
    @ukrainian333 2 года назад

    I'm was looking for this kind of video for years...

  • @sheikhakbar2067
    @sheikhakbar2067 4 года назад +4

    That was a good video to listen to while driving to buy falafel! I finished eating them and I have five more minutes to listen to!

  • @marcd4144
    @marcd4144 5 лет назад +2

    You know you're big shit when you're walking around on stage with no shoes on at a Dev event. lol

  • @BryanJenks
    @BryanJenks 3 года назад +1

    i know this is a man of culture because his code is in Gruvbox 🤣

  • @matthias-vomr
    @matthias-vomr 8 лет назад +16

    Great talk. A lot of useful stuff

  • @nelsonjma
    @nelsonjma 6 лет назад +4

    excellent ideas, thanks for the information.

  • @name6297
    @name6297 5 лет назад +1

    12:05 would range function be a better option ?

  • @willemvdk4886
    @willemvdk4886 3 года назад +1

    I started skipping the first few minutes because I need my answers faster.

  • @pemessh
    @pemessh 3 года назад

    Couple of the slides had code that used ,
    try except block, and in except block there was 'pass'.
    Please do not do this. At least log something silently. That way you know what's going on and it works too.

    • @sorry4all
      @sorry4all 3 года назад +2

      Definitely. It's the best way to hide an error

  • @twnfaem
    @twnfaem 5 лет назад +1

    Thanks a lot Sebastian! A bunch of useful stuff in there, indeed!

  • @flamendless
    @flamendless 2 года назад +2

    Instead of optimizing, just by a faster hardware? What 😂

  • @RoamingAdhocrat
    @RoamingAdhocrat 3 года назад

    Using comic sans in the chyron makes for faster code.

  • @NirHaramati
    @NirHaramati 5 лет назад +3

    Brilliant! Thanks.

  • @broccoloodle
    @broccoloodle 4 года назад

    Weren't most of them optimized with JIT compiling alr?

    • @MrLehoczky
      @MrLehoczky 3 года назад +1

      CPython uses AOT compiler instead of JIT. However there is an alternative language implementation called PyPy with JIT compilation but it's not that widely used

  • @keithcu2
    @keithcu2 6 лет назад +5

    Great, but he should have talked about Cython as an option instead of C/C++.

  • @prat-man
    @prat-man 4 года назад

    I needed this

  • @smackronme
    @smackronme 7 лет назад +65

    skip to 6:15

  • @αλήθεια-σ4κ
    @αλήθεια-σ4κ 5 лет назад +3

    Don't agree with everything thing -
    Writhing performent code should be a habit not a after thought.
    Writhing code without performance in mind and then trying to optimise it later is not the best strategy, sometime it may not even work. It may require too much of design change, too much re-testing.
    Write optimum code from the beginning. Profile later to see if any small tweaks are required.
    I have see bad design where people were talking abt. h/w upgrades. Looked at the code, changed the design ...12 hr. execution time reduced to 3 mins.

  • @JoshuaShope
    @JoshuaShope 7 лет назад +2

    Not fast because Python2

  • @JLPT-AIsensei
    @JLPT-AIsensei 2 года назад

    Great job but after that Python is still very slow.

  • @ingframin
    @ingframin 8 лет назад +15

    "if you want your code to run faster you can start getting faster hardware in a first place"... Come on really? -.-"

    • @eljapel
      @eljapel 6 лет назад +11

      hardware is cheaper.

  • @TheGodSaw
    @TheGodSaw 5 лет назад +1

    to write fast python. never write any algo yourself. Also, if you are using a for loop chances are you are doing something wrong. Got it.

    • @ds-mi4od
      @ds-mi4od 5 лет назад +1

      Godsaw this is a joke right

  • @LashyYT
    @LashyYT 5 лет назад +1

    I’m a beginner with python
    Print (“hello world”)
    Hello world
    A = ‘hello’
    A
    Hello

  • @JakubArnold
    @JakubArnold 6 лет назад +1

    At 12:40 ... 222ms vs 127ms and he says 75% faster?

    • @valentinkhomuteno6825
      @valentinkhomuteno6825 6 лет назад +2

      222 is 175% of 127, I think that what he meant. And he is right, in a way.

    • @tomriddle2257
      @tomriddle2257 6 лет назад

      I don't get the problem either. It's correct imo or how would you calculate it?

  • @rockybangalore3830
    @rockybangalore3830 5 лет назад +1

    Witing faster python, skip the aplhabets

  • @vwwvwwwvwwwvwwvvwwvw
    @vwwvwwwvwwwvwwvvwwvw 7 лет назад +2

    what does the % before timeit do? as in %timeit

  • @sivasankar2784
    @sivasankar2784 3 года назад +1

    The audience not laughing at this first joke must be demoralizing af.

  • @lionpersia
    @lionpersia 6 лет назад +2

    Didn't expect such a high-pitch voice from such a large guy.

  • @Penta_Penguin_237
    @Penta_Penguin_237 3 года назад +1

    Such a loser mentality. Most times faster code is just faster code. Often even more stable. Use C compiled libraries such as Numpy or accelerators like Numba has no downsides

  • @MrSkinkarde
    @MrSkinkarde 2 года назад +1

    Slowest language ever

    • @kaushik853
      @kaushik853 2 года назад

      Better than the Monster lik Java

  • @lepidoptera9337
    @lepidoptera9337 3 года назад +1

    Oh, boy, that was a waste of time. Picking faster hardware rather than a faster algorithm? In what universe does this dude live?

    • @jphvnet
      @jphvnet 3 года назад

      If you are capable of refactoring in a good way, new hardware will be cheaper 😉

    • @lepidoptera9337
      @lepidoptera9337 3 года назад

      @@jphvnet Refactoring has nothing to do with performance. Are you sure you understand what a compiler does?

  • @DrBPhD
    @DrBPhD 5 лет назад +2

    Python is incompatible with sustainability. The language is in fact so
    highly (energy) inefficient that it should be banned. It's effect on
    performance directly relates to energy demands higher by 2 orders of
    magnitude (100 times) when compared to codes written in C for instance.
    Python's CO2 fingerprint is therefore of unacceptable magnitude. Most
    interpreted languages suffer from similar shortcomings by the way, in
    contrast to compiled languages.

    • @WerexZenok
      @WerexZenok 4 года назад +4

      That's a short sighted view.
      With python you have less time training people to code and also less time building your program.

    • @DrBPhD
      @DrBPhD 4 года назад

      @@WerexZenok Training people to code and building programs probably (even likely) has a much lower energy fingerprint than actually running the programs and applications (over and over again). The energy-efficiency of computer languages will be of increasing importance in the future. Python scores unacceptably low in this respect.

    • @WerexZenok
      @WerexZenok 4 года назад +9

      @@DrBPhD Well, i'm medic and i'm building AI projects with Python.
      That wouldn't be possible with C, because I would need to lose too much time learning about the language and fixing small syntax errors instead of focussing on the project itself.
      I already did a research project using a pyautogui.
      I started with C, but turned out to be impossible to proceed in a reasonable velocity using C. I changed python and managed to do it in time.
      If i want velocity in any part of my code i can change to C just in that part.
      In other words:
      Python - velocity to build the program.
      C - velocity to run the progam.

    • @carlossegura403
      @carlossegura403 4 года назад +2

      Not saying you are wrong but did you forget, including “time” into your optimization paradigm? By “time,” I mean the average lifespan of human life on this planet, around 79 years. Beyond anything, time is the most limited resource, as it cannot be created, thus making it the most valuable. Every product and service, including computers and software, exists only for one reason - to save us time! With the proofs mentioned above, we can understand why Python is popular and why your statement is false concerning “energy and sustainability.” I use python because it lets me focus on the problem more than any other language has, and it is the reason it's perfect for data science.
      Lastly, languages like C, C++ are also important and I cannot discard them as less important to Python. No one is better than the other; we must learn to appreciate what both worlds contribute towards software development and engineering.

    • @DrBPhD
      @DrBPhD 4 года назад +1

      @@carlossegura403 Every product and service, including computers and software, exists only for one reason - to save us time!
      That is a misconception. Every good product and service exists for one sole purpose: to increase the quality of life. And if I really want to save time I write and run Fortran, which is still the language for large-scale scientific computing par excellence. In fact, the only reason Fortran survived until today IS time and speed. Python on the other hand is grotesquely inefficient. And with a substantial percentage of our energy consumption already being accounted for by information-technologies, sustainability-issues are at the heart of the problems connected with time and energy-inefficient languages. Also, if you master a programming language properly it always lets you focus entirely on the problem itself. No need for Python in that respect, there's a multitude of alternatives which give you speedy code AND ease of use.