Rocksolid Light

Welcome to Rocksolid Light

mail  files  register  newsreader  groups  login

Message-ID:  

Statistics are no substitute for judgement. -- Henry Clay


devel / comp.lang.forth / Re: Sorting multiple tables

SubjectAuthor
* Sorting multiple tablesJos Ven
+* Re: Sorting multiple tablesminforth
|`* Re: Sorting multiple tablesJos Ven
| `* Re: Sorting multiple tablesminforth
|  `* Re: Sorting multiple tablesJos Ven
|   `- Re: Sorting multiple tablesminforth
`* Re: Sorting multiple tablesnone
 `* Re: Sorting multiple tablesJos Ven
  `* Re: Sorting multiple tablesMarcel Hendrix
   `- Re: Sorting multiple tablesJos Ven

1
Sorting multiple tables

<97ad0c53-7e7c-4d47-8c01-49062c785525n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=23934&group=comp.lang.forth#23934

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:6214:b27:b0:635:e3ae:e096 with SMTP id w7-20020a0562140b2700b00635e3aee096mr5710qvj.12.1688121055800;
Fri, 30 Jun 2023 03:30:55 -0700 (PDT)
X-Received: by 2002:a17:902:d4c4:b0:1b8:2eca:7d9 with SMTP id
o4-20020a170902d4c400b001b82eca07d9mr1513490plg.3.1688121055516; Fri, 30 Jun
2023 03:30:55 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!newsfeed.hasname.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Fri, 30 Jun 2023 03:30:54 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=213.10.199.198; posting-account=nkqetwkAAACepkf86cwWAMB6YF6pRh3F
NNTP-Posting-Host: 213.10.199.198
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <97ad0c53-7e7c-4d47-8c01-49062c785525n@googlegroups.com>
Subject: Sorting multiple tables
From: josv@planet.nl (Jos Ven)
Injection-Date: Fri, 30 Jun 2023 10:30:55 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 3047
 by: Jos Ven - Fri, 30 Jun 2023 10:30 UTC

I just released a released table_sort.f and table_test.f to test and sort multiple tables.
See https://github.com/Jos-Ven/cforth/tree/WIP/src/app/esp for a download.

Gforth under Linux and Win32Forth under w11 are able to sort different tables parallel.

A test with table_test.f shows the following results (using 2 keys):

\ Under a 64 bits gforth-fast version 0.7.9_20220713
\ on the "Bookworm" with an i5-4200U CPU @ 1.60GHz I get:
Sorting 4 tables one at the time  
Needed sort time for each table with 200000 records in each table
719 679 687 697 ms READY!
Total time: 2782 ms  
1:sorted 2:sorted 3:sorted 4:sorted  

Parallel sorting 4 tables in the background moment:  
>>> Hit a key when the NEXT sort below is ready:
Needed sort time for each table with 200000 records in each table
1451 1462 1480 1469 ms READY!
Total needed time: 1481 ms  
1:sorted 2:sorted 3:sorted 4:sorted  

Changing 1 record in table1 and sorting again....
Parallel sorting 4 tables in the background moment:  

Needed sort time for each table with 200000 records in each table
443 449 443 451 ms READY!
Total needed time: 453 ms  
1:sorted 2:sorted 3:sorted 4:sorted
--------------------------

Under Win32Forth on W11 with an i9-12900 CPU @ 5.1 GHz I get:
Sorting 4 tables one at the time
Needed sort time for each table with 200000 records in each table
544 582 553 560 ms READY!
Total time: 2239 ms
1:sorted 2:sorted 3:sorted 4:sorted

Parallel sorting 4 tables in the background moment:
>>> Hit a key when the NEXT sort below is ready:
Needed sort time for each table with 200000 records in each table
566 554 545 589 ms READY!
Total needed time: 592 ms
1:sorted 2:sorted 3:sorted 4:sorted

Changing 1 record in table1 and sorting again....
Parallel sorting 4 tables in the background moment:

Needed sort time for each table with 200000 records in each table
122 120 118 119 ms READY!
Total needed time: 127 ms
1:sorted 2:sorted 3:sorted 4:sorted

Jos

Re: Sorting multiple tables

