opencog / benchmark

Benchmarking the AtomSpace, the pattern matcher and other OpenCog systems
GNU Affero General Public License v3.0
6 stars 9 forks source link

Measure ScopeLink, GetLink, BindLink, DualLink performance #8

Open ngeiswei opened 6 years ago

ngeiswei commented 6 years ago

Scope links are probably the most expensive link types to construct and insert in the AtomSpace. First calculating the hash value during construction is more expensive than for non scope links. Scope links like PatternLink, BindLink, etc, are even more expensive to construct so. Then inserting them to the AtomSpace also requires more computation like testing for alpha-equivalence.

query_benchmark does support scope links but mostly for querying, not construction and insertion...

All that to say that scope links really should be supported by atomspace_bm (if that doesn't get replaced by something else soon).

linas commented 6 years ago

Three or more distinct measurements are needed:

1) Measure performance of insertion into atomspace for just plain, bare-bones ScopeLinks. This would measure the elapsed time for the alpha-conversion. (this essentially measures the constructor for ScopeLinks, plus the assorted baggage in the atomspace that triggers alpha conversion, including hash computation and hash comparison)

2) Performance of insertion into atomspace for GetLink. This would measure the elapsed time to "compile" the search pattern. (most (almost all?) of the "compilation" happens in the constructor for the GetLink.)

3) Execute performance for GetLink. This would measure the time to actually run a query. (GetLink::execute() more or less, plus the rest of the execute subsystem, needed to get to here.)

4) Maybe do 2&3 for DualLink, BindLink. I expect that these will be similar to GetLink, but hey...

vsbogd commented 6 years ago

Ensure that relevant benchmarks are added to cover: atomspace/scripts/query/benchmark_query.sh atomspace/scripts/benchmark_utests.sh and remove these scripts.