Needed sort time for each table with 200000 records in each tableHit a key when the NEXT sort below is ready:
Needed sort time for each table with 200000 records in each tableHit a key when the NEXT sort below is ready:
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:
Needed sort time for each table with 200000 records in each tableHit a key when the NEXT sort below is ready:
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:
Needed sort time for each table with 200000 records in each tableHit a key when the NEXT sort below is ready:
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
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:
Needed sort time for each table with 200000 records in each tableHit a key when the NEXT sort below is ready:
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:
Needed sort time for each table with 200000 records in each tableHit a key when the NEXT sort below is ready:
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
Hi,Jos
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 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:
Needed sort time for each table with 200000 records in each tableHit a key when the NEXT sort below is ready:
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:
Needed sort time for each table with 200000 records in each tableHit a key when the NEXT sort below is ready:
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?It tells me the following:
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 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:
Needed sort time for each table with 200000 records in each tableHit a key when the NEXT sort below is ready:
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:
Needed sort time for each table with 200000 records in each tableHit a key when the NEXT sort below is ready:
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
Hi,Jos
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)
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.
JosAlbert
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.
JosAlbert
--
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 -
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.
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:What happens if you (accidentally) specify tables that are actually the same? Like,
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.
'sort db1 on column 1; sort db2 on column 2; sort db2 on column 3;
sort db1 on column 4; ' ?
-marcel
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 300 |
Nodes: | 16 (2 / 14) |
Uptime: | 53:57:39 |
Calls: | 6,712 |
Files: | 12,243 |
Messages: | 5,355,274 |