Subject: RE: Performance degradation revisited (SWI-Prolog 3.3.0 beta-9)

From: Jan Wielemaker <[email-masked]>
Date: Fri, 7 Jan 2000 17:14:20 +0100

On Fri, 07 Jan 2000, Douglas Miles (Volt Computer) wrote:
>Ah, yes mine was with Wordnet 1.6 as well..
>
>First in 2.2.7/8
>And I had compared the consult times between atoms and lists_of_ascii
>in.. 
>s(100001740,1,'entity',n,1,1).
>s(100001740,2,'something',n,1,0).
>vs.
>s(100001740,1,"entity",n,1,1).
>s(100001740,2,"something",n,1,0).
>The result was the Atom version consulted much quicker then the char_lists
>
>So I adopted Atomic method
>
>now in 3.3.0
>I had continued using the Atom method..
>We should check if we need to go back to the char_list method.
>Since we are creating at least 174,008 Atoms <lol>
>We (Luis and I) probably both fell into the same boat.
>But hrrm what shall we do?
>Reason tells me char_list in that we are actually going to use it against
>ASCII input.
...
>I am going to convert those 5 files from Atoms to char_lists if Jan thinks
>its a good idea

Just fetch BETA-9.  This is a clear bug, as reported in the earlier
mail.  Atoms are the correct representation: they are compact, match
quickly and are cheap on the stacks.

Character-lists are there if you need to look into the atom (at the
quarks :-).  In older Prolog systems they were the way to avoid memory
leaks, but with more and more Prolog systems getting atom garbage
collection this idea is old-fashioned.

Small drawback is that atom garbage collection gets more expensive the
more atoms you have (not too much, it just walks along the array of
pointers to atom structures and checks whether the reference count is
zero/non-zero.  The marking phase is relative to the size of the
local and global stacks.).

Loading wn_s.pl (from Wordnet 1.5) does 12 atom garbage collections in
0.13 seconds (load time 10.85), So there is no real problem.

	Regards --- Jan