<405bb276-5495-4285-b58c-7f4cef8c5978n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=23935&group=comp.lang.forth#23935

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:ad4:5911:0:b0:635:e175:6dd with SMTP id ez17-20020ad45911000000b00635e17506ddmr6689qvb.7.1688122641599;
Fri, 30 Jun 2023 03:57:21 -0700 (PDT)
X-Received: by 2002:a63:f301:0:b0:53f:29a2:e92 with SMTP id
l1-20020a63f301000000b0053f29a20e92mr1011503pgh.8.1688122641137; Fri, 30 Jun
2023 03:57:21 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Fri, 30 Jun 2023 03:57:20 -0700 (PDT)
In-Reply-To: <97ad0c53-7e7c-4d47-8c01-49062c785525n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=87.157.105.164; posting-account=AqNUYgoAAADmkK2pN-RKms8sww57W0Iw
NNTP-Posting-Host: 87.157.105.164
References: <97ad0c53-7e7c-4d47-8c01-49062c785525n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <405bb276-5495-4285-b58c-7f4cef8c5978n@googlegroups.com>
Subject: Re: Sorting multiple tables
From: minforth@arcor.de (minforth)
Injection-Date: Fri, 30 Jun 2023 10:57:21 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 3380
 by: minforth - Fri, 30 Jun 2023 10:57 UTC

Jos Ven schrieb am Freitag, 30. Juni 2023 um 12:30:57 UTC+2:
> I just released a released table_sort.f and table_test.f to test and sort multiple tables.
> See https://github.com/Jos-Ven/cforth/tree/WIP/src/app/esp for a download.
>
> Gforth under Linux and Win32Forth under w11 are able to sort different tables parallel.
>
> A test with table_test.f shows the following results (using 2 keys):
>
> \ Under a 64 bits gforth-fast version 0.7.9_20220713
> \ on the "Bookworm" with an i5-4200U CPU @ 1.60GHz I get:
> Sorting 4 tables one at the time
> Needed sort time for each table with 200000 records in each table
> 719 679 687 697 ms READY!
> Total time: 2782 ms
> 1:sorted 2:sorted 3:sorted 4:sorted
>
> Parallel sorting 4 tables in the background moment:
> >>> Hit a key when the NEXT sort below is ready:
> Needed sort time for each table with 200000 records in each table
> 1451 1462 1480 1469 ms READY!
> Total needed time: 1481 ms
> 1:sorted 2:sorted 3:sorted 4:sorted
>
> Changing 1 record in table1 and sorting again....
> Parallel sorting 4 tables in the background moment:
>
> Needed sort time for each table with 200000 records in each table
> 443 449 443 451 ms READY!
> Total needed time: 453 ms
> 1:sorted 2:sorted 3:sorted 4:sorted
> --------------------------
>
> Under Win32Forth on W11 with an i9-12900 CPU @ 5.1 GHz I get:
> Sorting 4 tables one at the time
> Needed sort time for each table with 200000 records in each table
> 544 582 553 560 ms READY!
> Total time: 2239 ms
> 1:sorted 2:sorted 3:sorted 4:sorted
>
> Parallel sorting 4 tables in the background moment:
> >>> Hit a key when the NEXT sort below is ready:
> Needed sort time for each table with 200000 records in each table
> 566 554 545 589 ms READY!
> Total needed time: 592 ms
> 1:sorted 2:sorted 3:sorted 4:sorted
>
> Changing 1 record in table1 and sorting again....
> Parallel sorting 4 tables in the background moment:
>
> Needed sort time for each table with 200000 records in each table
> 122 120 118 119 ms READY!
> Total needed time: 127 ms
> 1:sorted 2:sorted 3:sorted 4:sorted
>
> Jos

Nice and well, but what does it tell us? That the i9 is faster?

Re: Sorting multiple tables

<b30d07d7-0542-4528-a258-1c62a35d78a9n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=23936&group=comp.lang.forth#23936

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:622a:1aa5:b0:3f6:af78:de08 with SMTP id s37-20020a05622a1aa500b003f6af78de08mr6447qtc.12.1688125894947;
Fri, 30 Jun 2023 04:51:34 -0700 (PDT)
X-Received: by 2002:a05:6a00:2d02:b0:663:517c:82f with SMTP id
fa2-20020a056a002d0200b00663517c082fmr2505724pfb.6.1688125894416; Fri, 30 Jun
2023 04:51:34 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Fri, 30 Jun 2023 04:51:33 -0700 (PDT)
In-Reply-To: <405bb276-5495-4285-b58c-7f4cef8c5978n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=213.10.199.198; posting-account=nkqetwkAAACepkf86cwWAMB6YF6pRh3F
NNTP-Posting-Host: 213.10.199.198
References: <97ad0c53-7e7c-4d47-8c01-49062c785525n@googlegroups.com> <405bb276-5495-4285-b58c-7f4cef8c5978n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <b30d07d7-0542-4528-a258-1c62a35d78a9n@googlegroups.com>
Subject: Re: Sorting multiple tables
From: josv@planet.nl (Jos Ven)
Injection-Date: Fri, 30 Jun 2023 11:51:34 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 3931
 by: Jos Ven - Fri, 30 Jun 2023 11:51 UTC

