Logtalk 2.24.0 files.

git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1282 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
pmoura
2005-04-22 23:57:45 +00:00
parent 08efcbeb64
commit c2e03a81b9
195 changed files with 4005 additions and 1219 deletions

View File

@@ -1,6 +1,6 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.23.1
Release 2.24.0
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================
@@ -8,26 +8,20 @@ Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
To load this example and for sample queries, please see the SCRIPT file.
If your Prolog compiler does not support a module system, then edit the
loader.lgt file and comment out the directive that loads the module code.
In case your Prolog compiler supports a module system, you may need to
edit the code on the module.pl file and make any necessary compatibility
changes.
This folder provides simple benchmark tests for comparing Logtalk message
sending performance with direct predicates calls in plain Prolog.
These benchmarks may also be used for comparing Logtalk message sending
performance across Prolog compilers.
This folder provides simple benchmarks for comparing Logtalk message
sending performance with direct calls to Prolog predicates and with
calls to module predicates. These benchmarks may also be used for
comparing Logtalk message sending performance across Prolog compilers.
This example is made of five source files:
This example is made of four source files:
benchmark.pl
benchmark.lgt
contains the benchmark predicates
plain.pl
plain.lgt
contains a definition for a list length predicate and a predicate
for testing performance of the built-in predicates assertz/1 and
retract/1
module.pl
module.pl (not loaded by default; see below)
contains the same definition of a list length predicate
encapsulated in a module
object.lgt
@@ -37,8 +31,30 @@ This example is made of four source files:
contains predicates for testing the performance of the built-in
database methods assertz/1 and retract/1
You may have noticed above that the benchmark predicates and the predicates
for plain Prolog testing are both encapsulated in Logtalk source files. The
Logtalk compiler just copies the plain Prolog code to the generated Prolog
files. The reason for using the .lgt extension for these files is just to
make it possible to load all the example code using a single call to the
logtalk_load/1 predicate.
The Prolog files above are loaded (from the loader.lgt file) by using
ensure_loaded/1 directives. If this directive is not supported on your
Prolog compiler, replace them by calls to the built-in predicate used
by your compiler to load Prolog code.
By default, the benchmark tests on the SCRIPT file use a list of 30 elements
as an argument to the list length predicates. Increasing the list length
leads to decreasing performance differences between plain Prolog and Logtalk
as the list length computation time far outweighs the overhead of the message
sending mechanism. Likewise, decreasing the list length leads to increasing
performance differences between plain Prolog and Logtalk (up to the point you
will be measuring the Logtalk message sending mechanism overhead compared to
plain Prolog predicate calls). In real-life applications, only testing can
give you a balanced view on the trade-offs between plain Prolog performance
and Logtalk programming features.
By default, the loader.lgt file used to load the example code does not load
the module.pl file. Edit this file if your Prolog compiler supports a module
system and you want to run some comparative performance tests between plain
Prolog, Prolog modules, and Logtalk objects. Note that you may need to edit
the code on the module.pl file to make any necessary compatibility changes
for your Prolog compiler module system. For most Prolog module systems, the
performance of module calls is close or even identical to the performance of
plain Prolog calls, specially when using imported predicates as opposed to
using explicit module qualification.