Click here to Skip to main content
15,915,093 members
Home / Discussions / Algorithms
   

Algorithms

 
GeneralRe: Threading problem Pin
Anthony Mushrow15-Feb-11 8:21
professionalAnthony Mushrow15-Feb-11 8:21 
GeneralRe: Threading problem Pin
Luc Pattyn15-Feb-11 8:57
sitebuilderLuc Pattyn15-Feb-11 8:57 
GeneralRe: Threading problem Pin
JesperMadsen12321-Feb-11 10:09
JesperMadsen12321-Feb-11 10:09 
AnswerRe: Threading problem Pin
Luc Pattyn15-Feb-11 7:57
sitebuilderLuc Pattyn15-Feb-11 7:57 
GeneralRe: Threading problem Pin
Anthony Mushrow15-Feb-11 8:10
professionalAnthony Mushrow15-Feb-11 8:10 
QuestionMerging sorted data blocks. Pin
Member 419459313-Feb-11 16:59
Member 419459313-Feb-11 16:59 
AnswerRe: Merging sorted data blocks. Pin
Luc Pattyn14-Feb-11 1:15
sitebuilderLuc Pattyn14-Feb-11 1:15 
AnswerRe: Merging sorted data blocks. Pin
Member 419459314-Feb-11 4:00
Member 419459314-Feb-11 4:00 
Luc,

I'm sorry to give you a 1 for your answer, but I disagree with all of your points. I got into this because I was sorting such a list using Windows sort.exe and was disappointed with the performance. I had a file that I wanted to sort and it was a text file. I do not believe that a general purpose database can out-perform a tailored sort process, and you would have all of the database overhead in addition to the data itself to write and move around. The following are the timings from my testing thus far:

The current time is: 10:44:34.51

 \restart18\debug>if exist c:\longdups.txt sort.exe /REC 65535 c:\longdups.txt /O c:\winlong.txt

The current time is: 11:07:44.81
The current time is: 10:44:34.51
                      ----------
                      0:23:10.30    =   1,390,300 msec

The current time is: 10:24:20.18

 \restart19\debug>if exist c:\longdups.txt ..\sortit.exe c:\longdups.txt c:\mylong.txt

The current time is: 10:30:14.76
The current time is: 10:24:20.18
                      ----------
                     00:05:54.58    =   354,580 msec, (354 580*100)/1,390,300 = 25.50%

--------------------------------------------------------------------------------

The current time is: 17:20:45.57

 \restart18\debug>if exist c:\textseq1.txt sort.exe c:\textseq1.txt /O c:\winshort.txt

The current time is: 18:10:40.32
The current time is: 17:20:45.57
                     -----------
                     00:49:54.75    =   2,994,750 msec.

The current time is: 11:10:25.21

 \restart19\debug>if exist c:\textseq1.txt ..\sortit.exe c:\textseq1.txt c:\myshort.txt

The current time is: 11:19:27.01
The current time is: 11:10:25.21
                     -----------
                     00:09:01.80    =   541,800 msec, (541,800*100)/2,994,750 = 18.09%

--------------------------------------------------------------------------------

The current time is: 13:35:56.95

 \restart18\debug>if exist c:\textdseq.txt sort.exe c:\textdseq.txt /O c:\wdshort.txt

The current time is: 14:22:32.76
The current time is: 13:35:56.95
                     -----------
                     00:46:35.81    =   2,795,810 msec.

The current time is: 12:13:07.90

 \restart19\debug>if exist c:\textdseq.txt ..\sortit.exe c:\textdseq.txt c:\mdshort.txt

The current time is: 12:26:48.50
The current time is: 12:13:07.90
                     -----------
                     00:13:40.60    =   820,600 msec, (820,600*100)/2,795,810 = 29.35%

--------------------------------------------------------------------------------

The current time is: 19:23:06.04

 \restart18\debug>if exist c:\textuseq.txt sort.exe c:\textuseq.txt /O c:\wushort.txt