Op vrijdag 30 juni 2023 om 12:57:22 UTC+2 schreef minforth:
> Jos Ven schrieb am Freitag, 30. Juni 2023 um 12:30:57 UTC+2:
> > I just released a released table_sort.f and table_test.f to test and sort multiple tables.
> > See https://github.com/Jos-Ven/cforth/tree/WIP/src/app/esp for a download.
> >
> > Gforth under Linux and Win32Forth under w11 are able to sort different tables parallel.
> >
> > A test with table_test.f shows the following results (using 2 keys):
> >
> > \ Under a 64 bits gforth-fast version 0.7.9_20220713
> > \ on the "Bookworm" with an i5-4200U CPU @ 1.60GHz I get:
> > Sorting 4 tables one at the time
> > Needed sort time for each table with 200000 records in each table
> > 719 679 687 697 ms READY!
> > Total time: 2782 ms
> > 1:sorted 2:sorted 3:sorted 4:sorted
> >
> > Parallel sorting 4 tables in the background moment:
> > >>> Hit a key when the NEXT sort below is ready:
> > Needed sort time for each table with 200000 records in each table
> > 1451 1462 1480 1469 ms READY!
> > Total needed time: 1481 ms
> > 1:sorted 2:sorted 3:sorted 4:sorted
> >
> > Changing 1 record in table1 and sorting again....
> > Parallel sorting 4 tables in the background moment:
> >
> > Needed sort time for each table with 200000 records in each table
> > 443 449 443 451 ms READY!
> > Total needed time: 453 ms
> > 1:sorted 2:sorted 3:sorted 4:sorted
> > --------------------------
> >
> > Under Win32Forth on W11 with an i9-12900 CPU @ 5.1 GHz I get:
> > Sorting 4 tables one at the time
> > Needed sort time for each table with 200000 records in each table
> > 544 582 553 560 ms READY!
> > Total time: 2239 ms
> > 1:sorted 2:sorted 3:sorted 4:sorted
> >
> > Parallel sorting 4 tables in the background moment:
> > >>> Hit a key when the NEXT sort below is ready:
> > Needed sort time for each table with 200000 records in each table
> > 566 554 545 589 ms READY!
> > Total needed time: 592 ms
> > 1:sorted 2:sorted 3:sorted 4:sorted
> >
> > Changing 1 record in table1 and sorting again....
> > Parallel sorting 4 tables in the background moment:
> >
> > Needed sort time for each table with 200000 records in each table
> > 122 120 118 119 ms READY!
> > Total needed time: 127 ms
> > 1:sorted 2:sorted 3:sorted 4:sorted
> >
> > Jos

Hi,
> Nice and well, but what does it tell us? That the i9 is faster?
It tells me the following:
1) It indeed works under Gforth and Win32Forth
2) It does not have to take much time more to sort 4 table instead of 1 table.
3) If you change only 1 record than a new sort is much faster.

I did this since my old sorting source made me write unclear code when multiple tables are used.

Jos

Re: Sorting multiple tables

<66a9f646-d9a9-49bd-9ef3-cbeca87a2ec6n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=23937&group=comp.lang.forth#23937

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:622a:1b8c:b0:3ff:2f06:499c with SMTP id bp12-20020a05622a1b8c00b003ff2f06499cmr6433qtb.6.1688126764175;
Fri, 30 Jun 2023 05:06:04 -0700 (PDT)
X-Received: by 2002:a17:902:bc43:b0:1af:f718:ecf9 with SMTP id
t3-20020a170902bc4300b001aff718ecf9mr1410719plz.0.1688126763568; Fri, 30 Jun
2023 05:06:03 -0700 (PDT)
Path: i2pn2.org!i2pn.org!news.niel.me!glou.org!news.glou.org!usenet-fr.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Fri, 30 Jun 2023 05:06:02 -0700 (PDT)
In-Reply-To: <b30d07d7-0542-4528-a258-1c62a35d78a9n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2003:f7:1f01:f079:1413:4a2b:d4a8:f8ee;
posting-account=AqNUYgoAAADmkK2pN-RKms8sww57W0Iw
NNTP-Posting-Host: 2003:f7:1f01:f079:1413:4a2b:d4a8:f8ee
References: <97ad0c53-7e7c-4d47-8c01-49062c785525n@googlegroups.com>
<405bb276-5495-4285-b58c-7f4cef8c5978n@googlegroups.com> <b30d07d7-0542-4528-a258-1c62a35d78a9n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <66a9f646-d9a9-49bd-9ef3-cbeca87a2ec6n@googlegroups.com>
Subject: Re: Sorting multiple tables
From: minforth@arcor.de (minforth)
Injection-Date: Fri, 30 Jun 2023 12:06:04 +0000
Content-Type: text/plain; charset="UTF-8"
 by: minforth - Fri, 30 Jun 2023 12:06 UTC

