On 11/29/2014 02:43 PM, Pouyan Ziafati wrote:
> Dear All,
>
> I am measuring performance of an application for NAO robot involving
> assertion, retraction and look-up of terms. However, I cannot interpret
> the results.
With my poor eyes, interpreting the colours is a bit hard. It is also
unclear what you are really timing. I guess there is more involved than
the feed_memory_instances/1?
By intuition, I would use separate predicates for each `memory instance'
and add at the end if it doesn't matter, so you can retract from the
start for cleanup. So, you can something like this:
memory_instance(tf(X,Y,Z,W), 2500, id1(X,Y,Z,W)).
feed_memory_instances(Data) :-
memory_instance(Data, Size, Clause),
assertz(Clause),
( predicate_property(Clause, number_of_clauses(N),
N > Size
-> functor(Clause, Name, Arity),
functor(Generic, Name, Arity),
once(retract(Generic))
; true
).
This stores less data and allows proper indexed access to your memory
instances.
To get further insight, run the experiment using ?- profile(Goal). I'd
suspect that (lack of) indexing is an issue. A couple of thousends of
new facts per second should really not be a problem.
Cheers --- Jan
> --
> You received this message because you are subscribed to the Google
> Groups "SWI-Prolog" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to
swi-prolog+...@googlegroups.com
> <mailto:
swi-prolog+...@googlegroups.com>.
> Visit this group at
http://groups.google.com/group/swi-prolog.
> For more options, visit
https://groups.google.com/d/optout.