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

28 篇文章 2 订阅
24 篇文章 0 订阅

一般情况下,很多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下两者相差不大

  • 3
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值