Jos Ven schrieb am Freitag, 30. Juni 2023 um 13:51:36 UTC+2:
> Op vrijdag 30 juni 2023 om 12:57:22 UTC+2 schreef minforth:
> > Jos Ven schrieb am Freitag, 30. Juni 2023 um 12:30:57 UTC+2:
> > > I just released a released table_sort.f and table_test.f to test and sort multiple tables.
> > > See https://github.com/Jos-Ven/cforth/tree/WIP/src/app/esp for a download.
> > >
> > > Gforth under Linux and Win32Forth under w11 are able to sort different tables parallel.
> > >
> > > A test with table_test.f shows the following results (using 2 keys):
> > >
> > > \ Under a 64 bits gforth-fast version 0.7.9_20220713
> > > \ on the "Bookworm" with an i5-4200U CPU @ 1.60GHz I get:
> > > Sorting 4 tables one at the time
> > > Needed sort time for each table with 200000 records in each table
> > > 719 679 687 697 ms READY!
> > > Total time: 2782 ms
> > > 1:sorted 2:sorted 3:sorted 4:sorted
> > >
> > > Parallel sorting 4 tables in the background moment:
> > > >>> Hit a key when the NEXT sort below is ready:
> > > Needed sort time for each table with 200000 records in each table
> > > 1451 1462 1480 1469 ms READY!
> > > Total needed time: 1481 ms
> > > 1:sorted 2:sorted 3:sorted 4:sorted
> > >
> > > Changing 1 record in table1 and sorting again....
> > > Parallel sorting 4 tables in the background moment:
> > >
> > > Needed sort time for each table with 200000 records in each table
> > > 443 449 443 451 ms READY!
> > > Total needed time: 453 ms
> > > 1:sorted 2:sorted 3:sorted 4:sorted
> > > --------------------------
> > >
> > > Under Win32Forth on W11 with an i9-12900 CPU @ 5.1 GHz I get:
> > > Sorting 4 tables one at the time
> > > Needed sort time for each table with 200000 records in each table
> > > 544 582 553 560 ms READY!
> > > Total time: 2239 ms
> > > 1:sorted 2:sorted 3:sorted 4:sorted
> > >
> > > Parallel sorting 4 tables in the background moment:
> > > >>> Hit a key when the NEXT sort below is ready:
> > > Needed sort time for each table with 200000 records in each table
> > > 566 554 545 589 ms READY!
> > > Total needed time: 592 ms
> > > 1:sorted 2:sorted 3:sorted 4:sorted
> > >
> > > Changing 1 record in table1 and sorting again....
> > > Parallel sorting 4 tables in the background moment:
> > >
> > > Needed sort time for each table with 200000 records in each table
> > > 122 120 118 119 ms READY!
> > > Total needed time: 127 ms
> > > 1:sorted 2:sorted 3:sorted 4:sorted
> > >
> > > Jos
> Hi,
> > Nice and well, but what does it tell us? That the i9 is faster?
> It tells me the following:
> 1) It indeed works under Gforth and Win32Forth
> 2) It does not have to take much time more to sort 4 table instead of 1 table.
> 3) If you change only 1 record than a new sort is much faster.
>
> I did this since my old sorting source made me write unclear code when multiple tables are used.
>

Just out of curiosity and with due respect for your work:
Since cforth is C-based and since qsort is in stdlib anyway, did you
compare your shell-sort against qsort?
(assuming that in both versions only the index array is sorted in memory)

Re: Sorting multiple tables

<14564155-bff0-4650-9d32-648bacb91811n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=23938&group=comp.lang.forth#23938

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:620a:3955:b0:765:a62e:3a1c with SMTP id qs21-20020a05620a395500b00765a62e3a1cmr5994qkn.9.1688131345101;
Fri, 30 Jun 2023 06:22:25 -0700 (PDT)
X-Received: by 2002:a05:6a00:b46:b0:674:a3be:2773 with SMTP id
p6-20020a056a000b4600b00674a3be2773mr3135250pfo.5.1688131344832; Fri, 30 Jun
2023 06:22:24 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!1.us.feeder.erje.net!feeder.erje.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Fri, 30 Jun 2023 06:22:24 -0700 (PDT)
In-Reply-To: <66a9f646-d9a9-49bd-9ef3-cbeca87a2ec6n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=213.10.199.198; posting-account=nkqetwkAAACepkf86cwWAMB6YF6pRh3F
NNTP-Posting-Host: 213.10.199.198
References: <97ad0c53-7e7c-4d47-8c01-49062c785525n@googlegroups.com>
<405bb276-5495-4285-b58c-7f4cef8c5978n@googlegroups.com> <b30d07d7-0542-4528-a258-1c62a35d78a9n@googlegroups.com>
<66a9f646-d9a9-49bd-9ef3-cbeca87a2ec6n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <14564155-bff0-4650-9d32-648bacb91811n@googlegroups.com>
Subject: Re: Sorting multiple tables
From: josv@planet.nl (Jos Ven)
Injection-Date: Fri, 30 Jun 2023 13:22:25 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 4897
 by: Jos Ven - Fri, 30 Jun 2023 13:22 UTC

