The MASM Forum

Projects => MASM32 => Topic started by: hutch-- on January 05, 2015, 01:53:21 PM

Title: Console and UI version of bi direction sbsort.
Post by: hutch-- on January 05, 2015, 01:53:21 PM
These are two finished applications, a console version when you are through playing games and a GUI version that should be about as fast to use as the console version. Both use the identical algorithms for tokenising, sorting and writing to disk. The design of both apps is to handle files well over 1 gigabyte, the final limit is the available memory on the computer up to the addressing limit in Win32. Both apps have been tested on WinXP SP3 and Win 7 64. XP appears to have more limits on allocatable memory that Win7 64.

They are targetted directly at text files that are CR LF delimited and should not be used on any other file format. The tokeniser strips leading blanks from the left side of each line and also removes empty lines. The file save technique involves writing 16 lines at a time to hard disk in a very small LOCAL buffer so that memory usage does not rise on save. The tokeniser uses about 4 times the line count for its pointer array so if you are sorting a file with 1 million lines, you get 4 meg used by the pointer array. A 10 million line file uses 40 meg for the pointer array. Both apps have been tested on files up to 1.5 gig successfully on Win7 64..
Title: Re: Console and UI version of bi direction sbsort.
Post by: ragdog on January 05, 2015, 07:38:18 PM
Hi

Is very nice but can you add an example like Qsort the compare function?


void qsort(
   void *base,
   size_t num,
   size_t width,
   int (__cdecl *compare )(const void *, const void *)  <<<<<<

regards.
Title: Re: Console and UI version of bi direction sbsort.
Post by: hutch-- on January 05, 2015, 08:22:07 PM
This stuff already exists, there are string sorts in the MASM32 library but this one has the legs over all of them. I don't really have the time to code comparison examples for other people, the effective way to test it against others is to target a very big text file, I have been using test files up to 1.5 gig.
Title: Re: Console and UI version of bi direction sbsort.
Post by: ragdog on January 06, 2015, 05:50:58 AM
I use for my app Qsort from crt is very nice

I have testet your new tool but i have not a file up to 1.5 gb
Title: Re: Console and UI version of bi direction sbsort.
Post by: hutch-- on January 06, 2015, 08:52:57 AM
If the CRT Qsort does the job, fine, this one is aimed at speed and for very large source files where a slower sort would take far too long to complete. It is done as a freestanding EXE due to memory limitations, on very large files you run into the 32 bit memory allocation limits, even if the machine can provide a full 2 gig address space. If you are running an app that has large memory usage and try and sort a very large file, you will not have enough memory to allocate the space if it is called from another executable as the data copy will exceed the memory limit.
Title: Re: Console and UI version of bi direction sbsort.
Post by: ragdog on January 06, 2015, 08:56:48 AM
Good Info Hutch  :t

But by your 3 way sort test is it other ?

Title: Re: Console and UI version of bi direction sbsort.
Post by: hutch-- on January 06, 2015, 09:59:19 AM
Sorry, I don't understand the question.
Title: Re: Console and UI version of bi direction sbsort.
Post by: dedndave on January 06, 2015, 04:42:08 PM
i think he wants to know how it's different from

http://masm32.com/board/index.php?topic=3918.0 (http://masm32.com/board/index.php?topic=3918.0)
Title: Re: Console and UI version of bi direction sbsort.
Post by: hutch-- on January 06, 2015, 06:24:25 PM
Thats easy, it pure MASM, not PB.