Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Changes In Branch factor-constant-funcs Excluding Merge-Ins
This is equivalent to a diff from d3ac32a6e7 to 2ab997e479
2017-01-04
| ||
04:18 | Factor constant functions out of the inner loop since they are more expensive than the extra OP_Copy needed to move the result into place. (check-in: 80ad317f89 user: drh tags: trunk) | |
04:10 | Clean up the implementation of constant function factorization. (Closed-Leaf check-in: 2ab997e479 user: drh tags: factor-constant-funcs) | |
01:07 | Attempt to factor out constant functions from the interior of table scans, since functions can often be expensive to compute. (check-in: 62e9270a80 user: drh tags: factor-constant-funcs) | |
00:26 | Changes to the printf implementation for better performance. (Closed-Leaf check-in: acdb8f6f10 user: drh tags: printf-optimization) | |
2017-01-03
| ||
21:57 | Use compiler intrinsic functions for signed integer math when overflow detection is needed. (check-in: d3ac32a6e7 user: drh tags: trunk) | |
21:50 | Back out the use of __sync_fetch_and_sub() as it does not appear to work. (Closed-Leaf check-in: 4c2efd4239 user: drh tags: gnu-safe-math) | |
14:45 | Add the experimental affinity() SQL function when SQLITE_DEBUG is defined. (check-in: bed0eaa5f5 user: drh tags: trunk) | |
Changes to src/expr.c.
︙ | |||
3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 | 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 | + + + + + | const char *zId; /* The function name */ u32 constMask = 0; /* Mask of function arguments that are constant */ int i; /* Loop counter */ sqlite3 *db = pParse->db; /* The database connection */ u8 enc = ENC(db); /* The text encoding used by this database */ CollSeq *pColl = 0; /* A collating sequence */ if( ConstFactorOk(pParse) && sqlite3ExprIsConstantNotJoin(pExpr) ){ /* SQL function can be expensive. So try to move constant functions ** out of the inner loop, even if that means an extra OP_Copy. */ return sqlite3ExprCodeAtInit(pParse, pExpr, -1); } assert( !ExprHasProperty(pExpr, EP_xIsSelect) ); if( ExprHasProperty(pExpr, EP_TokenOnly) ){ pFarg = 0; }else{ pFarg = pExpr->x.pList; } nFarg = pFarg ? pFarg->nExpr : 0; |
︙ | |||
3988 3989 3990 3991 3992 3993 3994 3995 | 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 | + + + + + + - + - + - + + + + + + + + + + + - + | sqlite3ReleaseTempReg(pParse, regFree1); sqlite3ReleaseTempReg(pParse, regFree2); return inReg; } /* ** Factor out the code of the given expression to initialization time. ** ** If regDest>=0 then the result is always stored in that register and the ** result is not reusable. If regDest<0 then this routine is free to ** store the value whereever it wants. The register where the expression ** is stored is returned. When regDest<0, two identical expressions will ** code to the same register. */ |
︙ | |||
4028 4029 4030 4031 4032 4033 4034 | 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 | - - - - - - - - - - - - + | int sqlite3ExprCodeTemp(Parse *pParse, Expr *pExpr, int *pReg){ int r2; pExpr = sqlite3ExprSkipCollate(pExpr); if( ConstFactorOk(pParse) && pExpr->op!=TK_REGISTER && sqlite3ExprIsConstantNotJoin(pExpr) ){ |
︙ | |||
4094 4095 4096 4097 4098 4099 4100 | 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 | - + | ** Generate code that will evaluate expression pExpr and store the ** results in register target. The results are guaranteed to appear ** in register target. If the expression is constant, then this routine ** might choose to code the expression at initialization time. */ void sqlite3ExprCodeFactorable(Parse *pParse, Expr *pExpr, int target){ if( pParse->okConstFactor && sqlite3ExprIsConstant(pExpr) ){ |
︙ | |||
4166 4167 4168 4169 4170 4171 4172 | 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 | - + | if( flags & SQLITE_ECEL_OMITREF ){ i--; n--; }else{ sqlite3VdbeAddOp2(v, copyOp, j+srcReg-1, target+i); } }else if( (flags & SQLITE_ECEL_FACTOR)!=0 && sqlite3ExprIsConstant(pExpr) ){ |
︙ |
Changes to src/sqliteInt.h.
︙ | |||
3712 3713 3714 3715 3716 3717 3718 | 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 | - + | void sqlite3ExprCachePop(Parse*); void sqlite3ExprCacheRemove(Parse*, int, int); void sqlite3ExprCacheClear(Parse*); void sqlite3ExprCacheAffinityChange(Parse*, int, int); void sqlite3ExprCode(Parse*, Expr*, int); void sqlite3ExprCodeCopy(Parse*, Expr*, int); void sqlite3ExprCodeFactorable(Parse*, Expr*, int); |
︙ |