Re: reduced size symbols/keywords



På Fri, 29 Aug 2008 07:39:14 +0200, skrev verec <verec@xxxxxxx>:

Toying, toying ... rather than doing useful work ... (Kenny must be
right after all :-)


As far as I know there is no way to make symbols any smaller.
A more serious problem that the size is that it makes a package a leaky abstraction.
You export a function you automatically export the variable with the same name as well as the plist, class etc.


This question is not (entirely) rhetoric, as I'm thinking of some
application reading 1,000,000s words out of text files and turning them
into symbols/keywords for processing. Cutting down the memory
footprint by half or more would be extremely significant, while still
preserving "most" of the properties of symbols, while sacrifing a few,
ie, while


But not 1,000,000 DIFFERENT words I trust.
With that voulume wouldn't a hash table be a better choice anyhow?
I find that plist's are best for 100 elements or less.


The standard way of dealing with this is to Goedelize it yourself.
Your file reads the words as strings.
They are stored in a hash table and assigned a number.
Each time you see a string look the number up in the hash table. If it is not there generate a new number and store (string - value) there.
This is more compact.

--------------
John Thingstad
.



Relevant Pages

  • Re: How to write a diff in VB6 for comparing two xml files?
    ... No, the best you could do is to read both into string and use StrCompbut it's inefficient and, but using the hash ... Private Declare Function CryptAcquireContext Lib "AdvAPI32.dll" Alias _ ... Dim HashAAs Byte, HashLenA As Long ...
    (microsoft.public.vb.general.discussion)
  • Re: something like switch in c
    ... >> straightforward string comparisions. ... > inner table size and/or add symbols to expand the hash. ... It all depends on the empirical pattern of the actual keys. ... The value of the random number generator is UNCHANGED on ...
    (comp.programming)
  • Re: How to make PKCS#7 signature using CryptoAPI?
    ... Those MSDN samples hash a string PLUS the null byte (so that it ... I tried your sample and had no problem verifying with openssl (after I added ... functions (including CryptSignMessage). ...
    (microsoft.public.platformsdk.security)
  • Re: How to make PKCS#7 signature using CryptoAPI?
    ... "Mitch Gallant" wrote: ... Those MSDN samples hash a string PLUS the null byte (so that it ... functions (including CryptSignMessage). ...
    (microsoft.public.platformsdk.security)
  • Re: Base36
    ... static string tokens = ... But - I don't think you want all those silly characters in the product key. ... I should be able to recalc the hash at the client ... > conversion to long so I can pass each long to the BaseXX converter to get ...
    (microsoft.public.dotnet.languages.csharp)