-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Description
CPU profiling via micro -profile shows that among the CPU time consumed by micro, a large fraction of time is usually spent inside tcell's CanDisplay() function (which is called from screen.SetContent() which is called from displayBuffer()).
In particular, most of the time inside CanDisplay() is spent in runtime.makeslice() -> runtime.mallocgc(), i.e. when allocating memory when creating slices. Most probably it is this code in CanDisplay():
if enc := t.encoder; enc != nil {
nb := make([]byte, 6)
ob := make([]byte, 6)
Micro calls screen.SetContent() for virtually every character on the screen (including blank space), every time when updating the screen, so as a result, it spends time to repeatedly allocate memory for these 2 small temporary slices thousands of times every time.
Commit hash: 828871a
OS: Unix systems
Terminal: any