Skip to content

Instantly share code, notes, and snippets.

@ccwang002
Created September 3, 2013 09:08
Show Gist options
  • Save ccwang002/6421460 to your computer and use it in GitHub Desktop.
Save ccwang002/6421460 to your computer and use it in GitHub Desktop.
# same as Mynt, which requires PyYAML
from yaml import load_all
with open('this_file.md') as f:
# "---" is used to separate mutliple YAML entries,
# so the loader returns a generator
yaml_gen = load_all(f.read(), Loader=Loader)
description = next(yaml_gen) # get first entry only
print(description) # description should be a dict
---
layout: fb_fan
title: &title A guide to analyzing Python performance
author: 亮亮
source:
title: *title
author: Huy Nguyen
link: http://www.huyng.com/posts/python-performance-analysis/
# pic: /path/to/post/pic.png # 粉絲頁連結的圖片
abstract:
# 這邊可以打多行的簡單介紹,但因為主要是發在 FB 粉絲頁上,
# 要盡量控制文長,並且不支援任何 markdown 語法。
>
本篇文章介紹如何使用 Python 套件來衡量 Python 程式的執行效率,
分別從執行時間、記憶體用量來找出 bottleneck 以及 memory leak 的所在處。
文中提供了豐富的範例程式與說明,也介紹了從基本到進階的分析方法,
想要提昇程式的效率?本文值得各位參考!
---
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment