Search found 1187 matches

by jj2007
Aug 17, 2019 13:13
Forum: Tips and Tricks
Topic: StringArray Sort (case independent)
Replies: 87
Views: 7614

Re: StringArray Sort (case independent)

4.) You cannot just compile from fbc_34.exe or fbc_64.exe! You must run fbc.exe in it´s regular environment. That is you must first rename fbc.exe, fbrt0.o, libfb.a and libfbmt.a or backup them, where they are located on your machine. Then you must copy fbc_32.exe to fbc.exe, where your original fb...
by jj2007
Aug 17, 2019 10:14
Forum: Community Discussion
Topic: New array features
Replies: 130
Views: 12244

Re: New array features

gcc version 8.1.0 (2018) Juergen\fbc-array\new\ustring.bi(53) error 28: Expected pointer in 'TYPE DWSTR extends wstring' Juergen\fbc-array\new\array.bi(487) error 41: Variable not declared, fb_ArrayCalcPos in 'i = fb_ArrayCalcPos(byval p, byval pptr)' Juergen\fbc-array\new\array.bi(511) error 9: Ex...
by jj2007
Aug 16, 2019 14:55
Forum: Tips and Tricks
Topic: StringArray Sort (case independent)
Replies: 87
Views: 7614

Re: StringArray Sort (case independent)

I found a pointer method for quicksort and adapted it accordingly. Now less than .8 seconds for a million. For case-insensitive strings, that is pretty fast indeed! I have downloaded jK's work and I am trying the binaries, but unfortunately I am encountering snags (cannot find .bi files) Same probl...
by jj2007
Aug 15, 2019 13:44
Forum: Tips and Tricks
Topic: StringArray Sort (case independent)
Replies: 87
Views: 7614

Re: StringArray Sort (case independent)

Juergen, it's difficult to compare them. As explained above, QSort() is a stable mergesort, not a quicksort (despite of the name). But I agree that C compilers have improved a lot, sometimes there is no difference at all between C and assembly. Still, we normally beat the CRT ;-) jj2007 Your .exe we...
by jj2007
Aug 15, 2019 12:38
Forum: Tips and Tricks
Topic: StringArray Sort (case independent)
Replies: 87
Views: 7614

Re: StringArray Sort (case independent)

0.636 seconds is impressive, compliments! To see my results properly, it is maybe necessary to enlarge the console window; and they should be in code tags, too. In any case, I can't get near your time. The first run is around 1.8 seconds, the second one 0.8 - and that one is biased because the array...
by jj2007
Aug 15, 2019 0:12
Forum: Tips and Tricks
Topic: StringArray Sort (case independent)
Replies: 87
Views: 7614

Re: StringArray Sort (case independent)

For the fans of benchmarking sort algos, I put some test files here . The archive is 84MB and contains one exe plus source code using QSort() , plus three text files RandSheet*.tab with 10,000, 100k and 1M lines of random text. The text files are in tab-delimited format and contain several columns. ...
by jj2007
Aug 12, 2019 9:59
Forum: Tips and Tricks
Topic: StringArray Sort (case independent)
Replies: 87
Views: 7614

Re: StringArray Sort (case independent)

I took the liberty to "optimise" dodicat's code of Aug 11, 2019 15:31 (three posts above) by adding a switch that loads the string array from disk. The creation part is very slow, therefore it is convenient to create it once, then recall it from disk to speed up the testing: #include "...
by jj2007
Aug 11, 2019 2:18
Forum: Tips and Tricks
Topic: StringArray Sort (case independent)
Replies: 87
Views: 7614

Re: StringArray Sort (case independent)

@dodicat, i fixed the error i had i my sorting algo in the meantime. Our results are the same now (case independent). My laptop is not the fastest, i get 0.9 seconds here (i got 0.6 at home) for one million strings using basically your code with my sort. I still see room for optimization .. Not muc...
by jj2007
Aug 07, 2019 12:28
Forum: Tips and Tricks
Topic: StringArray Sort (case independent)
Replies: 87
Views: 7614

Re: StringArray Sort (case independent)

Thanks, Juergen - und schönen Urlaub ;-)
by jj2007
Aug 06, 2019 10:11
Forum: Tips and Tricks
Topic: StringArray Sort (case independent)
Replies: 87
Views: 7614

Re: StringArray Sort (case independent)

Sounds clever, will test it asap! I can't believe that I didn't notice it was C... ;-)

Do you have a complete example, with array generation etc? My C is a bit rusty.
by jj2007
Aug 05, 2019 21:55
Forum: Tips and Tricks
Topic: StringArray Sort (case independent)
Replies: 87
Views: 7614

Re: StringArray Sort (case independent)

I can´t believe it! Using a dedicated comparison function i can get it down to 0.6 seconds (CASE INSENSITIVE Loads of errors - is something missing? \FreeBasic\tmp\TmpFb.bas(2) error 4: Duplicated definition, found 'unsigned' \FreeBasic\tmp\TmpFb.bas(3) error 145: Only valid in -lang deprecated or ...
by jj2007
Aug 05, 2019 12:34
Forum: Tips and Tricks
Topic: StringArray Sort (case independent)
Replies: 87
Views: 7614

Re: StringArray Sort (case independent)

There is indeed quite a difference between case-insensitive and case-sensitive sorting, more than a factor 2: Intel(R) Core(TM) i5-2450M CPU @ 2.50GHz sorting 1000000 lines case-insensitive took 1441 ms AAaAHZybMJfIBMDPTlGpjvUIKUAUarYYBhwoQzXDbBiAcpCJBdWibuPGKXCeSrAcOsQVouKGLUtXF aAABoYraUmtdbUjgRDb...
by jj2007
Aug 05, 2019 1:14
Forum: Tips and Tricks
Topic: StringArray Sort (case independent)
Replies: 87
Views: 7614

Re: StringArray Sort (case independent)

Example of DOS sort for a million lines of a mixed bag of text characters 60 to 90 digits long. I get a weird error: "'SORT' is not recognized as an internal or external command, operable program or batch file." It definitely exists, as a simple SORT from a DOS prompt shows. Having worked...
by jj2007
Aug 02, 2019 21:58
Forum: Tips and Tricks
Topic: StringArray Sort (case independent)
Replies: 87
Views: 7614

Re: StringArray Sort (case independent)

I did some speed tests. The dos sort was by far the fastest (3.2 seconds for one million shortish strings) Standard Quicksort was about eight seconds. The C runtime was about ten seconds. Timings for a one million strings array with a total of 10MB: Intel(R) Core(TM) i5-2450M CPU @ 2.50GHz 0.57 sec...
by jj2007
Aug 02, 2019 16:48
Forum: Tips and Tricks
Topic: StringArray Sort (case independent)
Replies: 87
Views: 7614

Re: StringArray Sort (case independent)

dodicat wrote:one million shortish strings
Average length, random, ...?

Go to advanced search