Cython Workshop

cythonup: a one-day Cython workshop

課程簡介

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

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

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

本次課程,將以 Python2 為主。

課程進行方式

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

課程內容從 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
      • Go Game (weiqi) AI
  • 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

報名及票種說明

報名課程附有發票,發票於上課當天交付,如果發票用於報帳,報名表裡請記得註明統一編號和公司抬頭

下列情況,可優先購買「優惠票」:

  1. 兩人 (以上) 團報 -- 請提供兩人 (以上) 的姓名和 email 資料,每個 email 會收到自己的「邀請碼」
  2. 曾經參加過 PyCon Taiwan / APAC 年會的朋友 -- 請提供 email 和參加過的年份資料

想購買優惠票的朋友,請 email 給 contact@pycourse.org 說明需求狀況,通過的話,我們會寄發「邀請碼」。

請在 30 分鐘內完成報名表單,否則系統將要求重填。

在一天裡完成付款,否則系統將自動取消保留名額。

致謝

感謝 五倍紅寶石 支援活動場地,Open Culture Foundation 開放文化基金會 提供行政支援。

交通方式

  • 教室在漢廷長安大樓 11樓: 位於 承德路 + 長安西路 交叉口
  • 捷運: 靠近 台北火車站 或 中山站, 步行約 5分鐘
  • 開車: 可停 建成國中停車場 費用 30元/小時, 步行約 3分鐘
五倍紅寶石 / 台北市大同區長安西路 150 號 11 樓之 1

Event Tickets

Ticket Type Sale Period Price
一般票

~ 2015/11/14 09:00(+0800) End of Sale
  • TWD$2,500
優惠票

~ 2015/11/14 18:00(+0800) End of Sale
  • TWD$1,500
Next Step