Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Author
Message
Codger
23
Years of Service
User Offline
Joined: 23rd Nov 2002
Location:
Posted: 1st Oct 2003 17:53
Hi
Does anyone have a QuickSort function coded that they would be willing to post?

If not I will code and post one shortly

Thanks

System
PIII 650 MZ H.P. Pavillion
394 Mem GeForce 4 400MX
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 1st Oct 2003 20:09
There's one on DBDN but I guess that's not really available - I couldn't post a copy of it here unless the coder (GuyS) agreed.

However, I have a plugin that's freely available from my site that allows arrays and ranges in arrays to be sorted fast and safely.

Still, it would be a good addition to Codebase as an example to show how it's done
Codger
23
Years of Service
User Offline
Joined: 23rd Nov 2002
Location:
Posted: 1st Oct 2003 21:11
I made my own it includes a graphic example. Try it out and let me know if improvements can be made. I will then add to code base



System
PIII 650 MZ H.P. Pavillion
394 Mem GeForce 4 400MX
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 1st Oct 2003 21:30
Good stuff

Just drop the attached function into your code in place of your DrawArray function and you'll see a massive speedup when drawing.

Codger
23
Years of Service
User Offline
Joined: 23rd Nov 2002
Location:
Posted: 1st Oct 2003 22:31 Edited at: 1st Oct 2003 22:34
IanM
I had heard about the lock Pixels command but when I tried it the program took exactly the same amount of time, around 15 seconds for an array of 500.

Did you get an improvement in speed?

System
PIII 650 MZ H.P. Pavillion
394 Mem GeForce 4 400MX
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 1st Oct 2003 23:13 Edited at: 1st Oct 2003 23:13
Yep. My laptop is relatively slow ... I got an increase in speed from 18.6 seconds down to 10.4 seconds.

Perhaps the speed increase is due to the age of my laptop (over 2 years old now) because when I ran the programs on my desktop machine I got no difference in speed either ... interestingly, it only ran as fast as my laptop!

The LOCK PIXELS command can speed up POINT, DOT, LINE, CIRCLE and ELLIPSE and drawing/reading directly to the display with the memory access commands.

Other draw commands are not sped up (or could even cause a program crash) because they are hardware accelerated.
Codger
23
Years of Service
User Offline
Joined: 23rd Nov 2002
Location:
Posted: 2nd Oct 2003 00:10 Edited at: 2nd Oct 2003 00:12
Modified the Graphics Portion to only redraw the swapped data



Run Time reduced to 30% remove rem's to see sort take place

System
PIII 650 MZ H.P. Pavillion
394 Mem GeForce 4 400MX

Login to post a reply

Server time is: 2026-07-26 01:00:02
Your offset time is: 2026-07-26 01:00:02