Op vrijdag 30 juni 2023 om 14:06:05 UTC+2 schreef minforth:
> Jos Ven schrieb am Freitag, 30. Juni 2023 um 13:51:36 UTC+2:
> > Op vrijdag 30 juni 2023 om 12:57:22 UTC+2 schreef minforth:
> > > Jos Ven schrieb am Freitag, 30. Juni 2023 um 12:30:57 UTC+2:
> > > > I just released a released table_sort.f and table_test.f to test and sort multiple tables.
> > > > See https://github.com/Jos-Ven/cforth/tree/WIP/src/app/esp for a download.
> > > >
> > > > Gforth under Linux and Win32Forth under w11 are able to sort different tables parallel.
> > > >
> > > > A test with table_test.f shows the following results (using 2 keys):
> > > >
> > > > \ Under a 64 bits gforth-fast version 0.7.9_20220713
> > > > \ on the "Bookworm" with an i5-4200U CPU @ 1.60GHz I get:
> > > > Sorting 4 tables one at the time
> > > > Needed sort time for each table with 200000 records in each table
> > > > 719 679 687 697 ms READY!
> > > > Total time: 2782 ms
> > > > 1:sorted 2:sorted 3:sorted 4:sorted
> > > >
> > > > Parallel sorting 4 tables in the background moment:
> > > > >>> Hit a key when the NEXT sort below is ready:
> > > > Needed sort time for each table with 200000 records in each table
> > > > 1451 1462 1480 1469 ms READY!
> > > > Total needed time: 1481 ms
> > > > 1:sorted 2:sorted 3:sorted 4:sorted
> > > >
> > > > Changing 1 record in table1 and sorting again....
> > > > Parallel sorting 4 tables in the background moment:
> > > >
> > > > Needed sort time for each table with 200000 records in each table
> > > > 443 449 443 451 ms READY!
> > > > Total needed time: 453 ms
> > > > 1:sorted 2:sorted 3:sorted 4:sorted
> > > > --------------------------
> > > >
> > > > Under Win32Forth on W11 with an i9-12900 CPU @ 5.1 GHz I get:
> > > > Sorting 4 tables one at the time
> > > > Needed sort time for each table with 200000 records in each table
> > > > 544 582 553 560 ms READY!
> > > > Total time: 2239 ms
> > > > 1:sorted 2:sorted 3:sorted 4:sorted
> > > >
> > > > Parallel sorting 4 tables in the background moment:
> > > > >>> Hit a key when the NEXT sort below is ready:
> > > > Needed sort time for each table with 200000 records in each table
> > > > 566 554 545 589 ms READY!
> > > > Total needed time: 592 ms
> > > > 1:sorted 2:sorted 3:sorted 4:sorted
> > > >
> > > > Changing 1 record in table1 and sorting again....
> > > > Parallel sorting 4 tables in the background moment:
> > > >
> > > > Needed sort time for each table with 200000 records in each table
> > > > 122 120 118 119 ms READY!
> > > > Total needed time: 127 ms
> > > > 1:sorted 2:sorted 3:sorted 4:sorted
> > > >
> > > > Jos
> > Hi,
> > > Nice and well, but what does it tell us? That the i9 is faster?
> > It tells me the following:
> > 1) It indeed works under Gforth and Win32Forth
> > 2) It does not have to take much time more to sort 4 table instead of 1 table.
> > 3) If you change only 1 record than a new sort is much faster.
> >
> > I did this since my old sorting source made me write unclear code when multiple tables are used.
> >
> Just out of curiosity and with due respect for your work:
> Since cforth is C-based and since qsort is in stdlib anyway, did you
> compare your shell-sort against qsort?
> (assuming that in both versions only the index array is sorted in memory)

Hi, Thank you for all the comments.
The qsort in stdlib looks like a rudimentary source for only one key.
Also not sure if it that would allow me to use multiple tables in a clear way in Forth.

