2007-06-12 11:39:47 +01:00
|
|
|
================================================================
|
|
|
|
Logtalk - Open source object-oriented logic programming language
|
2007-11-06 01:50:09 +00:00
|
|
|
Release 2.30.7
|
2004-10-25 12:13:58 +01:00
|
|
|
|
2007-01-10 12:46:10 +00:00
|
|
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
2007-06-12 11:39:47 +01:00
|
|
|
================================================================
|
2004-10-25 12:13:58 +01:00
|
|
|
|
|
|
|
|
2007-06-12 11:39:47 +01:00
|
|
|
% start by loading the example by choosing one of the loader files
|
|
|
|
% (you must quit and restart Logtalk for each testing scenario):
|
2004-10-25 12:13:58 +01:00
|
|
|
|
|
|
|
|
2007-06-12 11:39:47 +01:00
|
|
|
% run benchmarks with event support turned on:
|
2004-10-25 12:13:58 +01:00
|
|
|
|
2007-06-12 11:39:47 +01:00
|
|
|
| ?- logtalk_load(benchmarks(loader_events)).
|
2005-04-23 00:57:45 +01:00
|
|
|
...
|
2004-10-25 12:13:58 +01:00
|
|
|
|
|
|
|
|
2007-06-12 11:39:47 +01:00
|
|
|
% run benchmarks with event support turned off:
|
2004-10-25 12:13:58 +01:00
|
|
|
|
2007-06-12 11:39:47 +01:00
|
|
|
| ?- logtalk_load(benchmarks(loader_no_events)).
|
|
|
|
...
|
2004-11-03 00:13:01 +00:00
|
|
|
|
|
|
|
|
2007-06-12 11:39:47 +01:00
|
|
|
% run benchmarks with event support turned off and using static binding:
|
2004-11-03 00:13:01 +00:00
|
|
|
|
2007-06-12 11:39:47 +01:00
|
|
|
| ?- logtalk_load(benchmarks(loader_static_binding)).
|
|
|
|
...
|
2004-11-03 00:13:01 +00:00
|
|
|
|
|
|
|
|
2007-06-12 11:39:47 +01:00
|
|
|
% list all the benchmark tests:
|
2004-11-03 00:13:01 +00:00
|
|
|
|
2007-06-12 11:39:47 +01:00
|
|
|
| ?- benchmarks::benchmark(Id, Goal).
|
2005-03-06 21:19:09 +00:00
|
|
|
|
2007-06-12 11:39:47 +01:00
|
|
|
Goal = my_length([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19],_)
|
|
|
|
Id = s1 ? ;
|
2005-03-06 21:19:09 +00:00
|
|
|
|
2007-06-12 11:39:47 +01:00
|
|
|
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 ? ;
|
2005-03-06 21:19:09 +00:00
|
|
|
|
2007-11-06 01:50:09 +00:00
|
|
|
Goal = leaf::obj_local
|
|
|
|
Id = c1 ? ;
|
|
|
|
|
|
|
|
Goal = leaf::ctg_direct
|
|
|
|
Id = c2 ? ;
|
|
|
|
|
|
|
|
Goal = leaf::ctg_self
|
|
|
|
Id = c3 ? ;
|
|
|
|
|
2007-06-12 11:39:47 +01:00
|
|
|
Goal = create_object(xpto,[],[],[]),abolish_object(xpto)
|
|
|
|
Id = d1 ? ;
|
2005-04-23 00:57:45 +01:00
|
|
|
|
2007-06-12 11:39:47 +01:00
|
|
|
Goal = plain_dyndb
|
|
|
|
Id = d2 ? ;
|
2005-03-06 21:19:09 +00:00
|
|
|
|
2007-06-12 11:39:47 +01:00
|
|
|
Goal = database::this_dyndb
|
|
|
|
Id = d3 ? ;
|
2005-03-06 21:19:09 +00:00
|
|
|
|
2007-06-12 11:39:47 +01:00
|
|
|
Goal = database::self_dyndb
|
|
|
|
Id = d4 ? ;
|
2005-03-06 21:19:09 +00:00
|
|
|
|
2007-06-12 11:39:47 +01:00
|
|
|
Goal = database::obj_dyndb
|
|
|
|
Id = d5
|
2005-04-23 00:57:45 +01:00
|
|
|
|
|
|
|
yes
|
2005-03-06 21:19:09 +00:00
|
|
|
|
|
|
|
|
2007-06-12 11:39:47 +01:00
|
|
|
% run all the benchmark tests the default number of times:
|
2005-03-06 21:19:09 +00:00
|
|
|
|
2007-06-12 11:39:47 +01:00
|
|
|
| ?- benchmarks::run.
|
|
|
|
...
|
2005-03-06 21:19:09 +00:00
|
|
|
|
|
|
|
|
2007-06-12 11:39:47 +01:00
|
|
|
% or run specific benchmark tests individually, for example:
|
2005-03-06 21:19:09 +00:00
|
|
|
|
2005-04-23 00:57:45 +01:00
|
|
|
|
2007-06-12 11:39:47 +01:00
|
|
|
| ?- benchmarks::run(s1, 1000000).
|
|
|
|
...
|