Radix sort, signed Ints, Floats and Strings(Nothing to fill)

Started by Sinjin, May 17, 2023, 23:52:01

Previous topic - Next topic

Sinjin

I have a module that compiles staticarray fine in a field of a method...after all i could use this and do it all in asm, its not about the speed really, i mean any blitz function you take as it is, if you have another array, its just simple now to swap it with a type...in asm you do a whole bunch just to change the type size, but nothing is faster not even machine code..asm is machine code!. Just a reminder, im on blitz 1.50, and i tried NG but when I run the IDE its sais something about openfile2?  i have win 7, maybe its ok in win 10...win 10 i will never install! in fact somtimes i wish to return to win XP! everything works there!  all the newer versions...plus the policy..i mean they are allowed to inspect your drive! just bc its win 10 and further they can choose to manipulate your whole drive system just bc you use ntfs? nope, i dont agree to that, so i still have win 7! even most of the newer games work unless its hitty as the forest 2...sons of...whatever...you dont need 100gb of ram...just bc you see fit to that!  what coding is that? i know its alpha, but i assume in a alpha version the graphics should be fine! make your own game! you need so many graphics, unimagaineable!
Now where I can do radix and A*, nobody is doing free graphics :D
after all in european laws microsoft woulnt be allowed to collect infos in that manner! i could say: click on this link...some exe but i collect your data! since everybody has window...i wonder ppl even read the eula! thay all accept it, no reading needed :D
And yeah you could use code pages as a staticarray haha but such thing irrelevnat in asm, memory is memoty! the stack uses normal memory!

Sinjin

@Midimaster i even provided a string version as well, but yet again i didnt test it extesively and im pretty sure it can be faster :D
and im sure mmx or smd...im not even sure nowadays, i came from dos really, making your own OS like thing....but in real amd (not relying on any compiler) im sure even i could make it so fast! well, i didnt look at brucys code yet...but that in asm...would only work on some machines then.....and if amd and intel not the same, i dont see reason to code asm at all! i just do it anyways bc i came a long way and i still want to use it i some cases. if i could i would do asm all the time...yet i dont even know what invoke means lol  cant be that different of a call!
after all! all your code comes down to machine code! which is not different than asm!
In fact i find it a pity that even in the OS/32 bit memory is protected....so whatever you do!  should be fine!  haha thats why code gets so hitty nowadays "your os should protect you" haha i dont trust the police either  haha
futhermore i walys think about a program that runs backward in memory! yes thats possibel! every byte reversed  lol its big endian isnt it? Midi-protocol does it as well whichh is more than perfect ^^
Back in the days I thought...oh prtected mode, cool i could use that to cut off any pixels that exceeds limits....but that would be so slow! haha i dont even have to test it

Derron

Please use text formatting (not just "..." between your thoughts) and keep the rants short.

Was harder than needed to read your 2 posts and they did not contain much more information rather than "in asm stuff is different "new Windows is not my taste" :-)


OK: and that you got an Issue with NG ("openfile2") I did not experience such an issue: and I am running NG on XP (Micro), 7 (Lite), 10 (Lite) and normal Win10 machines (plus various Linux distros and a Mac VM).
You might have some restrictions in place which disallow eg opening the help file in maxide (on first start it wants to build the docs and afterwards it shows the welcome page).


Regarding Speed and assembler: We got an Blitzmax function and we tried to fix issues / improve performance. So this might not win a speed contest against some fine crafted asm but I guess it is rather quick already in NG (as the generated and then compiled C code gets optimized by the GCC).
If you wrote Brucey's ported function in ASM: why would it not work on all machines (only talking about machines which BlitzMax(NG) supports)? Would not make sense to write stuff in BlitzMax first and thinking about architectures and platforms we do not "reach" (yet and in the foreseeable future).

bye
Ron

Midimaster

We are discussiing your RADIX-code not only for speed reasons or to make you angry. My intention was to offer this algorithm to all BASIC users. The following discussion brought improvements and revealed bug. At the end we have a awesome FLOAT-sorting-algorithm.

Ideas to rise speed with use of more special commands, that leave the universality of BlitzMax are interesting and maybe used, if somebody really needs the highest performance. But your code with 1.000.000 sortings in 30msec is already good enough for 99% of the users here.

Also I was a hard core fan of XP and I used it until 2020. I jumped all future versions and directly went to WIN-10, which for me is now as good as my loved XP. You can tame the beast and restrict its behavior to control/limit you. And then it works like XP. I also upgraded to BlitzMax-NG and now (after some first troubles) I would never go back now. You can have both installed parallel. But I guess there is no direct FASM-Support anymore in NG.

I would like to discuss now your universal RADIX-Sort, which is valid for any bit-length. Is it right? Any bit-length from BYTE upto LONG, also DOUBLE or STRING? I will be a helpful code snipplet for us all here.










...back from Egypt

Sinjin

I found another bug. In INTSORT use "local m%=(arr[a]~$80000000) shr pos&255" instead of "local m%=arr[a] shr pos&255 ~$80". Same mistake I made in floats. im sorry you all felt like i ranted. but i didnt, if so, i mean myself! Im a free thinker and if I dont question myself..i would  be a slave :)
 pls, ty!