
需求
尽管网上已经很多python图形化性能分析的帖子,比如vprof,pyheat等等。
但是亲测都不好用,原因两点:
- 版本兼容问题导致的环境搭建困难。照着那些帖子做,做了发现报错,根本运行不了。尤其是在python2上开发的库。
- 只能分析单个文件,好看不实用。比如pyheat。
本文的作用是较少一种从0到1完整图形性能分析的方法。该方式基于以下工具:
- cProfile
- pstats
- Gprof2Do(dot)
- VS Code(powershell)
缺失模块。
1、请确保node版本大于6.2
2、在博客根目录(注意不是yilia根目录)执行以下命令:
npm i hexo-generator-json-content --save
3、在根目录_config.yml里添加配置:
jsonContent:
meta: false
pages: false
posts:
title: true
date: true
path: true
text: false
raw: false
content: false
slug: false
updated: false
comments: false
link: false
permalink: false
excerpt: false
categories: false
tags: true