aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2019-08-22 15:33:23 +0000
committerDaniel Eklöf <daniel@ekloef.se>2019-08-22 15:33:23 +0000
commit7c7720a3ab314e471499194f114797ca7a40afde (patch)
tree1113380cb5fa7456ccebf71ed72c1b9d9d672c14 /scripts
parentgenerate-alt-random-writes: generate color, scroll and scroll region sequences (diff)
scrolling: optimize row access by assuming number of rows is a power of 2
With this assumption, we can replace 'a % b' with 'a & (b - 1)'. In terms of instructions, this means a fast 'and' instead of a slow 'div'. Further optimize scrolling by: * not double-initializing empty rows. Previously, grid_row_alloc() called calloc(), which was then followed by a memset() when scrolling. This is of course unnecessary. * Don't loop the entire set of visible rows (this was done to ensure all visible rows had been allocated, and to prefetch the cell contents). This isn't necessary; only newly pulled in rows can be NULL. For now, don't prefetch at all.
Diffstat (limited to 'scripts')
0 files changed, 0 insertions, 0 deletions