Sebastian Witowski - Writing Faster Python 3

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

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

  • @PaulJurczak
    @PaulJurczak Год назад +2

    @10:47 You are timing both the compilation and execution of Numba example. It is unfair. Numba is able to replace the loop with a formula you show later (Python 3.11, Numba 0.56.4). The execution is extremely fast. On my PC [ms]: Python loop 51.6, NumPy 3.7 and Numba 0.00022! A more "fair" example, i.e. forcing each version to run the loop, would be `total += x%9`. Timing of one million iterations [ms]: Python loop 42.6, NumPy 7.3 and Numba 0.77! Numba is still an order of magnitude faster.

  • @jimratliff
    @jimratliff Год назад

    The best talk I have ever seen on actionable ways to optimize Python source code. Particularly: showing the trade-offs and that the answer is sometimes “it depends.“

  • @nescius2
    @nescius2 Год назад

    40:00 ...don't sacrifice readability for -small performance gains- list comprehensions

    • @barmalini
      @barmalini 11 дней назад

      comprehensions are fine, you just need to write one or two yourself to get familiar with the format and then you feel like missing them

  • @vram288
    @vram288 Месяц назад

    at 15.0 good