boxdot / gurk-rs

Signal Messenger client for terminal
GNU Affero General Public License v3.0
456 stars 33 forks source link

Reuse buffers when drawing #202

Open boxdot opened 1 year ago

boxdot commented 1 year ago

There is a simple optimization which can be done during drawing. In draw.rs, we often allocate new buffer (usually Vecs). Instead we could provide the buffers from the outside and by using v.clear(); v.extend(...) reuse the allocated memory.