-
Notifications
You must be signed in to change notification settings - Fork 8
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
Intent to work on speedups to clock format
and clock scan
#4
Comments
Request for clarification: for |
Generally |
I've the Intention also, but I've already implemented both (scan and format) it in pure-C (also with bison, similar to
As a first I need to know, which code-base would preferred - 8.6 or 8.7? And about of performance (tcl86 compared with my tclSE-mod, what is self a good piece faster, so I don't know which amount goes thereby to Click here to expand% set d 2016-12-01 01:08:01
# 1.a. default tcl -- :
% time {clock scan $d -format "%Y-%m-%d %H:%M:%S"} 100000
72.76242 microseconds per iteration
% set c 1480550881
# 2.a. default tcl -- :
% time {clock format $c -format "%Y-%m-%d %H:%M:%S"} 100000
13.3468 microseconds per iteration % set d 2016-12-01 01:08:01
# 1.b. tclSE-mod -- :
% time {clock scan $d -format "%Y-%m-%d %H:%M:%S"} 100000
6.9054 microseconds per iteration
% set c 1480550881
# 2.b. tclSE-mod -- :
% time {clock format $c -format "%Y-%m-%d %H:%M:%S"} 100000
3.33677 microseconds per iteration Additionally I've enhancement with several new C commands, like Tcl_MakeDate (to fast make a clock wideInt from C time structures, e. g. for the database-libraries, etc.) But it also not 100% compatible, because I've fixed several bugs, for example see my fix in default tcl.core http://core.tcl.tk/tcl/tktview?name=3475995, that assigned to kennykb already since 4 years. Click here to expand# tcl (without my abovementioned fix) -- :
% clock format [clock scan "2008-02-30"]
Sat Mar 01 00:00:00 CET 2008
% clock format [clock scan "24:62:80"] -format {%T}
23:59:59
# tcl (with my fix) or tclSE-mod -- :
% clock format [clock scan "2008-02-30"]
unable to convert date-time string "2008-02-30": invalid day
while executing
"clock scan "2008-02-30""
% clock format [clock scan "24:62:80"] -format {%T}
unable to convert date-time string "24:62:80": invalid time
while executing
"clock scan "24:62:80""
# to call "clock scan" without validating (backwards compatible):
% clock format [clock scan "2008-02-30" -valid 0]
Sat Mar 01 00:00:00 CET 2008
% clock format [clock scan "24:62:80" -valid 0] -format {%T}
23:59:59 |
It would probably be most natural to get your changes first reviewed and accepted into trunk by the Tcl core team, and then as a followup make a backport to Tcl 8.6 based on what ultimately got accepted. If you haven't already, ensure that all of the Tcl unit tests concerning clock still pass. Also, we're not stopping you from achieving even more gains! :) |
I belong to tcl-core team already several years, and I know unfortunately good enough how "fast" some enhancements (but sometimes the bugs also) would be accepted there from the whole team :( We can wait years... I mean, I do the lot of work to port all of this to trunk, and then wait again 4 years for the team acceptance (and still convince they all, that this is good), to take only then the bounty? |
I want to point out that it's (relatively) easy to make This isn't intended to downplay the good work you've done @sebres. It's more an observation that For my part, I have a strategy which I believe should give a >= 2x speedup with 100% backwards compatibility. However, it's highly complex and I've had a few things move up in my list of priorities so I won't be able to get to it for a month or two - I encourage other interested parties to have a look in the meantime :) |
Well you should choose at last: it is "easy going" or "it's highly complex" ;)
Well, even the But I had also more as one branch optimizing clock (one ot two was without bison). I'll see which can be better ported. |
I only said it was easy if you break backwards compatibility. Since you preserved backwards compatibility, I can't imagine it being easy :)
Hmm I'm not convinced, the rules of
My bison knowledge is weak, but isn't that tricky to express? And the "you can have any number of spaces before a field" also seems to interact poorly here. Of course, I may be totally wrong. Anyway, I'll wait and see what you have. Even if you decide not to submit I hope you share your changes for others to take a look at. |
Such kind of match (no matter greedy or not) for 3 (or even 6) KNOWN actors is trivial in realization without any NFA, etc. So the default rule by greedy NFA: at least 2 max 4 digits for year 1-2 digits for month and day, if not "matched" step back, so repeat with fewer "greedy" count. Even without regexp it can be build more faster, because we can quick estimate which counts could be used (with preparing already by parsing of format, if detected that no separator between used). So the formula for counts is: if not "separators len" (0) : y + m + d <= 4 (standing together digits len), what allows to range counts for all actors to 2, 1, 1 before (resp. during) the match-search... |
I'm aware of this approach and it being easy in C, it was just meant to be a simple example of ambiguity that I wasn't clear how bison would handle. The complex cases for a C implementation come when you try to allow spaces prefixing fields. I can come up with increasingly difficult examples which are always possible to special case, but I may as well just wait until there's something I can see - I assume tclSE-mod isn't publicly visible right now? |
Currently not planned. But in the context of subject it is not of importance. I work on the clock porting, maybe I'll get something running the next week (not yet promised that all test cases pass then). |
Because it not belongs to the subject of this issue - here a short description why and how I wrote tclSE... |
Hi, I've heard my name mentioned - and I do see that 3475995 is assigned to me! Because of the title, I'd mentally bucketed that one as, "needs a TIP", and even "not sure this is a good idea." The reason for "needs a TIP" is that the change as called out is for the date and time validation, and that part is a user-visible API change. This isn't a problem, necessarily - and if you write up a TIP, I'll sponsor. The reason for "not sure this is a good idea" is that it's actually useful to be able to specify day 0 of a month (the last day of the preceding month) or week 0 of a year (the last week of the preceding year). I see a '-valid' parameter in the discussion here - is the implementation that you attached to 3475995 current? Because of the subject, and the early discussion, and limited attention (sorry!) I had missed that the change was also intended to address performance. I'd feel most comfortable separating the two concerns, since the performance part requires no public discussion. Now to some of the details, since there is a little bit of confusion above: The use of 'regexp' in the parser can be regarded as a red herring - except that it pretty closely describes the syntax that's accepted. The whole trick of using a generated regexp was simply a hack to squeeze as much performance as possible out of the code. In retrospect, it would have been better to start on a C implementation before resorting to that. It's made the code confusing, and served as an obstacle to an eventual C implementation. The regexps that are generated are of a very limited form: "accept a decimal integer of up to N digits", "accept one of a set of (possibly locale dependent) enumerated strings (or, possibly, a unique prefix of one of them)" - and little else. They could be handled with stylized C code. Having a little table generator to make transition tables for the enumerations would help greatly in parsing things like %Ey Ambiguities are always resolved greedily, so "a day of the year is always 1-3 digits" means that as long as digits are seen (up to the third one) they are accepted. I think the only case where any sort of backtracking might be required is the fairly bizarre one of having one enumeration directly follow another. A test case would be 'augusthursday' where 'augus' is a unique prefix of 'august' but consuming the 't' would fail to recognize the weekday. In the case of directly concatenated enumerated strings, ambiguities should resolve by choosing the longest match for the left-hand string that still yields a match for the rest of the pattern. A torture test case could be built using the Roman numeral locale that exists in the test suite: give a string like 'xiiiv' - which should break to xiii-v by that rule. These matches are simple enough (there's no Kleene closure at all) that I think any given -format could quite readily be reduced directly to a DFA, and the DFA could be cached as an internal representation to the format string. (Along with locale, of course, because that changes the interpretation of some of the format codes.) I should have a little bit of bandwidth in the coming few weeks to look at [clock] performance - and I'm now monitoring this forum. Feel free to get in touch. For what it's worth, given the already-complicated history, I'd consider it a conflict of interest to accept any bounty for this item. If participants consider any work I do, moving forward, as a significant contribution toward earning the bounty, whatever share is allocated to my work should go to the Tcl Community Association. |
I'm almost ready with back-porting from my tclSE and rewriting to current trunk (with small bug fixes).
Bellow you'll find the first results of performance measurement saved as diff. The test-script for the measurement you'll find sebres/tcl@trunk...sebres:sb/trunk-clock-perf-test#diff-bc64daab7239ff6091b52c773bebd038 . Performance measurement test results: Click here to expand % # Scan : date
% clock scan "25.11.2015" -format "%d.%m.%Y" -base 0 -gmt 1
Wed Nov 25 01:00:00 CET 2015
-38.2629 µs/#, 13068 #, 26135.0 #/sec
+0.782300 µs/#, 639141 #, 1278282 #/sec
% clock scan "1111" -format "%d%m%y" -base 0 -gmt 1
Thu Jan 11 01:00:00 CET 2001
-31.4878 µs/#, 15880 #, 31758.3 #/sec
+0.794990 µs/#, 628939 #, 1257878 #/sec
% # FreeScan : relative date
% clock scan "5 years 18 months 385 days" -base 0 -gmt 1
Thu Jul 21 02:00:00 CEST 1977
-42.4871 µs/#, 11769 #, 23536.5 #/sec
+1.998985 µs/#, 250127 #, 500254 #/sec
% # FreeScan : relative date with relative weekday
% clock scan "5 years 18 months 385 days Fri" -base 0 -gmt 1
Fri Jul 22 02:00:00 CEST 1977
-47.2043 µs/#, 10593 #, 21184.5 #/sec
+2.330546 µs/#, 214542 #, 429084 #/sec
% # FreeScan : relative date with ordinal month
% clock scan "5 years 18 months 385 days next 1 January" -base 0 -gmt 1
-Fri Jul 21 02:00:00 CEST 1978
-71.3663 µs/#, 7007 #, 14012.2 #/sec
+Sat Jan 21 01:00:00 CET 1978
+2.579274 µs/#, 193853 #, 387706 #/sec
% # FreeScan : relative date with ordinal month and relative weekday
% clock scan "5 years 18 months 385 days next January Fri" -base 0 -gmt 1
-Sat Jul 22 02:00:00 CEST 1978
-76.3095 µs/#, 6553 #, 13104.5 #/sec
+Fri Jan 27 01:00:00 CET 1978
+2.841803 µs/#, 175945 #, 351889 #/sec
% # FreeScan : ordinal month
% clock scan "next January" -base 0 -gmt 1
Fri Jan 01 01:00:00 CET 1971
-42.5941 µs/#, 11739 #, 23477.4 #/sec
+1.360866 µs/#, 367413 #, 734826 #/sec
% # FreeScan : relative week
% clock scan "next Fri" -base 0 -gmt 1
Fri Jan 09 01:00:00 CET 1970
-17.9997 µs/#, 27779 #, 55556.3 #/sec
+1.471246 µs/#, 339848 #, 679696 #/sec
% # FreeScan : relative weekday and week offset
% clock scan "next January + 2 week" -base 0 -gmt 1
Fri Jan 15 01:00:00 CET 1971
-69.9115 µs/#, 7152 #, 14303.8 #/sec
+1.816735 µs/#, 275219 #, 550438 #/sec
% # FreeScan : time only with base
% clock scan "19:18:30" -base 148863600 -gmt 1
Thu Sep 19 20:18:30 CET 1974
-13.0945 µs/#, 38185 #, 76368.2 #/sec
+1.091822 µs/#, 457950 #, 915900 #/sec
% # FreeScan : time only without base, gmt
% clock scan "19:18:30" -gmt 1
Sat Dec 10 20:18:30 CET 2016
-12.9911 µs/#, 38488 #, 76975.5 #/sec
+1.120993 µs/#, 446033 #, 892066 #/sec
% # FreeScan : time only without base, system
% clock scan "19:18:30"
Sat Dec 10 19:18:30 CET 2016
-12.4922 µs/#, 40025 #, 80049.8 #/sec
+1.439487 µs/#, 347346 #, 694692 #/sec
% # FreeScan : date, system time zone
% clock scan "05/08/2016 20:18:30"
Sun May 08 20:18:30 CEST 2016
-13.3555 µs/#, 37438 #, 74875.4 #/sec
+1.642088 µs/#, 304491 #, 608980 #/sec
% # FreeScan : date, supplied time zone
% clock scan "05/08/2016 20:18:30" -timezone :CET
Sun May 08 20:18:30 CEST 2016
-14.0496 µs/#, 35589 #, 71176.4 #/sec
+1.596128 µs/#, 313258 #, 626516 #/sec
% # FreeScan : date, supplied gmt (equivalent -timezone :GMT)
% clock scan "05/08/2016 20:18:30" -gmt 1
Sun May 08 22:18:30 CEST 2016
-13.8868 µs/#, 36006 #, 72010.8 #/sec
+1.292126 µs/#, 386960 #, 773918 #/sec
% # FreeScan : date, supplied time zone gmt
% clock scan "05/08/2016 20:18:30" -timezone :GMT
Sun May 08 22:18:30 CEST 2016
-13.9869 µs/#, 35748 #, 71495.7 #/sec
+1.285432 µs/#, 388975 #, 777948 #/sec
% # FreeScan : time only, numeric zone in string, base time gmt (exchange zones between gmt / -0500)
% clock scan "20:18:30 -0500" -base 148863600 -gmt 1
Fri Sep 20 02:18:30 CET 1974
-17.7084 µs/#, 28236 #, 56470.3 #/sec
+2.634612 µs/#, 189782 #, 379562 #/sec
% # FreeScan : time only, zone in string (exchange zones between system / gmt)
% clock scan "19:18:30 GMT" -base 148863600
Fri Sep 20 20:18:30 CET 1974
-17.8210 µs/#, 28058 #, 56113.5 #/sec
+3.049543 µs/#, 163959 #, 327918 #/sec
% # FreeScan : fast switch of zones in cycle - GMT, MST, CET (system) and EST
% clock scan "19:18:30 MST" -base 148863600 -gmt 1; clock scan "19:18:30 EST" -base 148863600;
Sat Sep 21 01:18:30 CET 1974
-35.7111 µs/#, 14002 #, 28002.5 #/sec
+9.217380 µs/#, 54246 #, 108490 #/sec
% # Bad zone
% catch {clock scan "1 day" -timezone BAD_ZONE -locale en}
1
-9.413631 µs/#, 53115 #, 106228 #/sec
+7.017994 µs/#, 71246 #, 142490 #/sec
% **STOP** |
Short interim status: almost ready, but... But by running of the final tests, I've unfortunately found large deviations in comparision to the tclSE. The msgcat module was to blame (in my version it was totally rewritten using my OO-extension, what would be ATM not portable to the current tcl-core). The problem is - basically I've sped up the clock-engine up to 0.5µs, but by first access of mc in-between in some cases (l10n, entering another locale, etc.) it degraded up to 4.0µs... I'm working on proper caching of msgcat now (cacheable somewhere in internal representation). Why it should be, you'll see in the example below: % info patchlevel
- 8.7a0
+ 9.0-SE.18
% ::tcl::clock::EnterLocale de_DE
de_de
% namespace inscope ::tcl::clock { mc MONTHS_FULL }; # short warm up
Januar Februar März April Mai Juni Juli August September Oktober November Dezember {}
% namespace inscope ::tcl::clock { timerate {mc MONTHS_FULL} 500 }
- 3.127795 µs/#, 159857 #, 319714 #/sec
+ 0.106506 µs/#, 4694583 #, 9389166 #/sec |
Here you go - sebres/tcl#2 I'm working currently on source code clean-ups: like in-line documentation and minor reviews. Current performance increase:
If someone needs compiled version to test it, please notify me. |
I've made a (threaded) build of newest binaries for Windows. If someone needs it, please see sebres/tcl#2 (comment) |
A couple of incompatibilities as compared between your windows binaries of tcl running under wine and a freshly built tcl off the
Your binaries:
Unless we have very different understandings of the Kleene closure/Kleene star/
The date parsing regexp generation inserts |
@aidanhs Thx for the testing!
Answered in sebres/tcl#2 (comment) |
This is fine (I do agree that the current matching has an excessive number of corner cases and would significantly benefit from being simplified) but I do think it's worth being aware of these (and others I might construct) simply because I know from experience that people will take whatever flexibility you give them and use/abuse it. I tend to be quite picky about 100% backwards compatibility as a result, but if the (minor) breakage is deemed to be worth the gains by the tcl team, then its an informed decision and that's fine. |
I'm agree and I can even follow your arguments (and grateful for your demur), but as already said, many of this cases just make no sense in the practice, so I mean that the people will never take the "flexibility" in this direction, because it is simply not a date-time at all (although it would be parseable formerly). Each extension of some existing thing may theoretically break the hundred per cent backwards-compatibility, but IMHO that's why it is not the reason to forgo the enhancements. So again, what I mean - I'm not against your objection, it was just to clarify the facts... |
Hello all, I would really appreciate if leastwise somebody will give a short feedback about the topic (clock speed-up). If there is no intention at all as regards this PR, I'd like to know it. Or all the people are still in the Christmas holidays? |
@sebres my assumption is that flightaware are pretty pleased that you have an implementation already and will now wait for you to go through the process of submitting the patch (have you done so? Might be worth splitting up your PR as the timerate stuff could be separate) and getting it into Tcl (per the rules in the readme). On the downside, this may well be painful from what you've said. On the upside, it sounds like you'll hit the $20k reward if you get through it. |
It is already so, see sebres/tcl#3 The clock speed-up is based on this branch. |
Rebased to fossil-repository + "TIP" ATM as ticket - http://core.tcl.tk/tcl/info/ddc948cff9781daa |
Greetings I attach an example C file implementing mktime() and gmtime() using that algorithm, embedded in a test harness that compares their result with that of the system mktime() and gmtime() if you define TEST |
@martinwguy Thank you. As regards as "for month=1 to 12" - I don't have it at all. Conversion to/from yearday (but also julianday resp. gregorian) solved pure algorithmic (arithmetically, see implicit conversions like |
@sebres You're welcome! :) I see in generic/tclClock.c's GetMonthDay() |
Ah now I understood what you meant. Just compare January and December, so full cycle here for Dec (12): % timerate -calibrate {} 1000
0.048508207685756845 µs/#-overhead 0.048508 µs/# 20615068 # 20615068 #/sec
% proc test {script} {append _ [if 1 $script] ": " [timerate $script]}
- % test {clock format 1483228800 -g 1 -f "%Y-%m-%d"}
+ % test {clock format 1483142400 -g 1 -f "%Y-%m-%d"}
- 2017-01-01: 0.281122 µs/# 3033703 # 3557173 #/sec 852.841 nett-ms
+ 2016-12-31: 0.281017 µs/# 3034675 # 3558508 #/sec 852.794 nett-ms You see - almost resp. exact the same execution times (and differences there are measurement errors). But I'll put it to my todo-list. Thx, again. |
So, current status of this is... waiting on a TIP? |
Thanks for the reminder (just too many tasks)! So I'll try to make a back-porting to 8.6 the next week (should be relative easy, because I almost alone dare to change there something;), and then to start CFV survey for ca. two weeks for both 8.6 and trunk branches (I hope one or the other is accepted, or I'm listening some agruments against, that I can then "fix"). |
BTW, this RFE (instead of TIP) can be used ATM for discussion when required. |
Copying tcl-core on this as well:
On 04/07/2017 02:25 PM, Serg G. Brester wrote:
Thanks for the reminder (just too many tasks)!
Nop, I think, we don't need a TIP as long as it is not realy an
enhancement (besides the little incompatibilities, which belong rather
to bug fixing resp. some artifical cases).
I hoped for some feadback from TCT (or/and from flightaware;), but
excepting pair colleagues I got nothing up to now from there.
Inbetween I had found a small "bug" there, that is already fixed (must
be rebased in fossil).
And I've tested it on some systems of me using tcl (where it looks
very good all the time).
So I'll try to make a back-porting to 8.6 the next week (should be
relative easy, because I almost alone dare to change there
something;), and then to start CFV survey for ca. two weeks for both
8.6 and trunk branches (I hope one or the other is accepted, or I'm
listening some agruments against, that I can then "fix").
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#4 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AANPUYJBdJqeY1VEu2mWggcT8p49fvzrks5rtn-PgaJpZM4K2cWi>.
I don't recall ever getting answers to several questions that I asked.
It could be that there were technological issues that kept us from
making contact.
(1) Are you willing to maintain the code moving forward? (If not, I need
more time to review. Things have been very busy for the last few months,
and I've not had time to source-dive in your separate branches.
(2) What, if any, existing test cases needed to be modified to support
your performance improvements, and why? (If they were there simply for
'bugward compatibility', that's an acceptable answer. I recognize that
some of the Tcl test cases have historically not been tests, but rather
experiments.
(3) Does the code continue to support multilocalization (having places
in the same process or in the same interpreter where different time
zones or locales are in use)?
(4) Is the claimed speedup achievable without also addressing the msgcat
subsystem, or were speedups there also in scope?
(5) Is the new code still self-contained, or does it rely on third-party
libraries that are subject to licensing that must be reviewed?
(6) Has the new code been run with the test suite under a profiler such
as gcov (or nagelfar for any portions that are still written in Tcl)?
What fraction of the code remains uncovered?
If all of these questions have acceptable answers, then I don't think
there's any need for a vote. I speak both as a TCTer and as the
maintainer of record for [clock]. We just need to get you commit access
for (1) - I can do that if you agree - and then get everything merged
in. I presume documentation changes should be minimal, just the new %Es
plus documenting any other new functionality needed. If it's a drop-in
replacement that passes the test suite, I don't have a problem with it
appearing in a point release.
If you haven't merged recently, you'll also find that I added ensemble
compilation for [clock] (and for [encoding] which was also missing it).
In addition, I added bytecoding for [clock
seconds/millis/micros/clicks], which should be an additional little
boost. I just dropped those into core-8-6-branch as well as trunk, and
nobody objected.
Thanks for taking this on! I'd been meaning to do the rewrite in C
(which for me would have been relatively straightforward but
time-consuming) for years, but always had other fish to fry. Doing the
initial implementation in C would have got me horribly bogged down, so I
still think that proving the concept in Tcl first was a good idea, but
somehow, the Tcl implementation always remained Almost Good Enough and
the performance hacking never got enough attention.
…--
73 de ke9tv/2, Kevin
|
No time currently to answer detailed, so firstly I'll try to summarize
as short answer...
1) Yes
2) All the test-cases modifications, that I done, going to bug-fixing
(IMHO) and to cover new functionality (like "-now" by "clock format -now
-format ...").
3) Yes (otherwise several test-cases will fail)
4) There was also in scope (no chances to get reasonable
performance-increase without optimization of msgcat-clock binding).
5) Yes. It is only my own code (licensed as TCL self).
6) Yes, almost nothing uncovered (only pair code blocks serves debugging
purposes).
As regards of ensemble compilation for [clock], I've seen it (you've
made it for commands like seconds, microseconds, etc.), but I've another
branch, where ALL ensembles will be compiled (using rewritten much
faster version of INST_INVOKE_REPLACE), see
#21 (comment).
I'll try to rebase it into fossil.
Regards,
sebres
08.04.2017 04:46, Kevin Kenny wrote:
Copying tcl-core on this as well:
On 04/07/2017 02:25 PM, Serg G. Brester wrote:
> Thanks for the reminder (just too many tasks)! Nop, I think, we don't need a TIP as long as it is not realy an enhancement (besides the little incompatibilities, which belong rather to bug fixing resp. some artifical cases). I hoped for some feadback from TCT (or/and from flightaware;), but excepting pair colleagues I got nothing up to now from there. Inbetween I had found a small "bug" there, that is already fixed (must be rebased in fossil). And I've tested it on some systems of me using tcl (where it looks very good all the time). So I'll try to make a back-porting to 8.6 the next week (should be relative easy, because I almost alone dare to change there something;), and then to start CFV survey for ca. two weeks for both 8.6 and trunk branches (I hope one or the other is accepted, or I'm listening some agruments against, that I can then "fix"). -- You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub
<#4 (comment) [1]>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AANPUYJBdJqeY1VEu2mWggcT8p49fvzrks5rtn-PgaJpZM4K2cWi [2]>.
I don't recall ever getting answers to several questions that I asked.
It could be that there were technological issues that kept us from
making contact.
(1) Are you willing to maintain the code moving forward? (If not, I need
more time to review. Things have been very busy for the last few months,
and I've not had time to source-dive in your separate branches.
(2) What, if any, existing test cases needed to be modified to support
your performance improvements, and why? (If they were there simply for
'bugward compatibility', that's an acceptable answer. I recognize that
some of the Tcl test cases have historically not been tests, but rather
experiments.
(3) Does the code continue to support multilocalization (having places
in the same process or in the same interpreter where different time
zones or locales are in use)?
(4) Is the claimed speedup achievable without also addressing the msgcat
subsystem, or were speedups there also in scope?
(5) Is the new code still self-contained, or does it rely on third-party
libraries that are subject to licensing that must be reviewed?
(6) Has the new code been run with the test suite under a profiler such
as gcov (or nagelfar for any portions that are still written in Tcl)?
What fraction of the code remains uncovered?
If all of these questions have acceptable answers, then I don't think
there's any need for a vote. I speak both as a TCTer and as the
maintainer of record for [clock]. We just need to get you commit access
for (1) - I can do that if you agree - and then get everything merged
in. I presume documentation changes should be minimal, just the new %Es
plus documenting any other new functionality needed. If it's a drop-in
replacement that passes the test suite, I don't have a problem with it
appearing in a point release.
If you haven't merged recently, you'll also find that I added ensemble
compilation for [clock] (and for [encoding] which was also missing it).
In addition, I added bytecoding for [clock
seconds/millis/micros/clicks], which should be an additional little
boost. I just dropped those into core-8-6-branch as well as trunk, and
nobody objected.
Thanks for taking this on! I'd been meaning to do the rewrite in C
(which for me would have been relatively straightforward but
time-consuming) for years, but always had other fish to fry. Doing the
initial implementation in C would have got me horribly bogged down, so I
still think that proving the concept in Tcl first was a good idea, but
somehow, the Tcl implementation always remained Almost Good Enough and
the performance hacking never got enough attention.
|
On Mon, Apr 10, 2017 at 6:58 AM, Dipl. Ing. Sergey G. Brester < ***@***.***> wrote:
No time currently to answer detailed, so firstly I'll try to summarize as
short answer...
1) Yes
2) All the test-cases modifications, that I done, going to bug-fixing
(IMHO) and to cover new functionality (like "-now" by "clock format -now
-format ...").
3) Yes (otherwise several test-cases will fail)
4) There was also in scope (no chances to get reasonable
performance-increase without optimization of msgcat-clock binding).
5) Yes. It is only my own code (licensed as TCL self).
6) Yes, almost nothing uncovered (only pair code blocks serves debugging
purposes).
Those are almost the right answers for "goes in without a TIP." The only
thorny one is the "new functionality" part. Do you have a description of
the new functionality in one place, that we could use as the skeleton of a
TIP?
I'm willing to bend the rules if the new functionality cannot readily be
separated from the other improvements. If it can, the logical thing to do
would be to get the performance upgrades into 8.6.x (no TIP needed) and the
new stuff onto the 8.7 development line (TIP likely non-controversial,
provided that it makes sense).
|
Do you have a description of the new functionality in one place, that we could use as the skeleton of a TIP?
Yes, this [RFE](http://core.tcl.tk/tcl/info/ddc948cff9781daa) describes
that. There are only:
- freescan: relative date with ordinal month and relative weekday (early
it was rather undefined behavior).
- I've introduced an optional tokens, for example zone (`%z` resp. `%Z`)
is optional now (can be switched off);
- additionally scan/format token `%Es` introduced to parse or format
local seconds (in opposition to `%s` for posix seconds);
- value `-now` will be accepted as clock value for format or add
functions, e. g.:
```
clock format -now -f %u;
```
I don't think that this minimal "enhancements" would block the release
it in 8.6.
the new functionality cannot readily be separated from the other
Some things are just per design, thus not really separable (e. g.
decision rules are logic-based now, no more priority-based, see ticket
[e7a722cd35](http://core.tcl.tk/tcl/tktview?name=e7a722cd35) ).
But I thinks, this can be classified rather as "bugs", not as
"enhancements".
Regards,
sebres.
Am 10.04.2017 20:20, schrieb Kevin Kenny:
… On Mon, Apr 10, 2017 at 6:58 AM, Dipl. Ing. Sergey G. Brester ***@***.***> wrote:
> No time currently to answer detailed, so firstly I'll try to summarize as short answer...
>
> 1) Yes
>
> 2) All the test-cases modifications, that I done, going to bug-fixing (IMHO) and to cover new functionality (like "-now" by "clock format -now -format ...").
>
> 3) Yes (otherwise several test-cases will fail)
>
> 4) There was also in scope (no chances to get reasonable performance-increase without optimization of msgcat-clock binding).
>
> 5) Yes. It is only my own code (licensed as TCL self).
>
> 6) Yes, almost nothing uncovered (only pair code blocks serves debugging purposes).
Those are almost the right answers for "goes in without a TIP." The only thorny one is the "new functionality" part. Do you have a description of the new functionality in one place, that we could use as the skeleton of a TIP?
I'm willing to bend the rules if the new functionality cannot readily be separated from the other improvements. If it can, the logical thing to do would be to get the performance upgrades into 8.6.x (no TIP needed) and the new stuff onto the 8.7 development line (TIP likely non-controversial, provided that it makes sense).
|
Just to be sure, my message was arrived:
|
So I'm actually done with sebres-8-6-clock-speedup. @kennykb What would you say: CFV or just notify all with "ready state". @resuna, @flightaware Would you need something (currently or soon) from me (like help, info, suggestions etc.) as regards the clock-speedup? Just to better plan my activities, because I've still a lot several open issues and PR's with various priorities (in core.tcl, some several things mentioned in #21, etc.). |
I merged it just now in fossil-repository of the tcl-core (into 8.6 and trunk). |
I would really like to know how I can go further. Another good question - Is flightaware still interested at all on this bounty program? Just 'cause no reaction until now... |
We're still definitely interested. Isn't it really close to getting into the core? They just are concentrating on 8.6.7 right now. |
Porting as tcl-module: sebres/tclclockmod |
@martinwguy I do never forget my "todo's" :) |
Should be closed now? |
I've rebased (back-ported) my current state of tclclockmod back to the tcl.core in branch "sebres-8-6-clock-speedup-cr2". In comparision to sebres-8-6-clock-speedup-cr1 branch (was at some point removed from core-8-6-branch):
I'll continue to maintain both (the module as well as tcl-core branch) as long as not accepted from TCT. |
No description provided.
The text was updated successfully, but these errors were encountered: