Logtalk 2.30.7 files.
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1973 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
================================================================
|
||||
Logtalk - Open source object-oriented logic programming language
|
||||
Release 2.30.2
|
||||
Release 2.30.7
|
||||
|
||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||
================================================================
|
||||
|
@@ -1,6 +1,6 @@
|
||||
================================================================
|
||||
Logtalk - Open source object-oriented logic programming language
|
||||
Release 2.30.2
|
||||
Release 2.30.7
|
||||
|
||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||
================================================================
|
||||
@@ -38,6 +38,15 @@ Id = s1 ? ;
|
||||
Goal = object::length([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19],_)
|
||||
Id = s2 ? ;
|
||||
|
||||
Goal = leaf::obj_local
|
||||
Id = c1 ? ;
|
||||
|
||||
Goal = leaf::ctg_direct
|
||||
Id = c2 ? ;
|
||||
|
||||
Goal = leaf::ctg_self
|
||||
Id = c3 ? ;
|
||||
|
||||
Goal = create_object(xpto,[],[],[]),abolish_object(xpto)
|
||||
Id = d1 ? ;
|
||||
|
||||
|
@@ -32,7 +32,7 @@
|
||||
|
||||
% run all benchmarks the default number of times:
|
||||
run :-
|
||||
run(1000000).
|
||||
run(100000).
|
||||
|
||||
% run all benchmark tests N times:
|
||||
run(N) :-
|
||||
@@ -77,8 +77,9 @@
|
||||
{generate_list(20, List)}.
|
||||
|
||||
% some benchmark tests for category predicate calls:
|
||||
benchmark(c1, leaf::ctg_direct).
|
||||
benchmark(c2, leaf::ctg_self).
|
||||
benchmark(c1, leaf::obj_local).
|
||||
benchmark(c2, leaf::ctg_direct).
|
||||
benchmark(c3, leaf::ctg_self).
|
||||
|
||||
% some benchmark tests for dynamic code:
|
||||
benchmark(d1, (create_object(xpto, [], [], []), abolish_object(xpto))).
|
||||
@@ -111,16 +112,22 @@
|
||||
|
||||
do_benchmark(c1, N) :-
|
||||
{my_repeat(N)},
|
||||
leaf::ctg_direct,
|
||||
leaf::obj_local,
|
||||
fail.
|
||||
do_benchmark(c1, _).
|
||||
|
||||
do_benchmark(c2, N) :-
|
||||
{my_repeat(N)},
|
||||
leaf::ctg_self,
|
||||
leaf::ctg_direct,
|
||||
fail.
|
||||
do_benchmark(c2, _).
|
||||
|
||||
do_benchmark(c3, N) :-
|
||||
{my_repeat(N)},
|
||||
leaf::ctg_self,
|
||||
fail.
|
||||
do_benchmark(c3, _).
|
||||
|
||||
do_benchmark(d1, N) :-
|
||||
{my_repeat(N)},
|
||||
create_object(xpto, [], [], []),
|
||||
|
@@ -9,6 +9,16 @@
|
||||
|
||||
:- public(ctg_pred/0).
|
||||
|
||||
ctg_pred.
|
||||
ctg_pred :-
|
||||
{generate_list(20, List)},
|
||||
length(List, _).
|
||||
|
||||
length(List, Length) :-
|
||||
length(List, 0, Length).
|
||||
|
||||
length([], Length, Length).
|
||||
length([_| Tail], Acc, Length) :-
|
||||
Acc2 is Acc + 1,
|
||||
length(Tail, Acc2, Length).
|
||||
|
||||
:- end_category.
|
||||
|
@@ -19,7 +19,6 @@
|
||||
length(Tail, Acc2, Length).
|
||||
|
||||
:- public(ctg_self/0).
|
||||
|
||||
% call an imported category predicate by sending a message to self;
|
||||
% performance will depend on the distance between "self" and "this"
|
||||
% (always uses dynamic binding)
|
||||
@@ -27,12 +26,18 @@
|
||||
::ctg_pred.
|
||||
|
||||
:- public(ctg_direct/0).
|
||||
|
||||
% call an imported category predicate directly by using the :/1 control construct;
|
||||
% (static binding may be used, depending on how the category is compiled)
|
||||
ctg_direct :-
|
||||
:ctg_pred.
|
||||
|
||||
:- public(obj_local/0).
|
||||
% call a local object predicate directly; used for comparing performance with
|
||||
% calls to category predicates using the ::/1 and :/1 control constructs
|
||||
obj_local :-
|
||||
{generate_list(20, List)},
|
||||
length(List, _).
|
||||
|
||||
:- end_object.
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user