Branch: Tag:

2014-05-20

2014-05-20 14:22:53 by Per Hedbor <ph@opera.com>

Changed a few push_constant_text to push_text

push_constant_text generates a lot of code, and the speed difference
is basically zero in this case. In fact, a benchmark loop doing
_sprintf(O) on a stat-object is fairly consistently 1% faster now.

This about halves the size of _stat_index.

452:    switch (THIS_STAT->s.st_mode & S_IFMT)    {    case S_IFREG: -  push_constant_text("-"); +  push_text("-");    break;    case S_IFDIR: -  push_constant_text("d"); +  push_text("d");    break;    case S_IFLNK: -  push_constant_text("l"); +  push_text("l");    break;    case S_IFCHR: -  push_constant_text("c"); +  push_text("c");    break;    case S_IFBLK: -  push_constant_text("b"); +  push_text("b");    break;    case S_IFIFO: -  push_constant_text("f"); +  push_text("f");    break;    case S_IFSOCK: -  push_constant_text("s"); +  push_text("s");    break;    default: -  push_constant_text("?"); +  push_text("?");    break;    }       if ( (THIS_STAT->s.st_mode & S_IRUSR) ) -  push_constant_text("r"); +  push_text("r");    else -  push_constant_text("-"); +  push_text("-");       if ( (THIS_STAT->s.st_mode & S_IWUSR) ) -  push_constant_text("w"); +  push_text("w");    else -  push_constant_text("-"); +  push_text("-");       if ( (THIS_STAT->s.st_mode & S_ISUID) )    if ( (THIS_STAT->s.st_mode & S_IXUSR) ) -  push_constant_text("s"); +  push_text("s");    else -  push_constant_text("S"); +  push_text("S");    else    if ( (THIS_STAT->s.st_mode & S_IXUSR) ) -  push_constant_text("x"); +  push_text("x");    else -  push_constant_text("-"); +  push_text("-");       if ( (THIS_STAT->s.st_mode & S_IRGRP) ) -  push_constant_text("r"); +  push_text("r");    else -  push_constant_text("-"); +  push_text("-");       if ( (THIS_STAT->s.st_mode & S_IWGRP) ) -  push_constant_text("w"); +  push_text("w");    else -  push_constant_text("-"); +  push_text("-");       if ( (THIS_STAT->s.st_mode & S_ISGID) )    if ( (THIS_STAT->s.st_mode & S_IXGRP) ) -  push_constant_text("s"); +  push_text("s");    else -  push_constant_text("S"); +  push_text("S");    else    if ( (THIS_STAT->s.st_mode & S_IXGRP) ) -  push_constant_text("x"); +  push_text("x");    else -  push_constant_text("-"); +  push_text("-");       if ( (THIS_STAT->s.st_mode & S_IROTH) ) -  push_constant_text("r"); +  push_text("r");    else -  push_constant_text("-"); +  push_text("-");       if ( (THIS_STAT->s.st_mode & S_IWOTH) ) -  push_constant_text("w"); +  push_text("w");    else -  push_constant_text("-"); +  push_text("-");       if ( (THIS_STAT->s.st_mode & S_ISVTX) )    if ( (THIS_STAT->s.st_mode & S_IXOTH) ) -  push_constant_text("t"); +  push_text("t");    else -  push_constant_text("T"); +  push_text("T");    else    if ( (THIS_STAT->s.st_mode & S_IXOTH) ) -  push_constant_text("x"); +  push_text("x");    else -  push_constant_text("-"); +  push_text("-");       f_add(10);    break;