| 1 | ================================================================ |
|---|
| 2 | Logtalk - Open source object-oriented logic programming language |
|---|
| 3 | Release 2.35.0 |
|---|
| 4 | |
|---|
| 5 | Copyright (c) 1998-2009 Paulo Moura. All Rights Reserved. |
|---|
| 6 | Logtalk is free software. You can redistribute it and/or modify |
|---|
| 7 | it under the terms of the "Artistic License 2.0" as published by |
|---|
| 8 | The Perl Foundation. Consult the "LICENSE.txt" file for details. |
|---|
| 9 | ================================================================ |
|---|
| 10 | |
|---|
| 11 | |
|---|
| 12 | % start by loading the example by choosing one of the loader files |
|---|
| 13 | % (you must quit and restart Logtalk for each testing scenario): |
|---|
| 14 | |
|---|
| 15 | |
|---|
| 16 | % run benchmarks with event support turned on: |
|---|
| 17 | |
|---|
| 18 | | ?- logtalk_load(benchmarks(loader_events)). |
|---|
| 19 | ... |
|---|
| 20 | |
|---|
| 21 | |
|---|
| 22 | % run benchmarks with event support turned off: |
|---|
| 23 | |
|---|
| 24 | | ?- logtalk_load(benchmarks(loader_no_events)). |
|---|
| 25 | ... |
|---|
| 26 | |
|---|
| 27 | |
|---|
| 28 | % run benchmarks with event support turned off and using static binding: |
|---|
| 29 | |
|---|
| 30 | | ?- logtalk_load(benchmarks(loader_static_binding)). |
|---|
| 31 | ... |
|---|
| 32 | |
|---|
| 33 | |
|---|
| 34 | % list all the benchmark tests: |
|---|
| 35 | |
|---|
| 36 | | ?- benchmarks::benchmark(Id, Goal). |
|---|
| 37 | |
|---|
| 38 | Goal = my_length([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19],_) |
|---|
| 39 | Id = s1 ? ; |
|---|
| 40 | |
|---|
| 41 | Goal = object::length([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19],_) |
|---|
| 42 | Id = s2 ? ; |
|---|
| 43 | |
|---|
| 44 | Goal = leaf::obj_local |
|---|
| 45 | Id = c1 ? ; |
|---|
| 46 | |
|---|
| 47 | Goal = leaf::ctg_direct |
|---|
| 48 | Id = c2 ? ; |
|---|
| 49 | |
|---|
| 50 | Goal = leaf::ctg_self |
|---|
| 51 | Id = c3 ? ; |
|---|
| 52 | |
|---|
| 53 | Goal = create_object(xpto,[],[],[]),abolish_object(xpto) |
|---|
| 54 | Id = d1 ? ; |
|---|
| 55 | |
|---|
| 56 | Goal = plain_dyndb |
|---|
| 57 | Id = d2 ? ; |
|---|
| 58 | |
|---|
| 59 | Goal = database::this_dyndb |
|---|
| 60 | Id = d3 ? ; |
|---|
| 61 | |
|---|
| 62 | Goal = database::self_dyndb |
|---|
| 63 | Id = d4 ? ; |
|---|
| 64 | |
|---|
| 65 | Goal = database::obj_dyndb |
|---|
| 66 | Id = d5 |
|---|
| 67 | |
|---|
| 68 | yes |
|---|
| 69 | |
|---|
| 70 | |
|---|
| 71 | % run all the benchmark tests the default number of times: |
|---|
| 72 | |
|---|
| 73 | | ?- benchmarks::run. |
|---|
| 74 | ... |
|---|
| 75 | |
|---|
| 76 | |
|---|
| 77 | % or run specific benchmark tests individually, for example: |
|---|
| 78 | |
|---|
| 79 | |
|---|
| 80 | | ?- benchmarks::run(s1, 1000000). |
|---|
| 81 | ... |
|---|