Search found 210 matches

by Juergen Kuehlwein
Aug 17, 2019 14:44
Forum: Documentation
Topic: Array Descriptor (split from Wiki Improvements)
Replies: 121
Views: 5945

Re: Array Descriptor (split from Wiki Improvements)

What´s wrong with a signal handler? There is a very small chance of running into invalid memory, so why not catch and handle this situation instead of letting the app randomly crash? JK PS: if you choose to add a "flags" field and thus break binary compatibility, please add one ore more &q...
by Juergen Kuehlwein
Aug 17, 2019 14:31
Forum: Tips and Tricks
Topic: StringArray Sort (case independent)
Replies: 87
Views: 7689

Re: StringArray Sort (case independent)

It´s just for testing, this is NOT in any way official. Therefore i recommended to make backup copies of the existing binaries in order to be able to restore it afterwards! 64 bit has a different data alignment than 32 bit, this is what i´m struggling with currently. There will be a working 64 bit v...
by Juergen Kuehlwein
Aug 17, 2019 12:16
Forum: Tips and Tricks
Topic: StringArray Sort (case independent)
Replies: 87
Views: 7689

Re: StringArray Sort (case independent)

Ok - i see the problem now! 1.) Please use always the latest version (i just uploaded a new one). 2.) I ran exhaustive tests on 32 bit (at least i hope so), there are still some problems with 64 bit code (e.g accessing passed z/wstring arrays in 64 bit still causes a GPF). So please compile for 32 b...
by Juergen Kuehlwein
Aug 17, 2019 10:01
Forum: Community Discussion
Topic: New array features
Replies: 130
Views: 12304

Re: New array features

Array(scan, ...) is optimized now for speed. For running tests you will need "array.bi" and ustring.bi" from the "new" folder!


JK
by Juergen Kuehlwein
Aug 16, 2019 16:37
Forum: Tips and Tricks
Topic: StringArray Sort (case independent)
Replies: 87
Views: 7689

Re: StringArray Sort (case independent)

After exchanging the executables and libraries (fbc.exe, fbrt0.o, libfb.a and libfbmt.a, 32 and/or 64 bit !) you need "array.bi" and "ustring.bi" from the same directory ("new"), then it should work. At least for me it does (i use a batch file for copying back and forth...
by Juergen Kuehlwein
Aug 15, 2019 13:20
Forum: Tips and Tricks
Topic: StringArray Sort (case independent)
Replies: 87
Views: 7689

Re: StringArray Sort (case independent)

What i find remarkable is, that C code wins over Assembler code!

Whenever there was need for speed, i coded a function as a special Assembler version and most of times the speed gain was impressive (~ 30 timer faster). I´m impressed by the work of the the C compiler.


JK
by Juergen Kuehlwein
Aug 15, 2019 10:46
Forum: Tips and Tricks
Topic: StringArray Sort (case independent)
Replies: 87
Views: 7689

Re: StringArray Sort (case independent)

This is what i get dropping RandSheet.tab 811 bytes for MbQSortP2 Testing MbQSortP2 with D:\Users\Administrator\Desktop\test\jj2007\RandSheet.tab (built with UAsm64) Recall qsMaxCol 8 -- QSortDesc: ---- vvv 1 vvv ---------------------------------------------------------------------------------------...
by Juergen Kuehlwein
Aug 14, 2019 12:37
Forum: Tips and Tricks
Topic: StringArray Sort (case independent)
Replies: 87
Views: 7689

Re: StringArray Sort (case independent)

... back home again.

As promised i pushed my latest (still not yet finished) version. You will find all necessary information here (https://www.freebasic.net/forum/viewtopic.php?f=17&t=27606&p=263300#p263300)


JK
by Juergen Kuehlwein
Aug 14, 2019 12:33
Forum: Community Discussion
Topic: New array features
Replies: 130
Views: 12304

Re: New array features

I just pushed my latest version to the repository, as usual you will find it here The syntax for the array features is now as follows: '*********************************************************************************************** ' array(sort, array) ' array(sort, array, down [, (i1 [, i2 [, ...]]...
by Juergen Kuehlwein
Aug 12, 2019 7:27
Forum: Tips and Tricks
Topic: StringArray Sort (case independent)
Replies: 87
Views: 7689

Re: StringArray Sort (case independent)

My laptop´s CPU is: Intel Pentium 4417U, 2.3 GHz 2 Cores. But knowing the CPU, doesn´t mean you can now compare speed. What makes sense to me is running different code on the same machine under the same conditions and then comparing speeds. Running dodicat´s code (preceding post) i get on my (not ve...
by Juergen Kuehlwein
Aug 10, 2019 22:21
Forum: Tips and Tricks
Topic: StringArray Sort (case independent)
Replies: 87
Views: 7689

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 ...


JK
by Juergen Kuehlwein
Aug 09, 2019 14:21
Forum: Documentation
Topic: Array Descriptor (split from Wiki Improvements)
Replies: 121
Views: 5945

Re: Array Descriptor (split from Wiki Improvements)

In my new array features, i solved this problem by adding room for one more dimension each time an array is created (fixed size or dynamic). This extra dimension has a size of three integers. I use the first two integers for an identifier ("arrayext") and the last one is used for new flags...
by Juergen Kuehlwein
Aug 07, 2019 11:31
Forum: Tips and Tricks
Topic: StringArray Sort (case independent)
Replies: 87
Views: 7689

Re: StringArray Sort (case independent)

Do you have a complete example, with array generation etc? My C is a bit rusty. Yes, but it´s mixed code: dodicat´s code for a DOS sort (this thread), and code of my array project (FB + C for the RTL). The actual sort is done as a quicksort in C. I cannot commit and push currently, because i´m on a...
by Juergen Kuehlwein
Aug 06, 2019 7:30
Forum: Tips and Tricks
Topic: StringArray Sort (case independent)
Replies: 87
Views: 7689

Re: StringArray Sort (case independent)

The posted code is in C and it´s not yet pushed to the github repositiory. I replaced the comparison function i had with these two in the RTL. The quicksort in the RTL uses a separate comparison function for each variable type and i used this code for strings. For a case independent compare you must...
by Juergen Kuehlwein
Aug 05, 2019 15:46
Forum: Tips and Tricks
Topic: StringArray Sort (case independent)
Replies: 87
Views: 7689

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) static unsigned char low1[256] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 4...

Go to advanced search