Skip to content

Commit 02062bb

Browse files
authored
Merge pull request #10 from flightaware/merge-upstream
Merge upstream
2 parents 669d2f0 + 4dd26ab commit 02062bb

File tree

21 files changed

+3833
-1792
lines changed

21 files changed

+3833
-1792
lines changed

.github/workflows/ci-nix.yml

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
name: CI-nix
2+
3+
# Controls when the action will run. Triggers the workflow on push or pull request
4+
# events but only for the master branch
5+
on:
6+
push:
7+
paths-ignore:
8+
- 'doc/**'
9+
pull_request:
10+
paths-ignore:
11+
- 'doc/**'
12+
13+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
14+
jobs:
15+
build:
16+
runs-on: ${{ matrix.os }}
17+
18+
strategy:
19+
matrix:
20+
os: [ubuntu-latest]
21+
compiler: [gcc, clang]
22+
23+
fail-fast: false
24+
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@v4
28+
# with:
29+
# submodules: recursive
30+
- name: Install dependencies
31+
if: matrix.os != 'macos-latest'
32+
run: |
33+
sudo apt-get install tcl tcl-dev
34+
35+
# - name: Install dependencies MacOS
36+
# if: matrix.os == 'macos-latest'
37+
# run: |
38+
# sudo brew install tcl-devel
39+
40+
- name: Pre-requirements
41+
run: |
42+
test -f ../tclconfig/tcl.m4 && echo "use ../tclconfig" || {
43+
test -f tclconfig/tcl.m4 && echo "use ./tclconfig" || \
44+
echo 'checkout tclconfig module ...' && \
45+
git submodule update --init --recursive tclconfig && echo "tclconfig module is up-to-date" || {
46+
echo 'checkout modules failed, clone ...' && \
47+
git clone https://github.com/tcltk/tclconfig.git ../tclconfig
48+
}
49+
}
50+
- name: Software versions tcl/${{ matrix.compiler }}
51+
run: |
52+
echo "${{ matrix.COMPILER }}: $(${{ matrix.COMPILER }} --version)"
53+
echo "TCL: $(echo puts [info patchlevel] | tclsh)"
54+
55+
- name: Configure ${{ matrix.compiler }}
56+
env:
57+
CC: ${{ matrix.compiler }}
58+
run: |
59+
test -f configure && echo "configure already exists in $(pwd) ..." || autoreconf -f
60+
mkdir ./unix/build-${{ matrix.compiler }}; cd "$_"
61+
../../configure --with-tcl=/usr/lib/tcl8.6
62+
63+
- name: Build ${{ matrix.compiler }}
64+
working-directory: ./unix/build-${{ matrix.compiler }}
65+
env:
66+
CC: ${{ matrix.compiler }}
67+
run: |
68+
make -j4
69+
70+
- name: Test ${{ matrix.compiler }}
71+
working-directory: ./unix/build-${{ matrix.compiler }}
72+
run: |
73+
echo $TZ; timedatectl status
74+
# tclsh ../../tests/all.tcl
75+
make test
76+
77+
- name: Install ${{ matrix.compiler }}
78+
working-directory: ./unix/build-${{ matrix.compiler }}
79+
run: |
80+
sudo make install
81+
echo 'if {[catch {package require tclclockmod; clock format -now}]} {puts stderr "ERROR!"; exit 1} else {puts "OK."}' | tclsh
82+
83+
- name: Clean ${{ matrix.compiler }}
84+
working-directory: ./unix/build-${{ matrix.compiler }}
85+
run: |
86+
make clean
87+

.github/workflows/linux-ci.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,19 @@ jobs:
2525
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
2626
- uses: actions/checkout@v2
2727

28-
- name: Install dependencies
28+
- name: Install dependencies
2929
run: |
3030
sudo apt-get update -qq
3131
sudo apt-get install -y tcl8.6-dev
3232
33-
- name: configure
33+
- name: configure
3434
run: |
3535
autoconf
3636
autoreconf -iv
3737
cd unix
3838
../configure --with-tcl=/usr/lib/tcl8.6
3939
40-
- name: make
40+
- name: make
4141
run: |
4242
cd unix
4343
make
@@ -47,7 +47,8 @@ jobs:
4747
# current time and time-zone:
4848
echo $TZ; timedatectl status
4949
# load local library and execute local test cases:
50-
tclsh tests/all.tcl
50+
cd unix
51+
make test
5152
5253
- name: install
5354
run: |

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "tclconfig"]
2+
path = tclconfig
3+
url = https://github.com/tcltk/tclconfig.git

