-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tclSE-back-port: timerate and more #3
base: trunk
Are you sure you want to change the base?
Conversation
…out `-gmt 1`, because the return value would be -3600): % clock scan "01.01.1970" -locale current -format %x time value too large/small to represent
…" the execution limited by fixed time (in milliseconds) instead of repetition count (more precise results, to prevent very long execution time it is no more necessary to estimate repetition count)
… to 5000 now), because otherwise sporadically stutters on some platforms on very fast iterations (<= 1µs/#)
…ance counters actualized in calibration thread in UpdateTimeEachSecond; This entails that sometimes sporadically time-drifts resp. jump-esque time-shifts occurred, what for example produces very confusing results during time measurement. [unix] wrong cast fixed in TclpGetWideClicks: multiplication with 1000000 in long int may cause overflow
…00000; more precise threshold handling after NativeGetTime fix.
…verhead): - use pre-compiled byte code and TclNRExecuteByteCode inside measure cycle; - calibration possibility (through call of `timerate {}` to enter calibration cycle and obtain current overhead); # Conflicts: # win/test-performance.tcl
… better precision `timerate {} 10000` could be used) + increase minimal threshold;
…ate? ?-overhead double? command ?time?; limit default calibration cycle by precision of 0.01% (for exact precision an exact time could be given e. g. `timerate -calibrate {} 10000`);
… if object internal representation changed, example: `set code { regexp {\w} $code }; timerate $code` # Conflicts: # generic/tclCmdMZ.c
Have a small amend for this trunk-based branch in d6d3cb9, that was forgotten, because would be not necessary in tclSE at all (the objects could own more as one slot with internal representation there, so byte-code will be not released, if e. g. unicode representation needed, so exists as long as the object exists). Without this fix following code produces a segfault through removed byte-code representation in the meantime:
|
…(without estimated time of whole overhead)
This is a interim PR back-porting some features from my tclSE engine.
Currently used as merge-point to #2 to compare performance between original tcl-clock and new tcl-clock engines.
Contains:
timerate
, that allows to do the measurement of code executing more precise and in opposition to commandtime
is time-related (not count-related);Additionally pros of command "timerate"
timerate
can be calibrated to minimize influence of measurement overhead (and byte code execution overhead) -timerate -calibrate {}
.Following example diff shows influence of measurement and execution overheads (the times retrieved for execution of empty scope-block resp. of each
set i ...
is more precise after calibration), e. g. in reality the execution time ofset i ...
amounts to ca. 0.057 µs/#:timerate -calibrate {} 0
can be used;-direct
to disable "compilation" outside of measure cycle, and will be executed byTclEvalObjEx
insteadTclNRExecuteByteCode
);Normally it uses compiled version to measure (as it would be a part of compiled script or procedure body):
-overhead
an external calculated overhead can be specified for thetimerate
command to measure execution of the part of script. Following example shows possibility to ignore overhead of execution of_init
procedure resp. more precise the speed of partstring tolower ...
only: