Pivoting string sort:
Spoiler
Simple method:
It uses qsort from maykrosoft, so YEET.FanaticGuru wrote: ↑15 Jan 2019, 18:55A sort truly implemented in AHK is never going to be as fast as a the Sort command which is implemented in C++. The Sort command is probably a Quicksort at its core.
I'm gonna let someone else spoil your fun and tell you what happens when you do that :'(
Let me guess.... It slows down the script?coffee wrote: ↑15 Jan 2019, 23:32It uses qsort from maykrosoft, so YEET.FanaticGuru wrote: ↑15 Jan 2019, 18:55A sort truly implemented in AHK is never going to be as fast as a the Sort command which is implemented in C++. The Sort command is probably a Quicksort at its core.
I'm gonna let someone else spoil your fun and tell you what happens when you do that :'(
I assume the default sort is very good. If it is Qsort by Microsoft then it is used in thousands of programs. I imagine it has been picked over and optimized by many different people.mast4rwang wrote: ↑16 Jan 2019, 15:43But as FG wrote, if it uses c++ sort I guess there is no chance to surpass the default sort ^^
Yeah and share the code so everyone can help optimize itFanaticGuru wrote: ↑17 Jan 2019, 13:41It would be great if someone implimented this option in AHK through some Mcode or a Dll; or some other way to get a multi-dimensional array sort at C++ speed.mast4rwang wrote: ↑16 Jan 2019, 15:43But as FG wrote, if it uses c++ sort I guess there is no chance to surpass the default sort ^^
FG
xd, you are just not accessing direct memory addresses like you would in a compiled language (and maybe google's v8? i know they do some fuckery with hidden classes), i.e you are not going straight to the element, you may have to go over a few, in addition to some prechecks before. You are incurring a lookup (currently implemented as a binary search).
Users browsing this forum: adam86shadow, Chunjee, JKJadan, TAC109 and 276 guests