Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.postscript > #2034

Re: Sizing a dictionary

From Scott Hemphill <hemphill@hemphills.net>
Newsgroups comp.lang.postscript
Subject Re: Sizing a dictionary
References <c4bee501-d466-4f52-af0f-c37c2023703d@googlegroups.com> <m3bnqvdov6.fsf@hemphills.net> <53192ca2-9439-4cde-9e15-8b81ea651b9c@googlegroups.com> <83270c40-a170-4b50-b149-eca634e7a33b@googlegroups.com>
Date 2014-09-09 13:35 -0400
Message-ID <m3iokw4ryt.fsf@hemphills.net> (permalink)

Show all headers | View raw


jdaw1 <jdawiseman@gmail.com> writes:

> I'm now slightly puzzled. Assume that there are to be eight items in my dictionary. Would 8 dict automatically add enough space to keep the hash tables efficient? If so, 8 dict would be the right thing to do. Or do I have to guess the internal workings of the PS interpreter, and add something to the 8. In which it might be best to redefine dict to something like "{1.25 mul ceiling cvi dict} bind".

Yes, "8 dict" will automatically add enough space to keep the hash table
efficient.  However, "16 dict" would be slightly more time efficient
(collisions would be less likely) while becoming slightly less space
efficient.  For most purposes, it doesn't matter much.

Scott
-- 
Scott Hemphill	hemphill@alumni.caltech.edu
"This isn't flying.  This is falling, with style."  -- Buzz Lightyear

Back to comp.lang.postscript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Sizing a dictionary jdaw1 <jdawiseman@gmail.com> - 2014-09-03 03:57 -0700
  Re: Sizing a dictionary Scott Hemphill <hemphill@hemphills.net> - 2014-09-04 18:04 -0400
    Re: Sizing a dictionary luser- -droog <mijoryx@yahoo.com> - 2014-09-04 16:59 -0700
      Re: Sizing a dictionary jdaw1 <jdawiseman@gmail.com> - 2014-09-06 03:31 -0700
        Re: Sizing a dictionary Scott Hemphill <hemphill@hemphills.net> - 2014-09-09 13:35 -0400
          Re: Sizing a dictionary luser- -droog <mijoryx@yahoo.com> - 2014-09-13 01:11 -0700
            Re: Sizing a dictionary Scott Hemphill <hemphill@hemphills.net> - 2014-09-13 12:04 -0400

csiph-web