Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion What's more efficient? Strings or symbols?

Received: by 10.180.105.2 with SMTP id gi2mr904620wib.4.1348177774141;
        Thu, 20 Sep 2012 14:49:34 -0700 (PDT)
Path: q11ni1789739wiw.1!nntp.google.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: "Pascal J. Bourguignon" <p...@informatimago.com>
Newsgroups: comp.lang.lisp
Subject: Re: What's more efficient? Strings or symbols?
Date: Thu, 20 Sep 2012 23:49:32 +0200
Organization: Informatimago
Lines: 22
Message-ID: <871uhwe55f.fsf@kuiper.lan.informatimago.com>
References: <7b44215a-7abd-4ac2-819a-8a19970d7c45@googlegroups.com>
	<20120920135027.698@kylheku.com>
Mime-Version: 1.0
X-Trace: individual.net xcYKlim5WCZ4MGvDii5bIwqYogy3sOzrf0VVbHSJcm+z9ALvvhg8tWGZjGEbbOfLA3
Cancel-Lock: sha1:MThhMDMyMmE3NmVjNjBmOTk5MGY2ODBlYzcxNmY3NGJhNDJkMzlmNw== sha1:xuPc4CHoiLj0a5jFuWGgFWGtZL0=
Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAQMAAABtzGvEAAAABlBMVEUAAAD///+l2Z/dAAAA
      oElEQVR4nK3OsRHCMAwF0O8YQufUNIQRGIAja9CxSA55AxZgFO4coMgYrEDDQZWPIlNAjwq9
      033pbOBPtbXuB6PKNBn5gZkhGa86Z4x2wE67O+06WxGD/HCOGR0deY3f9Ijwwt7rNGNf6Oac
      l/GuZTF1wFGKiYYHKSFAkjIo1b6sCYS1sVmFhhhahKQssRjRT90ITWUk6vvK3RsPGs+M1RuR
      mV+hO/VvFAAAAABJRU5ErkJggg==
X-Accept-Language: fr, es, en
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux)
Content-Type: text/plain; charset=us-ascii

Kaz Kylheku <k...@kylheku.com> writes:

> When reading data from files and turning it into symbols, it's best to do
> the interning in a package which is instantiated for that purpose, rather
> than polluting CL-USER or some other package that is used for your code.
>
> When you no longer need a symbol, you can use the UNINTERN function to kick it
> out of the package. If you then also drop all other references to the symbol,
> then it becomes garbage.

Or just delete the package.


> (You have the same issue with strings anyway because you're putting them into
> hash tables. A string also won't be GC'd until you remove it from all the
> hashes, or drop your references to the hashes themselves.)

Or just drop the references to the hash-table.

-- 
__Pascal Bourguignon__                     http://www.informatimago.com/
A bad day in () is better than a good day in {}.