|
From: | Dave Sworin |
Subject: | Small prolog source file, large executable? |
Date: | Mon, 24 Nov 2008 04:14:43 -0800 (PST) |
I have some permanent data in a list of structures
which I use. The list of structures has a few hundred data structures in the list and I noticed that I had to increase my stack sizes to accomodate the new structures I added. The list of structures is defined in a predicate which I call and the list is returned by an argument. I then use the list in some other predicates. The structures are all fully instantiated.When I tried to figure out why the memory usage went up, Ifound that any time I instantiate a list of structures, even simple ones like f(a,1,3), the executable is 100 times larger than the prolog source. So for example, I have a list of structures andone other small 'toy' predicate in an 8k prolog source file andthe executable is 800k. I tried lots of different things but have not been able to reduce the memory usage. Even the very first intermediate file, I think it is the WAM, has many many repeated lines which are very similar but have arguments which are the pieces of the structures. I tried stripping the executable whichdidn't help much either. I tried changing the data structure,using only one kind of structure in the list, using a list of list of structures and so forth, all with basically the same result. The prolog source file and the WAM file from one of my many trials are attached
just for reference. The prolog source attached has about
100 lists of a few structures each. I tried to send the
executable but the mail message failed. I think you can
try this yourself easier than looking at my files.
Dave |
TEST_CASE_HMU.PL.TEXT
Description: Text document
GPLCYWLQUB.WAM.TEXT
Description: Text document
[Prev in Thread] | Current Thread | [Next in Thread] |