Jos

Re: Sorting multiple tables

<def671f1-f2d9-4d60-ae9b-7ddf8b0653b7n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=23939&group=comp.lang.forth#23939

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:620a:469f:b0:765:aafa:5be5 with SMTP id bq31-20020a05620a469f00b00765aafa5be5mr6421qkb.4.1688132965832;
Fri, 30 Jun 2023 06:49:25 -0700 (PDT)
X-Received: by 2002:a17:902:d2cd:b0:1b7:f24c:3ba3 with SMTP id
n13-20020a170902d2cd00b001b7f24c3ba3mr1953553plc.13.1688132965605; Fri, 30
Jun 2023 06:49:25 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Fri, 30 Jun 2023 06:49:24 -0700 (PDT)
In-Reply-To: <14564155-bff0-4650-9d32-648bacb91811n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2003:f7:1f01:f079:1413:4a2b:d4a8:f8ee;
posting-account=AqNUYgoAAADmkK2pN-RKms8sww57W0Iw
NNTP-Posting-Host: 2003:f7:1f01:f079:1413:4a2b:d4a8:f8ee
References: <97ad0c53-7e7c-4d47-8c01-49062c785525n@googlegroups.com>
<405bb276-5495-4285-b58c-7f4cef8c5978n@googlegroups.com> <b30d07d7-0542-4528-a258-1c62a35d78a9n@googlegroups.com>
<66a9f646-d9a9-49bd-9ef3-cbeca87a2ec6n@googlegroups.com> <14564155-bff0-4650-9d32-648bacb91811n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <def671f1-f2d9-4d60-ae9b-7ddf8b0653b7n@googlegroups.com>
Subject: Re: Sorting multiple tables
From: minforth@arcor.de (minforth)
Injection-Date: Fri, 30 Jun 2023 13:49:25 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1978
 by: minforth - Fri, 30 Jun 2023 13:49 UTC

Jos Ven schrieb am Freitag, 30. Juni 2023 um 15:22:26 UTC+2:
> Hi, Thank you for all the comments.
> The qsort in stdlib looks like a rudimentary source for only one key.
> Also not sure if it that would allow me to use multiple tables in a clear way in Forth.

off-topic:
the qsort api is as simple as can be of course. handling a small number of multi-keys
can done by the comparator function, but this can become rather unflexibe indeed.
and keys in global variables can mean to lose reentrancy.

but when you have your own forth source, you ride in the saddle :)

Re: Sorting multiple tables

<nnd$0652a427$715d7271@a5a12b8063ea357f>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=23944&group=comp.lang.forth#23944

  copy link   Newsgroups: comp.lang.forth
Newsgroups: comp.lang.forth
References: <97ad0c53-7e7c-4d47-8c01-49062c785525n@googlegroups.com>
Subject: Re: Sorting multiple tables
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
From: albert@cherry (none)
Originator: albert@cherry.(none) (albert)
Message-ID: <nnd$0652a427$715d7271@a5a12b8063ea357f>
Organization: KPN B.V.
Date: Sat, 01 Jul 2023 11:38:56 +0200
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!feeder1.feed.usenet.farm!feed.usenet.farm!peer02.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!feed.abavia.com!abe005.abavia.com!abp003.abavia.com!news.kpn.nl!not-for-mail
Lines: 24
Injection-Date: Sat, 01 Jul 2023 11:38:56 +0200
Injection-Info: news.kpn.nl; mail-complaints-to="abuse@kpn.com"
X-Received-Bytes: 1628
 by: none - Sat, 1 Jul 2023 09:38 UTC

In article <97ad0c53-7e7c-4d47-8c01-49062c785525n@googlegroups.com>,
Jos Ven <josv@planet.nl> wrote:
>I just released a released table_sort.f and table_test.f to test and
>sort multiple tables.
>See https://github.com/Jos-Ven/cforth/tree/WIP/src/app/esp for a download.
>
>Gforth under Linux and Win32Forth under w11 are able to sort different
>tables parallel.

Can you explain what you mean by sorting "multiple tables" "parallel"?
Is it fair to say:
cforth has the ability to perform Forth code in parallel,
this makes sense provided *you have multiple cores*
You have made a sort that is re-entrant. That is, it can actually run
in parallel without disturbing the other sort's.

>Jos
Albert
--
Don't praise the day before the evening. One swallow doesn't make spring.
You must not say "hey" before you have crossed the bridge. Don't sell the
hide of the bear until you shot it. Better one bird in the hand than ten in
the air. First gain is a cat spinning. - the Wise from Antrim -

Re: Sorting multiple tables

