Moderator
Staff member
Moderator
- Joined
- Feb 22, 2008
- Messages
- 2,427
- Reaction score
- 757
I managed to decrease the size of both arrays:
SortedDictionary<int,byte[]> builder => from 191k to 130k aprox. (removed null bytes[])
List<byte[]> movPush => 13k (if I recall correctly) (if there is too much repeated numbers, like: 68 00 00 00 01 -> probably not a PUSH Im interested in, so I delete if anyRepetedNumbers >= 2
But it is still too slow.
I am doing this way:
I read that foreach loop is slow compared to for loop, but I am afraid I can't use for in this case, because my Dictionary indexes are not 0,1,2,3,4 but instead, they are the offset where the byte[] (string) was found.
SortedDictionary<int,byte[]> builder => from 191k to 130k aprox. (removed null bytes[])
List<byte[]> movPush => 13k (if I recall correctly) (if there is too much repeated numbers, like: 68 00 00 00 01 -> probably not a PUSH Im interested in, so I delete if anyRepetedNumbers >= 2
But it is still too slow.
I am doing this way:
Code:
foreach element in builder
{
var stringOffset = element.Key;
// now I generate the PUSH code for the given offset and search in the entire movPush List, if it is found, then I add it to my final dictionary.
}
I read that foreach loop is slow compared to for loop, but I am afraid I can't use for in this case, because my Dictionary indexes are not 0,1,2,3,4 but instead, they are the offset where the byte[] (string) was found.

