Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

不够优化啊 #3

Open
foxmale007 opened this issue Jun 8, 2023 · 2 comments
Open

不够优化啊 #3

foxmale007 opened this issue Jun 8, 2023 · 2 comments

Comments

@foxmale007
Copy link

可以做3个优化:
1)将全部字体数据一次读取到内存里,然后在内存里用stream去查找
2)循环里去创建 framebuf.FrameBuffer(bytearray(byte_data), font_size, font_size, framebuf.MONO_HLSB)非常慢,将FrameBuffer和字体缓冲提取到对象属性里,避免每显示一个字符都创建一次FrameBuffer
3)然后在get_bitmap时直接readinto到FrameBuffer的缓冲区

@foxmale007
Copy link
Author

忘了提醒2的代码是自己改过的,用于单色屏,在低速的micropython设备上改进后发现提速明显

@AntonVanke
Copy link
Owner

AntonVanke commented Jun 11, 2023

🤣 下次尝试一下
不过一次读取8266不够啊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants