Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - soniaa

Pages: [1] 2
1
QB64 Discussion / Re: DIM a (Max Index)
« on: October 22, 2018, 05:14:51 pm »

- - - - My Problem Is Solved. - - - - -


I've just finished a test;

I inserted in my program the method:      REDIM rec(9000000000) as _UNSIGNED _BYTE
The results  they were excellent !!!  .....much more expected !!!
The speed reached is enormous, my program has runned in phases where I had never-never-never been able to arrive.
The estimated time for to get to the end   it was  2 to 6  years first,

--- NOW The estimated time for to get to the end  it is  1 or 2 hours !!! ---

2
QB64 Discussion / Re: DIM a (Max Index)
« on: October 22, 2018, 03:51:42 pm »
Thank you so much,,,  to all of you !!!

What seemed to me a good way (open c.dat for binary);
I found out to be not good,
when the records stored in this file they become 1 billion, GET e PUT it slows down a lot,
...probably because this method does not use much RAM.

3
QB64 Discussion / Re: DIM a (Max Index)
« on: October 22, 2018, 03:32:03 pm »
I have Upgraded the RAM in my Pc;
(old; at the start of this post: 6 GB)
(old; at the middle of this post: 8 GB)
NOW: 12 GB

4
QB64 Discussion / Re: DIM a (Max Index)
« on: October 18, 2018, 07:11:31 pm »
I repeat;
The number I want stored for compare are in the range 0  to 33bit.
No all number in the range the program create, only approximately 20 -30 %.
The program create these number billion of time.
Every when a program create an number I have to know if that number is already processed, then store how many times.
thats is all,
no other.

I think the solutions OPEN c.dat for binary is for the moment the best I try.
If you have other solution muck speed write to me.

5
QB64 Discussion / Re: DIM a (Max Index)
« on: October 18, 2018, 03:48:46 pm »
SMcNeill;
the IF is necessary fom my because;
 - if GET acquisition >1  THEN  put value +1   AND  goto  inaditection
 - else   PUT  value  1  AND  goto otherdirection

The IF action is independent of the GET/ PUT action.

Get #1, number, TimesProcessed
TimesProcessed = TimesProcessed + 1
Put #1, number, TimesProcessed
IF TimesProcessed = 1 THEN GOTO inaditection ELSE GOTO otherdirection


****what you wrote  is exactly the same as what I wrote !!??...
...or no?

6
QB64 Discussion / Re: DIM a (Max Index)
« on: October 18, 2018, 02:58:20 pm »
The numbers generated by the array   q1   q2  .... q31    they can be  stored together in an singe  registry,
but in some way they must be associated with  howmanytimesalreadyprocessed (range 1 - 255 )

the registry  it must not have  references  of  the  number  has arrived by q1 or q2...

7
QB64 Discussion / Re: DIM a (Max Index)
« on: October 18, 2018, 02:41:28 pm »
Thanks for all reply;
I do not care about ordering the numbers.

in reply to;

SMcNeill;
the IF is necessary fom my because;
 - if GET acquisition >1  THEN  put value +1   AND  goto  inaditection
 - else   PUT  value  1  AND  goto otherdirection

 TempodiBasic;
3.1 -  its max 255
3.2 -  it is not necessary
4.1 -  I have write a program in mode for no use q(1) because using this have lowww performance,  q1 is moooore fasttt
4.2 -  the program loop in 31 step  forward and back billions of times  (brute force)
5.0 -  ?????

8
QB64 Discussion / Re: DIM a (Max Index)
« on: October 18, 2018, 12:43:01 pm »
the strategies I tried are the following:

strategy1;
create file.txt  for any number that the program create
into this .txt file write howmanytimesthisnumberalreadyprocessed
To do this I do;
 - IF _FILEEXISTS  (if 0 is an new number , if -1 no new number)
 - OPEN FOR APPEND  (if no exist this procedure create the file)
 - WRITE  1  (append new line in .txt file contain "1"   -  it can also be good in this way)
 - CLOSE

strategy2;
DIM Array(1 to 8589934590) AS _UNSIGNED _BYTE
 - IF Array(mynuber) = 0  THEN  GOTO ......
 - IF Array(mynuber) = >0  THEN  Array(mynuber)  =  Array(mynuber)  +1

strategy3;
OPEN "c.dat" FOR BINARY AS #1
GET #1  ,   mynumber  ,   howmanytimesthisnumberalreadyprocessed

 - IF   howmanytimesthisnumberalreadyprocessed  >  0  THEN     PUT #1  ,  mynumber  ,  howmanytimesthisnumberalreadyprocessed  + 1 :GOTO...

 - PUT #1  ,  mynumber  ,  1

9
QB64 Discussion / Re: DIM a (Max Index)
« on: October 18, 2018, 11:57:10 am »
The numbers I have,
is in thes style;

ARRAY     ( DIMensioned  _INTEGER64 )       -         (NO strigs)  message modificated
q1
q2
q3
....
last is q31

NO q(1) etccc

The value in those ARRAY  are in the range (1 - 8.589.934.590)

In the program these numbers they arrive not in sequence !!!  ....and I do not need to sort.

Every time in the moment I have acquire a number, I need to know if that number has already been processed;
q1 .... q31
 - IF Already processed  THEN  howmanytimesthisnumberalreadyprocessed = howmanytimesthisnumberalreadyprocessed +1
   (howmanytimesthisnumberalreadyprocessed  is in the range  0 - 255  (_UNSIGNED _BYTE)

 - IF NO Already processed  THEN  record this because is an new number
   (IF NO Already processed in this case to increase speed, it is not necessary also assign 1 at howmanytimesthisnumberalreadyprocessed)


10
QB64 Discussion / Re: DIM a (Max Index)
« on: October 17, 2018, 07:30:16 pm »
If you know only 20% will be different AND they are relatively random, 1.6 billion 20% of 8 billion. if it's 32-bit values, makes a shade over 6 billion bytes. Really, with a bit of squeezing in a b-tree, you might be able to squeeze that out quickly. TreeSort and use no disk for the sort. Also a HashTable can do the job. or even CountingSort. I'd recommend HashTable as the fastest way for random sets. Even ordered sets, but then why would you ask? But I digress. HashTables provide a fast, convenient way to search for things and correctly constructed, yield an average access of 1.25 seeks/find (or not) and very nearly  0(1) insertion. That too is another doable approach. If you cannot spare space for that and have a brick-wall limit of 6GB, you can run this in segments and mege the results. You could use SteveSort or HashListSort. Both will be pretty quick. HashListSort will even give you a sorted result too.

I,m sorry,,,
I did not understand anything,,,,not a word,,,

11
QB64 Discussion / Re: DIM a (Max Index)
« on: October 17, 2018, 06:13:34 pm »
The numbers I have,
is in thes style;

ARRAY  ( DIMensioned  _INTEGER64 )         -         (NO strigs)  message modificated
q1
q2
q3
....
last is q31

NO q(1) etccc

The value in those ARRAY  are in the range (1 - 8.589.934.590)  ( _INTEGER64 )

12
QB64 Discussion / Re: DIM a (Max Index)
« on: October 17, 2018, 06:03:49 pm »
my question;
in the program I'm making, I estimated that the processing process is 2 years.
I have to adopt more strategies to get the maximum speed.

In some phases of the program, I have numbers in the range (1 to 8.589.934.591) (33bit)
NOT all numbers in the range, ONLY 20%.

I have to check if the number I'm processing has already been processed and how many times.


13
QB64 Discussion / Re: DIM a (Max Index)
« on: October 17, 2018, 05:45:26 pm »
my hardware;
Win 7 64bit
10 GB RAM
SSD 240GB for operating system
SSD 120GB for saving my data
Motherboard sata2  AMDphenomII945  3.00GHz  4processor

14
QB64 Discussion / Re: DIM a (Max Index)
« on: October 17, 2018, 05:40:18 pm »
thank you all,
now I'm testing your suggestions,
then I will let you know which ones are most suitable for my needs.

15
QB64 Discussion / Re: DIM a (Max Index)
« on: October 16, 2018, 07:49:35 am »
I have a goog idea;
Many of my data is value 0
i can no create array for this,
in thes mode the array I want to DIM are approximately 3.000.000.000

Now BIG Problem;
I want put my data into the arrays one by one,
example:
visitornumber1000000000 = 5
visitornumber2000000000 = 7
I do;
DIM a(1000000000 to 1000000000) as _BYTE
a(1000000000) = 5

when I do;
DIM a(2000000000 to 2000000000) as _byte
a(2000000000) = 7
I receive error !!!

I have test this;
REM $DYNAMIC 
DIM a(1000000000 to 1000000000) as _BYTE
a(1000000000) = 5
REDIM _PRESERVE a(2000000000 to 2000000000)
But receive error

HELLPP MEE...
Thanks

Pages: [1] 2