当前位置:网站首页>A scheme to improve the memory utilization of flutter
A scheme to improve the memory utilization of flutter
2020-11-08 10:29:00 【InfoQ】
background
The image scheme we use is a self-developed external texture scheme :
- Android Side create SurfaceTexture, adopt FlutterJNI Sign up to Flutter engine in , Finally back to texture id to Flutter application layer , Application layer usage Texture Widget and textue id To show the texture of the image .
- Texture data is in Android Side , adopt OpenGL Write the image texture to SurfaceTexture, And then through Flutter engine Shared memory in , Passing texture data to the application layer , Finally handed over to Skia Rendering .
The problem is : Flutter The texture data of the application layer is not cached , Every time you need to put Bitmap Data is rendered into textures , Give it back Flutter Application layer usage .Native Image loading will cache memory ,Flutter The image library provided by itself also has a cache , this 2 The caches are isolated from each other , It takes up a lot of memory . and Flutter The image cache is basically a local resource map , And we Flutter Most of the pages are actually external texture images downloaded from the Internet , This leads to low utilization of cache resources .
analysis
For the above 3 A question , Let's get rid of technology and implement , Suppose you want to solve this 3 A question , What is the ideal solution :
- Texture has no cache , Then we add a texture memory cache in the application layer to solve the problem .
- When the upper application layer has already cached the texture , that Native On the side Bitmap Memory cache can also be removed , Keep only the disk cache of image resources .
- Whole App Memory cache , Only texture caching ,Flutter Of ImageCache cache , In order to avoid the waste of memory resources , Will this 2 One cache is combined into one
Link to the original text :【https://www.infoq.cn/article/4t9HrwJFvRh41X2328Gy】. Without the permission of the author , Prohibited reproduced .
版权声明
本文为[InfoQ]所创,转载请带上原文链接,感谢
边栏推荐
- Improvement of rate limit for laravel8 update
- [summary series] technical system of Internet server: high performance database index
- 5G+AR出圈,中国移动咪咕成第33届中国电影金鸡奖全程战略合作伙伴
- Oops, the system is under attack again
- Function periodic table filter value selectedvalue
- VC + + specified directory file output by time
- Japan PSE certification
- Face recognition: attack types and anti spoofing techniques
- Basic concepts of computer network (5) basic principles of local area network
- Flink's sink: a preliminary study
猜你喜欢
vivoY73s和vivoY70s的区别 vivoY73s和vivoY70s哪个值得入手
python_scrapy_房天下
413【毕设课设】基于51单片机无线zigbee无线智能家居光照温湿度传输监测系统
2020-11-05
TCP协议如何确保可靠传输
What details does C + + improve on the basis of C
比Python快20%,就问你兴不兴奋?
双向LSTM在时间序列异常值检测的应用
211 postgraduate entrance examination failed, stay up for two months, get the byte offer! [face to face sharing]
虚拟机中安装 macOS 11 big sur
随机推荐
Oops, the system is under attack again
Flink's sink: a preliminary study
笔试面试题目:求缺失的最小正整数
推荐一部经济科普视频,很有价值!
5g + Ar out of the circle, China Mobile Migu becomes the whole process strategic partner of the 33rd China Film Golden Rooster Award
[original] about the abnormal situation of high version poi autosizecolumn method
That's what software testing is all about?!
python_scrapy_房天下
211考研失败后,熬夜了两个月拿下字节offer!【面经分享】
Japan PSE certification
一个方案提升Flutter内存利用率
游戏优化性能杂谈(十一) - 知乎
Review the cloud computing application scenarios you didn't expect (Part 1)
How did Julia become popular?
How can a technician take over a complex system?
Six key points of data science interview
Daily challenges of search engines_ 4_ External heterogeneous resources - Zhihu
【总结系列】互联网服务端技术体系:高性能之数据库索引
VC++指定目录下文件按时间排序输出
Mate 40系列发布 搭载华为运动健康服务带来健康数字生活