Discussion:
[tin 2.1.1] snaphsots
Thomas Dickey
2012-02-21 10:56:11 UTC
Permalink
I've made snapshots of the upcomming tin 2.1.1 (unstable) release
including the --enbale-heapsort configure option. If specified a new
'M'enu option is available to specify the sorting function used. Tit
defaults to qsort(3) and can be changed to heapsort(3) which may
speed up sorting when the data is somewhat presorted (usualy the case
in large groups with long threads).
<ftp://ftp.tin.org/pub/news/clients/tin/unstable/snapshots/>
@Thomas: vsnprintf is doubled in configure.in:AC_CHECK_FUNCS() and on
agreed (cut/paste error). It can be removed.
debian based linux systems a useable heapsort is available in libbsd
(-lbsd / <bsd/stdlib.h>) - I don't know if it's worth checking for
on Linux? I'm using that port with Lynx, but haven't really decided
if it's a good thing to use since its headers seem to change without
much reasoning involved. (It can be troublesome to support in different
versions). Something to think about.
--
Thomas E. Dickey <***@invisible-island.net>
http://invisible-island.net
ftp://invisible-island.net
Urs Janßen
2012-02-21 12:31:25 UTC
Permalink
Post by Thomas Dickey
debian based linux systems a useable heapsort is available in libbsd
(-lbsd / <bsd/stdlib.h>) - I don't know if it's worth checking for
on Linux? I'm using that port with Lynx, but haven't really decided
if it's a good thing to use since its headers seem to change without
much reasoning involved. (It can be troublesome to support in different
versions). Something to think about.
Yes on linux. The heapsort in the library uses nearly the same code as the
one provided with tin (the libs version may have an overflow problem with
large arrays as it uses int instead of size_t for several vars; I guess this
will be fixed in the next release) and I doubt that someone will optimize
that code in the (near) future. So (currently) the only benefit would be
a smaller (but less portable) binarie. If there will be some optimization
later on using the libs version may be a win...

I'm fine with the current solution - I just wanted to mention the existence
of the library. <http://libbsd.freedesktop.org/wiki/>

urs
--
"Only whimps use tape backup: _real_ men just upload their important stuff
on ftp, and let the rest of the world mirror it ;)" - Linus
Dennis Preiser
2012-02-21 17:10:39 UTC
Permalink
I've made snapshots of the upcomming tin 2.1.1 (unstable) release
including the --enbale-heapsort configure option. If specified a new
'M'enu option is available to specify the sorting function used.
I think this is not group specific. We can undo the changes which would
be necessary only for group specific attributes (read_attributes_file(),
attribute state).

Dennis

diff -urp tin-2.1.1/include/tin.h tin-2.1.1_r1/include/tin.h
--- tin-2.1.1/include/tin.h 2012-02-21 16:58:50.000000000 +0100
+++ tin-2.1.1_r1/include/tin.h 2012-02-21 17:20:37.000000000 +0100
@@ -1672,9 +1672,6 @@ struct t_attribute_state {
unsigned signature_repost:1;
unsigned sort_article_type:1;
unsigned sort_threads_type:1;
-#ifdef USE_HEAPSORT
- unsigned sort_function:1;
-#endif
unsigned start_editor_offset:1;
unsigned tex2iso_conv:1;
unsigned thread_articles:1;
diff -urp tin-2.1.1/src/attrib.c tin-2.1.1_r1/src/attrib.c
--- tin-2.1.1/src/attrib.c 2012-02-21 09:42:39.000000000 +0100
+++ tin-2.1.1_r1/src/attrib.c 2012-02-21 17:16:54.000000000 +0100
@@ -224,9 +224,6 @@ set_default_state(
state->signature_repost = FALSE;
state->sort_article_type = FALSE;
state->sort_threads_type = FALSE;
-#ifdef USE_HEAPSORT
- state->sort_function = 0;
-#endif
state->start_editor_offset = FALSE;
state->tex2iso_conv = FALSE;
state->thread_articles = FALSE;
@@ -452,9 +449,6 @@ read_attributes_file(
MATCH_STRING("sigfile=", OPT_ATTRIB_SIGFILE);
MATCH_INTEGER("sort_article_type=", OPT_ATTRIB_SORT_ARTICLE_TYPE, SORT_ARTICLES_BY_LINES_ASCEND);
MATCH_INTEGER("sort_threads_type=", OPT_ATTRIB_SORT_THREADS_TYPE, SORT_THREADS_BY_LAST_POSTING_DATE_ASCEND);
-#ifdef USE_HEAPSORT
- MATCH_LIST("sort_function=", OPT_SORT_FUNCTION, txt_sort_functions);
-#endif
break;

case 't':

Loading...