News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Console and UI version of bi direction sbsort.

Started by hutch--, January 05, 2015, 01:53:21 PM

Previous topic - Next topic

hutch--

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

ragdog

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.

hutch--

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.

ragdog

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

hutch--

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.

ragdog

Good Info Hutch  :t

But by your 3 way sort test is it other ?


hutch--


dedndave


hutch--