Re: cut and efficiency
- From: Bart Demoen <bmd@xxxxxxxxxxxxxxxxx>
- Date: Thu, 07 Dec 2006 11:57:55 +0100
Advait wrote:
hello prologers
I have few questions
1. Does 'cut' ( '!' ) increases efficiency of code ?
2. Does it reduces memory usage of code?
Plz let me know the fact
(1) sometimes
(2) sometimes
If cut cuts away an alternative that the compiler hasn't eliminated
at compile time, the program uses less memory and doesn't backtrack
unnecesseraly - gain in time and space. It also has a positive effect
on garbage collection (less live data, smaller root set)
If cut does not cut away an alternative (because there wasn't one,
or because the compiler has eliminated it at compile time), and if
the compiler has not eliminated the cut, then you loose time, and
possibly a little space - depending on the implementation of cut.
Cheers
Bart Demoen
.
- Follow-Ups:
- Re: cut and efficiency
- From: Advait
- Re: cut and efficiency
- References:
- cut and efficiency
- From: Advait
- cut and efficiency
- Prev by Date: cut and efficiency
- Next by Date: difference lists ad CLP(FD) exercises
- Previous by thread: cut and efficiency
- Next by thread: Re: cut and efficiency
- Index(es):
Relevant Pages
|
|