maybe speed up term scroll byt skipping compare work

since nothing useful is actually done unless either oldc or newc have
a media char - then try return/skip early. might speed up by 2-5%...
(i see 4.05 vs 4.15 or so cat times for a test case).
This commit is contained in:
Carsten Haitzler 2013-10-25 23:37:10 +09:00
parent 82f4d3546a
commit 8585c3e9c2
2 changed files with 4 additions and 3 deletions

View File

@ -1436,7 +1436,8 @@ _handle_block_codepoint_overwrite(Termpty *ty, int oldc, int newc)
{
Termblock *tb;
int ido = 0, idn = 0;
if (!((oldc | newc) & 0x80000000)) return;
if (oldc & 0x80000000) ido = (oldc >> 18) & 0x1fff;
if (newc & 0x80000000) idn = (newc >> 18) & 0x1fff;
if (((oldc & 0x80000000) && (newc & 0x80000000)) && (idn == ido)) return;

View File

@ -149,18 +149,18 @@ struct _Termcell
struct _Termsave
{
unsigned int gen : 8;
unsigned int comp : 1;
unsigned int z : 1;
unsigned int gen : 8;
unsigned int w : 22;
Termcell cell[1];
};
struct _Termsavecomp
{
unsigned int gen : 8;
unsigned int comp : 1;
unsigned int z : 1;
unsigned int gen : 8;
unsigned int w : 22; // compressed size in bytes
unsigned int wout; // output width in Termcells
};