当前位置: 首页 > news >正文

农产品电商网站建设的主要工作怎样找到网站建设设置模板

农产品电商网站建设的主要工作,怎样找到网站建设设置模板,深圳附近做个商城网站哪家公司便宜点,网站建设一般需要多少钱目录 1. 说明 2. PHP脚本性能监测方案 2.1 安装xdebug 2.2 配置xdebug.ini 2.3 命令行与VS Code中使用 - 命令行 - VS Code 2.4 QCacheGrind 浏览 3. Python脚本性能监测方案 3.1 命令行 4. 工具 5.参考 1. 说明 获取我们的脚本程序运行时的指标,对分析…

目录

1. 说明

2. PHP脚本性能监测方案

2.1 安装xdebug

2.2 配置xdebug.ini 

2.3 命令行与VS Code中使用

- 命令行

- VS Code

2.4 QCacheGrind 浏览

3. Python脚本性能监测方案

3.1 命令行

4. 工具

5.参考


1. 说明

      获取我们的脚本程序运行时的指标,对分析与解决性能瓶颈问题是非常重要的一环,以下介绍在PHP与Python下的实践方案:安装性能监测插件 + 产生监测日志 + 用QCacheGrind工具分析
 

2. PHP脚本性能监测方案

2.1 安装xdebug
# wsl2下的ubuntu20 LTS为例apt install php7.4-xdebug

2.2 配置xdebug.ini 

tips: 路径可通过查php -i|grep xdebug.ini获取

zend_extension=xdebug.so# 指定日志输出路径
xdebug.output_dir = "/xdebug_logs"
xdebug.profiler_append = 0xdebug.mode = profile
xdebug.start_with_request = trigger
xdebug.log_level = 7
2.3 命令行与VS Code中使用
- 命令行
php -dxdebug.mode=profile myscript
- VS Code

切记:vscode运行时连接WSL,选择对应的ubuntu目录,不然你的运行环境将不一致

普通的launch.json

{"name": "Debug current script in console","type": "php","request": "launch","program": "${file}","cwd": "${fileDirname}","runtimeArgs": ["-d xdebug.mode=profile"],"externalConsole": false,"port": 9003
}

以TP6为例的launch.json

{"name": "Run PHP Profile","type": "php","request": "launch","cwd": "${workspaceRoot}","program": "${workspaceRoot}/think","args": ["myaction","0"],"runtimeArgs": ["-d xdebug.mode=profile"],"externalConsole": false,"port": 9003
}

截图: 

2.4 QCacheGrind 浏览

 生成的日志保存在 \\wsl.localhost\Ubuntu-20.04\xdebug_logs

 

3. Python脚本性能监测方案

python内部已经提供了cProfile性能监测模块,我们用它就好,只需要把它出来的文件转换一下

3.1 命令行
# 产生日志到./tmp/profile_output.prof
python -m cProfile -o ./tmp/profile_output.prof ./class_test2.py# 转换格式
python -m pyprof2calltree -i profile_output.prof -o callgrind.cprof

4. 工具

工具说明
QCacheGrind

windows工具,能可视化查看callgrind格式的性能数据

下载:https://sourceforge.net/projects/qcachegrindwin/

PHP
XDebug官网: Xdebug - Debugger and Profiler Tool for PHP
Python
cProfile内置标准模块, 性能分析模块
例子: python -m cProfile -o ./tmp/profile_output.prof ./class_test2.py
pyprof2calltree把cprofile产生的性能日志转换为QCacheGrind格式,
例子: python -m pyprof2calltree -i profile_output.prof -o callgrind.cprof

5.参考

- Xdebug: Documentation » Profiling

- The Python Profilers — Python 3.13.0 documentation

- https://gist.github.com/Susensio/efd9422e14556dff4122434c3603aff3

http://www.yayakq.cn/news/601834/

相关文章:

  • 网站开发与应用是什么seo服务公司排名
  • 中国设计在线网站山东省建设工程领域挂证存颖网站
  • 网站设置关于我们怎么做网页视频下载不了
  • dw网站管理与建设珠海百度搜索排名优化
  • 曲阜市古建设计院网站电子商务网站建设论文资料
  • 简述企业网站的网络营销功能门户网站建设 管理 自查报告
  • 网站建设的目标是用凡科建设网站
  • 巴中网站建设天仁云企业做商城网站需要什么资质
  • 昆明网站服务wordpress加入夜间模式
  • 做原创品牌服饰的网站什么网站做外链优化好
  • 做网站架构需要什么步骤谷歌做网站
  • 医疗网站如何做优化电影网站做视频联盟
  • 上国外网站 dns民宿网站开发的开题报告
  • 解决国外网站很慢长春做网站推荐选吉网传媒好
  • 电子商务网站设计的书网站主体负责人查询
  • 树状结构的网站网站建设工作人员有哪些职责
  • 商务网站建设sz886wordpress安装到跟目录
  • 自己电脑做网站好吗网站电子地图怎么做
  • 住房与建设局网站wordpress为什么用循环
  • 扁平配色网站小程序价格多少钱
  • 东莞网站建设网络公司排名河南住建局和城乡建设
  • jsp借书网站开发网址怎么申请注册
  • 成都好的网站设计公司wordpress 4.7.3主题
  • 有哪些做的好的营销型网站指数运算公式大全
  • 关于网站制作的论文下列关于网站制作的
  • 广元市网站建设linux wordpress 301
  • 如何制作网站平台wordpress覆盖密码重置
  • 微信小程序云开发文档seo网站的锚文本怎么写
  • 盐城国有资源土地建设交易网站wordpress主题模板调用
  • 查询网站流量排名百度关键词竞价查询系统