<48b07561-cc0c-489c-9ad6-efb9673761b0n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=23945&group=comp.lang.forth#23945

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:6214:18f1:b0:635:e028:3e62 with SMTP id ep17-20020a05621418f100b00635e0283e62mr14252qvb.0.1688207199610;
Sat, 01 Jul 2023 03:26:39 -0700 (PDT)
X-Received: by 2002:a17:90b:1256:b0:25b:c272:ab34 with SMTP id
gx22-20020a17090b125600b0025bc272ab34mr3249672pjb.7.1688207199073; Sat, 01
Jul 2023 03:26:39 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Sat, 1 Jul 2023 03:26:38 -0700 (PDT)
In-Reply-To: <nnd$0652a427$715d7271@a5a12b8063ea357f>
Injection-Info: google-groups.googlegroups.com; posting-host=213.10.199.198; posting-account=nkqetwkAAACepkf86cwWAMB6YF6pRh3F
NNTP-Posting-Host: 213.10.199.198
References: <97ad0c53-7e7c-4d47-8c01-49062c785525n@googlegroups.com> <nnd$0652a427$715d7271@a5a12b8063ea357f>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <48b07561-cc0c-489c-9ad6-efb9673761b0n@googlegroups.com>
Subject: Re: Sorting multiple tables
From: josv@planet.nl (Jos Ven)
Injection-Date: Sat, 01 Jul 2023 10:26:39 +0000
Content-Type: text/plain; charset="UTF-8"
 by: Jos Ven - Sat, 1 Jul 2023 10:26 UTC

Op zaterdag 1 juli 2023 om 11:39:00 UTC+2 schreef none albert:
> In article <9...om>,
> J..nl> wrote:
> >I just released a released table_sort.f and table_test.f to test and
> >sort multiple tables.
> >See https://github.com/Jos-Ven/cforth/tree/WIP/src/app/esp for a download.
> >
> >Gforth under Linux and Win32Forth under w11 are able to sort different
> >tables parallel.
> Can you explain what you mean by sorting "multiple tables" "parallel"?
> Is it fair to say:
> cforth has the ability to perform Forth code in parallel,
> this makes sense provided *you have multiple cores*
> You have made a sort that is re-entrant. That is, it can actually run
> in parallel without disturbing the other sort's.
>
> >Jos
> Albert
> --
> Don't praise the day before the evening. One swallow doesn't make spring.
> You must not say "hey" before you have crossed the bridge. Don't sell the
> hide of the bear until you shot it. Better one bird in the hand than ten in
> the air. First gain is a cat spinning. - the Wise from Antrim -

Hi,
That is right for Gforth and Win32Forth and perhaps other Forth-systems that are able
to use preemptive multitasking on a CPU with multiple cores.
The problem with Cforth on an ESP32 is that it does not yet use multiple cores.

Jos

Re: Sorting multiple tables

<8cf0d4d9-578a-472a-99cc-f1c7b9047ed7n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=23946&group=comp.lang.forth#23946

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:620a:4727:b0:763:9d5b:a310 with SMTP id bs39-20020a05620a472700b007639d5ba310mr14810qkb.8.1688230270977;
Sat, 01 Jul 2023 09:51:10 -0700 (PDT)
X-Received: by 2002:a05:6a00:14cc:b0:677:7731:5edd with SMTP id
w12-20020a056a0014cc00b0067777315eddmr7106613pfu.0.1688230270374; Sat, 01 Jul
2023 09:51:10 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Sat, 1 Jul 2023 09:51:09 -0700 (PDT)
In-Reply-To: <48b07561-cc0c-489c-9ad6-efb9673761b0n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2001:1c05:2f18:6d00:540b:eef5:e93e:9eb3;
posting-account=-JQ2RQoAAAB6B5tcBTSdvOqrD1HpT_Rk
NNTP-Posting-Host: 2001:1c05:2f18:6d00:540b:eef5:e93e:9eb3
References: <97ad0c53-7e7c-4d47-8c01-49062c785525n@googlegroups.com>
<nnd$0652a427$715d7271@a5a12b8063ea357f> <48b07561-cc0c-489c-9ad6-efb9673761b0n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <8cf0d4d9-578a-472a-99cc-f1c7b9047ed7n@googlegroups.com>
Subject: Re: Sorting multiple tables
From: mhx@iae.nl (Marcel Hendrix)
Injection-Date: Sat, 01 Jul 2023 16:51:10 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 1896
 by: Marcel Hendrix - Sat, 1 Jul 2023 16:51 UTC