The current time is: 20:37:44.10
The current time is: 19:23:06.04
                     -----------
                     01:14:38.06    =   4,478,060 msec

The current time is: 14:30:05.59

 \restart19\debug>if exist c:\textuseq.txt ..\sortit.exe c:\textuseq.txt c:\mushort.txt

The current time is: 15:09:04.34
The current time is: 14:30:05.59
                     -----------
                     00:38:58.75    =   2,338,750 msec, (2,338,750*100)/4,478,060 = 52.23%
                     -----------
                      (not complete - need merge)

--------------------------------------------------------------------------------

The current time is:  8:34:48.34

 \restart15\debug>if exist c:\longuniq.txt sort.exe c:\longuniq.txt /O c:\wulong.txt

The current time is:  9:00:27.12
The current time is:  8:34:48.34
                      ----------
                      0:25:38.78    =   1,538,780 msec.

The current time is: 20:37:07.09

 \restart19\debug>if exist c:\longuniq.txt ..\sortit.exe c:\longuniq.txt c:\mulong.txt

The current time is: 20:54:34.73
The current time is: 20:37:07.09
                     -----------
                     00:17:27.62    =   1,047,620 msec, (1,047,620*100)/1,538,780 = 68.08%
                      (not complete - need merge)


Sill looking for any other hints about ways to do this efficiently.

Dave.
GeneralRe: Merging sorted data blocks. Pin
Stefan_Lang14-Feb-11 23:25
Stefan_Lang14-Feb-11 23:25 
GeneralRe: Merging sorted data blocks. Pin
Member 419459315-Feb-11 4:41
Member 419459315-Feb-11 4:41 
GeneralRe: Merging sorted data blocks. Pin
Stefan_Lang15-Feb-11 5:31
Stefan_Lang15-Feb-11 5:31 
GeneralRe: Merging sorted data blocks. Pin
Member 419459315-Feb-11 7:30
Member 419459315-Feb-11 7:30 
AnswerRe: Merging sorted data blocks. Pin
dasblinkenlight14-Feb-11 22:29
dasblinkenlight14-Feb-11 22:29 
GeneralRe: Merging sorted data blocks. Pin
Member 419459315-Feb-11 4:47
Member 419459315-Feb-11 4:47 
QuestionRe: Merging sorted data blocks. Pin
musefan15-Feb-11 6:22
musefan15-Feb-11 6:22 
AnswerRe: Merging sorted data blocks. Pin
Member 419459315-Feb-11 7:02
Member 419459315-Feb-11 7:02 
AnswerRe: Merging sorted data blocks. Pin
Eddy Vluggen17-Feb-11 7:47
professionalEddy Vluggen17-Feb-11 7:47 
GeneralRe: Merging sorted data blocks. Pin
Member 419459317-Feb-11 15:16
Member 419459317-Feb-11 15:16 
GeneralRe: Merging sorted data blocks. Pin
Eddy Vluggen18-Feb-11 11:29
professionalEddy Vluggen18-Feb-11 11:29 
GeneralRe: Merging sorted data blocks. Pin
Member 419459319-Feb-11 16:15
Member 419459319-Feb-11 16:15 
GeneralRe: Merging sorted data blocks. Pin
Eddy Vluggen20-Feb-11 1:29
professionalEddy Vluggen20-Feb-11 1:29 
GeneralRe: Merging sorted data blocks. Pin
Member 419459322-Feb-11 12:11
Member 419459322-Feb-11 12:11 
QuestionIn what mathematical/programming tasks are used sparse graphs? Pin
Marsellos5-Feb-11 3:06
Marsellos5-Feb-11 3:06 
AnswerRe: In what mathematical/programming tasks are used sparse graphs? Pin
Alan Balkany7-Feb-11 4:35
Alan Balkany7-Feb-11 4:35 
AnswerRe: In what mathematical/programming tasks are used sparse graphs? Pin
dasblinkenlight7-Feb-11 6:30
dasblinkenlight7-Feb-11 6:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.