Efficiency incident #1409
Labels
component:code generator
optimization
Not a bug, but something that could be made better. In many cases, this can require some rethinking.
priority:normal
Problem
When developing a prototype, I wrote the following rule:
The prototype took forever to evaluate this rule (approx. 30 minutes).
The compiler just took 15 seconds (OK, it is not the most trivial rule around...)
The difference between these results (factor 120) is too large to be acceptable, so I categorize this as an efficiency issue.
Symptoms
Docker image of Ampersand that was used:
ampersandtarski/prototype-framework:v1.16
The Ampersand term to be evaluated is:
If the compiler computes the violations, it takes 15 seconds to compute the following result:
However, if the prototype computes the same result, it takes approx. 30 minutes.
Here are some lines in the log file, just before the SQL query was run.
This is the SQL query. It is roughly 30000 characters without prettyprinting.
Help to reproduce
Here is a small script, meant to reproduce the SQL query and experiment with it.
I reckon you can remove relation
t
and its occurrences to make it even smaller without spoiling the essence of the experiment, but I'm not 100% sure (also: The SQL optimization might influence the results).I tried this script on
rap.cs.ou.nl
with Issue1409.xlsx as input. That should give sufficient queues for experimentation, to reproduce the efficiency problem.The text was updated successfully, but these errors were encountered: