Nicolas, > Yes, large Array hash has severe performance penalty anyway. > Maybe we shall not hash each and every element. >
I disagree. The issue is that if hashing a very large array (or string) becomes a performance problem, then we should engineer applications so that we hash the metadata as opposed to the data. In other words, assume you're hashing arbitrary 1kb strings. You can't have more than ~1 million of those in memory at any given time, and there are only so many you can store in a database. Chances are those 1kb strings represent chunks of data that can be uniquely identified with no more than e.g.: 64 bits. Then, just hash those 64 bits and be done with it. In the absence of assumptions on the hashed data, though, you have no option other than to hash everything. > And, even forgetting about equality with Array, Inteval>>#= and > Interval>>#hash do not agree in Squeak and Pharo: > > (1 to: 10 by: 5) = (1 to: 9 by: 5). -> true > (1 to: 10 by: 5) hash = (1 to: 9 by: 5) hash. -> false > > Sometimes the end points of intervals are important... maybe it's better to have equality fail than "fixing" hash in this case. Andres. _______________________________________________ Pharo-project mailing list [email protected] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
