Need help! Can't solve the problem, I'm hitting hardware limitations - page 18

 

Test script and execution results.

HDD:

2014.08.22 21:16:43.584 sTest_ReadWriteBIN EURUSD,M1: 100000 secuences writed in 39.8 sec
2014.08.22 21:17:24.174 sTest_ReadWriteBIN EURUSD,M1: 4156 Mb loaded in 40.0 sec (103.9 MB/sec)

RAM drive:

2014.08.22 21:22:15.170 sTest_ReadWriteBIN EURUSD,H1: 100000 secuences writedown in 27.6 sec
2014.08.22 21:22:42.805 sTest_ReadWriteBIN EURUSD,H1: 4158 Mb loaded in 27.6 sec(150.4 MB/sec)

Still not impressive. True, the test conditions aren't exactly clean right now, with a lot of stuff running on the computer.

I'll do it again later.

Files:
 
komposter:
I suspect that you can swap the read for the WinAPI analogue and get a speed increase of at least 2-3 times for the RAM disk
 
komposter:

TheXpert:
By the way, if you know the starting point of each sequence, you can search for the desired dates with a binary search, as the trades are ordered by time.

+1, thanks for the idea.

You could also apply interpolation search, which would probably work even faster in this task.
 
TheXpert:
I suspect you'll substitute reading with WinAPI analogue and get speed gain of at least 2-3 times for RAM disk

Only FileOpen is supposed to be slow, while reading should be fast. But I'll check.

anonymous:
You can also apply interpolation search, which is likely to be even faster in this task.

Cool, thanks.

 
komposter:
...

Still not impressive.

...

In C++ it's done by fread to 64K-128K buffer, parsing with your own parser is better, because sscanf-types are very slow.
 
kazakov.v:
In C++ this is done by fread to 64K-128K buffer, parsing is better with your own parser, because sscanfs are very slow.

In C++ you can do it without a parser if:

pushing the idea 10 times - start another file with values of start positions of sequences in another file, then you don't even need to store number of transactions in sequence structure.

 
marketeer:
Since the problem is rather academic (looks like a question for hiring a programmer) and many have expressed interest in it, why not formulate it more strictly in terms of format of input data description, and everyone could generate 20 Gigs of test data and submit their practical solution?

+100

The task is non-trivial, but there is not a single line of code yet. Andrey, many people here are interested - formulate the task, offer test data. Let's have a sports programming.

 
C-4:

+100

The task is non-trivial, but there is not a single line of code yet. Andrey, many people here are interested - formulate the task, offer test data. Let's do some sport programming.

The task has already been set.
 
Vinin:
The task has already been set.
Need test data + pseudocode, with general principles of data handling.
 
Why go through the options from the database? Wouldn't it be better to generate deals from history according to the criteria?