Sujet : Re: Parsing timestamps?
De : anton (at) *nospam* mips.complang.tuwien.ac.at (Anton Ertl)
Groupes : comp.lang.forthDate : 17. Jul 2025, 14:56:36
Autres entêtes
Organisation : Institut fuer Computersprachen, Technische Universitaet Wien
Message-ID : <2025Jul17.155636@mips.complang.tuwien.ac.at>
References : 1 2 3 4 5 6 7 8 9 10
User-Agent : xrn 10.11
minforth <
minforth@gmx.net> writes:
Meanwhile many years ago, comparative tests were carried out with a
couple of representative archived serial data (~50k samples)
Representative of what? Serial: what series?
Anyway, since I don't have these data, I won't repeat this experiment
with the routines I have written.
Ultimately, Kahan summation
was the winner. It is slow, but there were no in-the-loop
requirements, so for a background task, Kahan was fast enough.
I wanted to see how slow, so I added KAHAN-SUM to
https://www.complang.tuwien.ac.at/forth/programs/pairwise-sum.4thand on the Ryzen 5800X I got (data for the other routines from the
earlier posting):
cycles:u
gforth-fast iforth lxf SwiftForth VFX
3_057_979_501 6_482_017_334 6_087_130_593 6_021_777_424 6_034_560_441 NAI
6_601_284_920 6_452_716_125 7_001_806_497 6_606_674_147 6_713_703_069 UNR
3_787_327_724 2_949_273_264 1_641_710_689 7_437_654_901 1_298_257_315 REC
9_150_679_812 14_634_786_781 SR
57_819_112_550 28_621_991_440 28_431_247_791 28_409_857_650 28_462_276_524 KAH
instructions:u
gforth-fast iforth lxf SwiftForth VFX
13_113_842_702 6_264_132_870 9_011_308_923 11_011_828_048 8_072_637_768 NAI
6_802_702_884 2_553_418_501 4_238_099_417 11_277_658_203 3_244_590_981 UNR
9_370_432_755 4_489_562_792 4_955_679_285 12_283_918_226 3_915_367_813 REC
51_113_853_111 29_264_267_850 SR
54_114_197_272 18_264_494_804 21_011_621_955 27_012_178_800 20_072_845_336 KAH
The versions used are still:
Gforth 0.7.9_20250625
iForth 5.1-mini
lxf 1.7-172-983
SwiftForth x64-Linux 4.0.0-RC89
VFX Forth 64 5.43 [build 0199] 2023-11-09
KAHan-sum is More than 20 times slower than REC on VFX64. The
particular slowness of gforth-fast is probably due to the weaknesses
of FP stack caching in Gforth.
One can do something like Kahan summation also for pairwise addition.
The base step (half of the additions) becomes simpler (no compensation
in any input), but more complicated in the inner additions (one
compensation each). The main benefit would be that several additions
can be done in parallel, and the expected error is even smaller.
- anton
-- M. Anton Ertl http://www.complang.tuwien.ac.at/anton/home.htmlcomp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html New standard: https://forth-standard.org/EuroForth 2025 CFP: http://www.euroforth.org/ef25/cfp.html