Skip to content

Commit

Permalink
Merge pull request #10 from flightaware/merge-upstream
Browse files Browse the repository at this point in the history
Merge upstream
  • Loading branch information
bovine authored Jan 10, 2025
2 parents 669d2f0 + 4dd26ab commit 02062bb
Show file tree
Hide file tree
Showing 21 changed files with 3,833 additions and 1,792 deletions.
87 changes: 87 additions & 0 deletions .github/workflows/ci-nix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: CI-nix

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
paths-ignore:
- 'doc/**'
pull_request:
paths-ignore:
- 'doc/**'

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build:
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest]
compiler: [gcc, clang]

fail-fast: false

steps:
- name: Checkout
uses: actions/checkout@v4
# with:
# submodules: recursive
- name: Install dependencies
if: matrix.os != 'macos-latest'
run: |
sudo apt-get install tcl tcl-dev
# - name: Install dependencies MacOS
# if: matrix.os == 'macos-latest'
# run: |
# sudo brew install tcl-devel

- name: Pre-requirements
run: |
test -f ../tclconfig/tcl.m4 && echo "use ../tclconfig" || {
test -f tclconfig/tcl.m4 && echo "use ./tclconfig" || \
echo 'checkout tclconfig module ...' && \
git submodule update --init --recursive tclconfig && echo "tclconfig module is up-to-date" || {
echo 'checkout modules failed, clone ...' && \
git clone https://github.com/tcltk/tclconfig.git ../tclconfig
}
}
- name: Software versions tcl/${{ matrix.compiler }}
run: |
echo "${{ matrix.COMPILER }}: $(${{ matrix.COMPILER }} --version)"
echo "TCL: $(echo puts [info patchlevel] | tclsh)"
- name: Configure ${{ matrix.compiler }}
env:
CC: ${{ matrix.compiler }}
run: |
test -f configure && echo "configure already exists in $(pwd) ..." || autoreconf -f
mkdir ./unix/build-${{ matrix.compiler }}; cd "$_"
../../configure --with-tcl=/usr/lib/tcl8.6
- name: Build ${{ matrix.compiler }}
working-directory: ./unix/build-${{ matrix.compiler }}
env:
CC: ${{ matrix.compiler }}
run: |
make -j4
- name: Test ${{ matrix.compiler }}
working-directory: ./unix/build-${{ matrix.compiler }}
run: |
echo $TZ; timedatectl status
# tclsh ../../tests/all.tcl
make test
- name: Install ${{ matrix.compiler }}
working-directory: ./unix/build-${{ matrix.compiler }}
run: |
sudo make install
echo 'if {[catch {package require tclclockmod; clock format -now}]} {puts stderr "ERROR!"; exit 1} else {puts "OK."}' | tclsh
- name: Clean ${{ matrix.compiler }}
working-directory: ./unix/build-${{ matrix.compiler }}
run: |
make clean
9 changes: 5 additions & 4 deletions .github/workflows/linux-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,19 @@ jobs:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

- name: Install dependencies
- name: Install dependencies
run: |
sudo apt-get update -qq
sudo apt-get install -y tcl8.6-dev
- name: configure
- name: configure
run: |
autoconf
autoreconf -iv
cd unix
../configure --with-tcl=/usr/lib/tcl8.6
- name: make
- name: make
run: |
cd unix
make
Expand All @@ -47,7 +47,8 @@ jobs:
# current time and time-zone:
echo $TZ; timedatectl status
# load local library and execute local test cases:
tclsh tests/all.tcl
cd unix
make test
- name: install
run: |
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "tclconfig"]
path = tclconfig
url = https://github.com/tcltk/tclconfig.git
8 changes: 8 additions & 0 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,14 @@ $(PKG_STUB_LIB_FILE): $(PKG_STUB_OBJECTS)
${MAKE_STUB_LIB}
$(RANLIB_STUB) $(PKG_STUB_LIB_FILE)

#========================================================================

gendate:
bison --output-file=$(srcdir)/generic/tclDate.c \
--name-prefix=TclDate \
--no-lines \
$(srcdir)/generic/tclGetDate.y

#========================================================================
# We need to enumerate the list of .c to .o lines here.
#
Expand Down
24 changes: 18 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
v.8.6.7-03 2018/12/03

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

What is this ?
==============

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

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

Now this clock-engine is a part of Tcl 8.7 / 9.0.

How to compile ?
----------------

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

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

#### How the performance is measured:

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/>
Here is a diff illustrating that (which amounted to almost 95x speed-up):
```diff
% timerate -calibrate {}
% clock scan "" -timezone :CET; clock scan "" -gmt 1; # warming up
% timerate { clock scan "2009-06-30T18:30:00 CEST" -format "%Y-%m-%dT%H:%M:%S %z" -gmt 1 }
- 62.0972 µs/# 16094 # 16103.8 #/sec 999.392 net-ms
+ 0.654699 µs/# 1437085 # 1527419 #/sec 940.858 net-ms
```

Tcl compatibility:
=================

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

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`).

Differences from base clock
===========================

clock unixtime
Differences from base clock: `clock unixtime`
--------------

Same as "clock scan" except:
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ dnl to configure the system for the local environment.
# so you can encode the package version directly into the source files.
#-----------------------------------------------------------------------

AC_INIT([tclclockmod], [8.6.709])
AC_INIT([tclclockmod], [8.6.710])

#--------------------------------------------------------------------
# Call TEA_INIT as the first TEA_ macro to set up initial vars.
Expand Down
Loading

0 comments on commit 02062bb

Please sign in to comment.