On Saturday, July 1, 2023 at 12:26:40 PM UTC+2, Jos Ven wrote:
> Op zaterdag 1 juli 2023 om 11:39:00 UTC+2 schreef none albert:
> > In article <9...om>,
> > J..nl> wrote:
> > >I just released a released table_sort.f and table_test.f to test and
> > >sort multiple tables.
> > >See https://github.com/Jos-Ven/cforth/tree/WIP/src/app/esp for a download.

What happens if you (accidentally) specify tables that are actually the same? Like,
'sort db1 on column 1; sort db2 on column 2; sort db2 on column 3;
sort db1 on column 4; ' ?

-marcel

Re: Sorting multiple tables

<209530bb-4417-445e-aaba-bbab6cff860en@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=23947&group=comp.lang.forth#23947

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:620a:1a87:b0:765:a707:40dd with SMTP id bl7-20020a05620a1a8700b00765a70740ddmr15851qkb.3.1688237499286;
Sat, 01 Jul 2023 11:51:39 -0700 (PDT)
X-Received: by 2002:a05:6a00:2d02:b0:679:ab9d:1d54 with SMTP id
fa2-20020a056a002d0200b00679ab9d1d54mr7676012pfb.5.1688237498698; Sat, 01 Jul
2023 11:51:38 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Sat, 1 Jul 2023 11:51:37 -0700 (PDT)
In-Reply-To: <8cf0d4d9-578a-472a-99cc-f1c7b9047ed7n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=213.10.199.198; posting-account=nkqetwkAAACepkf86cwWAMB6YF6pRh3F
NNTP-Posting-Host: 213.10.199.198
References: <97ad0c53-7e7c-4d47-8c01-49062c785525n@googlegroups.com>
<nnd$0652a427$715d7271@a5a12b8063ea357f> <48b07561-cc0c-489c-9ad6-efb9673761b0n@googlegroups.com>
<8cf0d4d9-578a-472a-99cc-f1c7b9047ed7n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <209530bb-4417-445e-aaba-bbab6cff860en@googlegroups.com>
Subject: Re: Sorting multiple tables
From: josv@planet.nl (Jos Ven)
Injection-Date: Sat, 01 Jul 2023 18:51:39 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 3322
 by: Jos Ven - Sat, 1 Jul 2023 18:51 UTC

Op zaterdag 1 juli 2023 om 18:51:12 UTC+2 schreef Marcel Hendrix:
> On Saturday, July 1, 2023 at 12:26:40 PM UTC+2, Jos Ven wrote:
> > Op zaterdag 1 juli 2023 om 11:39:00 UTC+2 schreef none albert:
> > > In article <9...om>,
> > > J..nl> wrote:
> > > >I just released a released table_sort.f and table_test.f to test and
> > > >sort multiple tables.
> > > >See https://github.com/Jos-Ven/cforth/tree/WIP/src/app/esp for a download.
> What happens if you (accidentally) specify tables that are actually the same? Like,
> 'sort db1 on column 1; sort db2 on column 2; sort db2 on column 3;
> sort db1 on column 4; ' ?
>
> -marcel

Hi,
Thanks to your example I understand the following:
The problem is not the same size of the tables, but sorting
1 table 2 times parallel and using different 2 keys at the same time.
I tried it as follows:

: sort-test ( &table -- ) \ for table3 an table4
>r by[ test-chars test-group ]by r> table-sort ;

: sort-test1 ( &table -- ) \ for table1
>r by[ test-group ]by r> table-sort ;

: sort-test2 ( &table -- ) \ for table1
>r by[ test-chars ]by r> table-sort ;

Then table1 and again table1 table3 and table4 were parallel sorted.
Here is how is output looks for 10 records:

&table1 .records-sorted
0 fniocxww 1
1 hnlvpkkq 2
2 hvmfxkbe 1
3 jrvsrbwg 2
4 mlxxmvid 0
5 ofpdhmfp 0
6 ookrjluc 1
7 uujgmwhm 2
8 xryzcqzg 0
9 zbdnykzm 2 ok

&table3 .records-sorted
0 dkifbmmi 0
1 edrpmouy 0
2 obhayoqn 0
3 aldnvmes 1
4 junhlfwg 1
5 laitxzyr 1
6 zhxvkxat 1
7 ivslidzz 2
8 kztelryf 2
9 psgsdhji 2 ok

&table4 .records-sorted
0 gmxqrwzf 0
1 gorzpygj 0
2 jwstyqps 0
3 bmmfvocw 1
4 uaaioquq 1
5 fslktexz 2
6 mexkqbrq 2
7 rabcemhq 2
8 sxjfqiod 2
9 thuhxqjy 2 ok

Table1 got garbadge in so you get garbadge out.
tables3 and table4 are OK
Jos

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor