Cython Workshop

cythonup: a one-day Cython workshop

課程簡介

Cython 可以將 Python 程式碼在少量修改的情形下,讓執行效能快上好幾倍,而且能變成編譯過的機器碼形式,成為動態程式庫或單獨執行檔。

利用一些訣竅,能讓程式碼維持 Pythonic 的形式下,速度快上數百至一千倍。有必要的話,還能取消 GIL,讓程式簡單的平行處理。

Cython 還支援 Type Inference, Profiling, Typed Memoryview, Fused Type Generic Programming,支援 C++, Inline 函數。

課程進行方式

學員請自備筆電,課程實際進行前,我們會協助準備好操作環境,包括 Vagrant 設定。

課程內容從 Cython 安裝和基本操作開始,接著說明應用 Cython 的時機,進行手把手範例練習,介紹各式結合 C 程式與效能加速的實務技巧。

課程大綱

  • Introduction and Installation
    1. Introduction to Cython
    2. Build and Running Cython Code
    3. Extenstion Types
    4. Wrapping C library with Cython
    5. Using C++ in Cython
    6. Example Code: chatroom (tentative)
  • Quick Prototyping for Speed
    1. When and when not to use cython for prototyping and speed up
    2. Fused type, type inference and Jedi typer automatic type injection
    3. Multithreading and GIL
    4. Typed memoryviews
    5. Basic hands on examples
    6. More hands on examples (if time permits)
      • Discrete optimization algorithm
      • Brain fuck interpreter
      • CPU emulator
  • Interaction with C
    1. Array-based computing: a complete journey from Python to C
      1. 1D Lax-Wendroff scheme in vanilla Python
      2. Bring in NumPy
      3. Make it Cython
        • Come back to element-wise code from vector-like
      4. Make it C
        • Let's worry about building the code
    2. Tweak pointers between Cython and C
    3. Share declaration between Cython and C

講師

三位講師都精熟多種程式語言,分別在軟體開發、程式教學、科學計算領域,具備多年的實務專業,他們也積極投身 User Group 技術社群,並在歷屆 Python 年會擔任講者或籌備成員。

Introduction and Installation

Instructor: Cheng-Lung Sung

Quick Prototyping for Speed

Instructor: Tzer-jen Wei

Interaction with C

Instructor: Yung-Yu Chen

票種說明

報名課程附有發票,如果發票用於報帳之用,請購買一般票,並註明統一編號和公司抬頭。

曾經參加過 PyCon Taiwan / APAC 或 Python User Group (Meetup) 活動的朋友,可購買老鳥票。

想購買優惠票的朋友,請 email 給 marr.tw@gmail.com 說明需求狀況,通過的話,我們會提供 Promotion Code。

致謝

感謝 Mozilla Community Space 摩茲工寮 支援活動場地,Open Culture Foundation 開放文化基金會 提供行政支援。

Mozilla Community Space 摩茲工寮 / 台北市中正區八德路一段 94 號 3F

Event Tickets

Ticket Type Sale Period Price
一般票

~ 2015/08/01 09:00(+0800) End of Sale
  • TWD$2,500
老鳥票

~ 2015/08/01 09:00(+0800) End of Sale
  • TWD$1,500
優惠票

~ 2015/08/01 18:00(+0800) End of Sale
  • TWD$300
Next Step