Makefile.in

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,14 @@ $(PKG_STUB_LIB_FILE): $(PKG_STUB_OBJECTS)
279279
${MAKE_STUB_LIB}
280280
$(RANLIB_STUB) $(PKG_STUB_LIB_FILE)
281281

282+
#========================================================================
283+
284+
gendate:
285+
bison --output-file=$(srcdir)/generic/tclDate.c \
286+
--name-prefix=TclDate \
287+
--no-lines \
288+
$(srcdir)/generic/tclGetDate.y
289+
282290
#========================================================================
283291
# We need to enumerate the list of .c to .o lines here.
284292
#

README.md

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
v.8.6.7-03 2018/12/03
88
99

10-
## TclClockMod: the fastest, most powerful Tcl clock engine written in C
10+
## TclClockMod: the [fastest, most powerful](#performance-) Tcl clock engine written in C
1111

1212
What is this ?
1313
==============
1414

15-
This is the source distribution of the Tcl clock extension: the faster
15+
This is the source distribution of the Tcl clock extension: the [faster](#performance-)
1616
Tcl-module for the replacement of the standard "clock" ensemble of tcl.
1717

1818
You need to have your Tcl core compiled also.
@@ -22,6 +22,8 @@ virtually anything you like with it, such as modifying it, redistributing
2222
it, and selling it either in whole or in part. See the "license.terms"
2323
file in the top-level distribution directory for complete information.
2424

25+
Now this clock-engine is a part of Tcl 8.7 / 9.0.
26+
2527
How to compile ?
2628
----------------
2729

@@ -52,6 +54,18 @@ Function | Performance increase | tclclockmod | tcl8.6-clock
5254

5355
The difference is much more larger, if the tests are running multi-threaded with parasitic load.
5456

57+
#### How the performance is measured:
58+
59+
Both tcl-core as well as tclclockmod has a file [tests-perf/clock.perf.tcl](./tests-perf/clock.perf.tcl) which can be used to compare the execution times of original clock and tclclockmod. It can be also simply performed from the tclsh, with and without loading of the module.<br/>
60+
Here is a diff illustrating that (which amounted to almost 95x speed-up):
61+
```diff
62+
% timerate -calibrate {}
63+
% clock scan "" -timezone :CET; clock scan "" -gmt 1; # warming up
64+
% timerate { clock scan "2009-06-30T18:30:00 CEST" -format "%Y-%m-%dT%H:%M:%S %z" -gmt 1 }
65+
- 62.0972 µs/# 16094 # 16103.8 #/sec 999.392 net-ms
66+
+ 0.654699 µs/# 1437085 # 1527419 #/sec 940.858 net-ms
67+
```
68+
5569
Tcl compatibility:
5670
=================
5771

@@ -63,11 +77,9 @@ The module is currently usable with latest Tcl 8.6th version (>= 8.6.6), but can
6377
be used also with previous versions since 8.6.0 (note that some packages like
6478
"msgcat" should be upgraded in this case).
6579

80+
Since [TIP 688](https://core.tcl-lang.org/tips/doc/trunk/tip/688.md) (commits [GH/tcl/e736133f9c72](https://github.com/tcltk/tcl/commit/e736133f9c72a69186f1d6845b5fb52de03c23ab) or [CORE/tcl/7137ea11e9e343f6](https://core.tcl-lang.org/tcl/info/7137ea11e9e343f6)) this is a part of Tcl 8.7 / 9.0 and therefore fully compatible to newest core-tcl now, excepting few things (like `clock configure` -> `tcl::unsupported::clock::configure`).
6681

67-
Differences from base clock
68-
===========================
69-
70-
clock unixtime
82+
Differences from base clock: `clock unixtime`
7183
--------------
7284

7385
Same as "clock scan" except:

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ dnl to configure the system for the local environment.
1717
# so you can encode the package version directly into the source files.
1818
#-----------------------------------------------------------------------
1919

20-
AC_INIT([tclclockmod], [8.6.709])
20+
AC_INIT([tclclockmod], [8.6.710])
2121

2222
#--------------------------------------------------------------------
2323
# Call TEA_INIT as the first TEA_ macro to set up initial vars.

0 commit comments

Comments
 (0)