esp单片机下arduino_gfx不相干显示驱动优化对flash空间的占用对比

一般情况下,很多esp32或者esp8266下的tft模块驱动都会包含很多种,而我们只需要其中一种,那就有个疑问这些被编译进的显示驱动到底占用了多少空间,是否需要把他优化掉?

这是默认的驱动列表:

84个文件,430k

 

这是优化后的驱动列表,只保留了两种驱动

6个文件,81.6k

优化前编译占用

esp8266

RAM:   [====      ]  44.6% (used 36540 bytes from 81920 bytes)
Flash: [===       ]  33.9% (used 353793 bytes from 1044464 bytes)

esp32

RAM:   [=         ]   6.7% (used 21972 bytes from 327680 bytes)
Flash: [===       ]  31.0% (used 406525 bytes from 1310720 bytes)

优化后编译占用

esp8266

RAM:   [====      ]  44.6% (used 36504 bytes from 81920 bytes)
Flash: [===       ]  33.8% (used 353277 bytes from 1044464 bytes)

 esp32

RAM:   [=         ]   6.7% (used 21964 bytes from 327680 bytes)
Flash: [===       ]  30.3% (used 397645 bytes from 1310720 bytes) 

这肯定是有相差的,但是这种相差基本可以忽略。

基于这个驱动还做了不相干开发板的各种清除,结果一样,大概也都是只优化了0.1%,所以最后的结论是:

这些不相干的驱动并不会占用太多的flash空间,完全可以忽略不计。

做这个的比对起因是编译器每次都把不相干的驱动编译一次占用了大量的编译时间,有可能是有编译没有包含;虽然这个比对是基于arduino_gfx的,但是tft_espi理论上是同样的。

补充说明:

把驱动从arduino_gfx切换为tft_espi后占用对比:

arduino_gfx:

esp8266

RAM:   [====      ]  44.6% (used 36504 bytes from 81920 bytes)
Flash: [===       ]  33.8% (used 353277 bytes from 1044464 bytes)

esp32

RAM:   [=         ]   6.7% (used 21964 bytes from 327680 bytes)
Flash: [===       ]  30.2% (used 395717 bytes from 1310720 bytes)

tft_espi:

esp8266

RAM:   [====      ]  36.4% (used 29844 bytes from 81920 bytes)
Flash: [====      ]  36.3% (used 379501 bytes from 1044464 bytes)

esp32

RAM:   [=         ]   6.8% (used 22284 bytes from 327680 bytes)
Flash: [===       ]  30.0% (used 392929 bytes from 1310720 bytes)

 

在esp8266下,tft_espi的RAM占用要优于arduino_gfx,但是磁盘占用要稍微多一点,在esp32下两者相差不大

最近更新

  1. TCP协议是安全的吗?

    2024-03-27 05:30:09       18 阅读
  2. 阿里云服务器执行yum,一直下载docker-ce-stable失败

    2024-03-27 05:30:09       19 阅读
  3. 【Python教程】压缩PDF文件大小

    2024-03-27 05:30:09       19 阅读
  4. 通过文章id递归查询所有评论(xml)

    2024-03-27 05:30:09       20 阅读

热门阅读

  1. Python中类(class)的使用方法

    2024-03-27 05:30:09       19 阅读
  2. React Native获取及监听网络状态

    2024-03-27 05:30:09       19 阅读
  3. docker 安装 kibana

    2024-03-27 05:30:09       22 阅读
  4. python项目练习——4.手写数字识别

    2024-03-27 05:30:09       22 阅读
  5. eclipse启动报错

    2024-03-27 05:30:09       20 阅读
  6. 阿里云子域名配置,且不带端口访问

    2024-03-27 05:30:09       18 阅读
  7. 面试算法-109-移除元素

    2024-03-27 05:30:09       17 阅读
  8. ADC456456

    2024-03-27 05:30:09       19 阅读
  9. AI学习笔记— 机器学习的种类

    2024-03-27 05:30:09       15 阅读