Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Changes In Branch sebres-8-6-clock-speedup-cr2 Through [a011e0dddc] Excluding Merge-Ins
This is equivalent to a diff from 0c840ffac5 to a011e0dddc
|
2018-05-29
| ||
| 17:03 | Added max permitted threshold (buffer size > result size) in percent, to directly return the buffer ... check-in: 2f98e44d4b user: sebres tags: sebres-8-6-clock-speedup-cr2 | |
| 17:02 | further optimization: better cache for GMT-timezone + minimize (re)allocation of buffers check-in: a011e0dddc user: sebres tags: sebres-8-6-clock-speedup-cr2 | |
| 17:01 | code review: micro optimizations check-in: f5e76e52be user: sebres tags: sebres-8-6-clock-speedup-cr2 | |
| 16:40 | tests-perf\test-performance.tcl: ported from sebres-8-6-event-perf-branch (common test performance f... check-in: a08a2e912f user: sebres tags: sebres-8-6-clock-speedup-cr2 | |
|
2017-10-20
| ||
| 12:36 | Merge core-8-6-branch (execpt file win/makefile.vc) Closed-Leaf check-in: 0c840ffac5 user: dgp tags: sebres-8-6-clock-speedup-cr1 | |
|
2017-10-19
| ||
| 09:28 | Oops; put the code in the wrong place. Mixins have priority when deciding method visibility. check-in: 4140046408 user: dkf tags: core-8-6-branch | |
|
2017-08-08
| ||
| 15:19 | fixed overflow of year (resp. julianday), closes ticket [16e4fc3096]; test cases adjusted. check-in: 3efed18ef8 user: sebres tags: sebres-8-6-clock-speedup-cr1 | |
Changes to generic/tclClock.c.
| ︙ | |||
234 235 236 237 238 239 240 241 242 243 244 245 246 247 | 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 | + |
data->yearOfCenturySwitch = ClockDefaultCenturySwitch;
data->systemTimeZone = NULL;
data->systemSetupTZData = NULL;
data->gmtSetupTimeZoneUnnorm = NULL;
data->gmtSetupTimeZone = NULL;
data->gmtSetupTZData = NULL;
data->gmtTZName = NULL;
data->lastSetupTimeZoneUnnorm = NULL;
data->lastSetupTimeZone = NULL;
data->lastSetupTZData = NULL;
data->prevSetupTimeZoneUnnorm = NULL;
data->prevSetupTimeZone = NULL;
data->prevSetupTZData = NULL;
|
| ︙ | |||
306 307 308 309 310 311 312 313 314 315 316 317 318 319 | 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 | + |
data->lastTZEpoch = 0;
Tcl_UnsetObjRef(data->systemTimeZone);
Tcl_UnsetObjRef(data->systemSetupTZData);
Tcl_UnsetObjRef(data->gmtSetupTimeZoneUnnorm);
Tcl_UnsetObjRef(data->gmtSetupTimeZone);
Tcl_UnsetObjRef(data->gmtSetupTZData);
Tcl_UnsetObjRef(data->gmtTZName);
Tcl_UnsetObjRef(data->lastSetupTimeZoneUnnorm);
Tcl_UnsetObjRef(data->lastSetupTimeZone);
Tcl_UnsetObjRef(data->lastSetupTZData);
Tcl_UnsetObjRef(data->prevSetupTimeZoneUnnorm);
Tcl_UnsetObjRef(data->prevSetupTimeZone);
Tcl_UnsetObjRef(data->prevSetupTZData);
|
| ︙ | |||
1227 1228 1229 1230 1231 1232 1233 | 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 | + - - + + + + + - + - - - + + + - |
Tcl_Obj *timezoneObj)
{
ClockClientData *dataPtr = clientData;
int loaded;
Tcl_Obj *callargs[2];
/* if cached (if already setup this one) */
if ( timezoneObj == dataPtr->literals[LIT_GMT]
|
| ︙ | |||
1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 | 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 | + + + + + + + + + |
* Convert to Julian or Gregorian calendar.
*/
GetGregorianEraYearDay(fields, changeover);
GetMonthDay(fields);
GetYearWeekDay(fields, changeover);
/*
* Seconds of the day.
*/
fields->secondOfDay = (int)(fields->localSeconds % SECONDS_PER_DAY);
if (fields->secondOfDay < 0) {
fields->secondOfDay += SECONDS_PER_DAY;
}
return TCL_OK;
}
/*
*----------------------------------------------------------------------
*
* ClockGetjuliandayfromerayearmonthdayObjCmd --
|
| ︙ | |||
2105 2106 2107 2108 2109 2110 2111 | 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 | - + - - + + + - - - - - + + + + + + + |
{
ClockClientData *dataPtr = clientData;
Tcl_Obj *tzdata; /* Time zone data */
int rowc; /* Number of rows in tzdata */
Tcl_Obj **rowv; /* Pointers to the rows */
/* fast phase-out for shared GMT-object (don't need to convert UTC 2 UTC) */
|
| ︙ | |||
2606 2607 2608 2609 2610 2611 2612 | 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 | - + + + + + + + + + + + + + - - - + + + + + + + |
static void
GetMonthDay(
TclDateFields *fields) /* Date to convert */
{
int day = fields->dayOfYear;
int month;
|
| ︙ | |||
3256 3257 3258 3259 3260 3261 3262 | 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 | - + - |
Tcl_SetObjResult(interp, Tcl_NewStringObj("cannot use -gmt and -timezone in same call", -1));
Tcl_SetErrorCode(interp, "CLOCK", "gmtWithTimezone", NULL);
return TCL_ERROR;
}
if (gmtFlag) {
opts->timezoneObj = dataPtr->literals[LIT_GMT];
}
|
| ︙ | |||
4230 4231 4232 4233 4234 4235 4236 | 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 | - + |
{
static char* tzWas = INT2PTR(-1); /* Previous value of TZ, protected by
* clockMutex. */
static long tzLastRefresh = 0; /* Used for latency before next refresh */
static size_t tzWasEpoch = 0; /* Epoch, signals that TZ changed */
static size_t tzEnvEpoch = 0; /* Last env epoch, for faster signaling,
that TZ changed via TCL */
|
| ︙ |
Changes to generic/tclClockFmt.c.
| ︙ | |||
2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 | 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 | + + + - - - - + + + + + + + + + + + + + + |
-1));
Tcl_SetErrorCode(opts->interp, "CLOCK", "badInputString", NULL);
done:
return ret;
}
#define FrmResultIsAllocated(dateFmt) \
(dateFmt->resEnd - dateFmt->resMem > MIN_FMT_RESULT_BLOCK_ALLOC)
static inline int
FrmResultAllocate(
register DateFormat *dateFmt,
int len)
{
int needed = dateFmt->output + len - dateFmt->resEnd;
if (needed >= 0) { /* >= 0 - regards NTS zero */
int newsize = dateFmt->resEnd - dateFmt->resMem
|
| ︙ | |||
2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 | 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 | + - - - - - - + + + - - - - + + + + + + - |
ClockFormat(
register DateFormat *dateFmt, /* Date fields used for parsing & converting */
ClockFmtScnCmdArgs *opts) /* Command options */
{
ClockFmtScnStorage *fss;
ClockFormatToken *tok;
ClockFormatTokenMap *map;
char resMem[MIN_FMT_RESULT_BLOCK_ALLOC];
/* get localized format */
if (ClockLocalizeFormat(opts) == NULL) {
return TCL_ERROR;
}
if ( !(fss = ClockGetOrParseFmtFormat(opts->interp, opts->formatObj))
|| !(tok = fss->fmtTok)
) {
return TCL_ERROR;
}
|
| ︙ | |||
3078 3079 3080 3081 3082 3083 3084 | 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 | + - + + + + + - - - - + + + + + + + + + + + + + + + + |
}
}
goto done;
error:
if (dateFmt->resMem != resMem) {
|
| ︙ |
Changes to generic/tclDate.h.
| ︙ | |||
289 290 291 292 293 294 295 296 297 298 299 300 301 302 | 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 | + |
int currentYearCentury;
int yearOfCenturySwitch;
Tcl_Obj *systemTimeZone;
Tcl_Obj *systemSetupTZData;
Tcl_Obj *gmtSetupTimeZoneUnnorm;
Tcl_Obj *gmtSetupTimeZone;
Tcl_Obj *gmtSetupTZData;
Tcl_Obj *gmtTZName;
Tcl_Obj *lastSetupTimeZoneUnnorm;
Tcl_Obj *lastSetupTimeZone;
Tcl_Obj *lastSetupTZData;
Tcl_Obj *prevSetupTimeZoneUnnorm;
Tcl_Obj *prevSetupTimeZone;
Tcl_Obj *prevSetupTZData;
|
| ︙ | |||
379 380 381 382 383 384 385 | 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 | - + - + - + + |
unsigned short int minSize;
unsigned short int maxSize;
unsigned short int offs;
ClockScanTokenProc *parser;
const void *data;
} ClockScanTokenMap;
|
| ︙ | |||
428 429 430 431 432 433 434 | 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 | + - + - + - + + - + |
unsigned short int flags;
unsigned short int divider;
unsigned short int divmod;
unsigned short int offs;
ClockFormatTokenProc *fmtproc;
void *data;
} ClockFormatTokenMap;
|
| ︙ |
Changes to generic/tclStrIdxTree.c.
| ︙ | |||
82 83 84 85 86 87 88 | 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 | - + |
TclStrIdx **foundItem, /* Return value of found item */
TclStrIdxTree *tree, /* Index tree will be browsed */
const char *start, /* UTF string to find in tree */
const char *end) /* End of string */
{
TclStrIdxTree *parent = tree, *prevParent = tree;
TclStrIdx *item = tree->firstPtr, *prevItem = NULL;
|
| ︙ | |||
271 272 273 274 275 276 277 | 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 | - + + |
/* ignore element if fulfilled or ambigous */
if (f == e) {
continue;
}
/* if shortest key was found with the same value,
* just replace its current key with longest key */
if ( foundItem->value == val
|
| ︙ |
Changes to tests-perf/clock.perf.tcl.
| ︙ | |||
12 13 14 15 16 17 18 | 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | - - - + + + + - - - - + - - - + + + - + - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | # Copyright (c) 2014 Serg G. Brester (aka sebres) # # See the file "license.terms" for information on usage and redistribution # of this file. # |
| ︙ | |||
478 479 480 481 482 483 484 | 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 | + - + + + + + + + + + |
test-add $reptime
test-convert [expr {$reptime / 2}]; #fast enough
test-other $reptime
puts \n**OK**
}
}; # end of ::tclTestPerf-TclClock
|
Added tests-perf/test-performance.tcl.