Database micro-benchmark (Discussion)

Yes

No. Anyway, that would only affect the assert/retract case. The hooks for dealing with incremental udates of tables are realised using different preample (supervisor) code for incremental dynamic predicates. There is a very quick check for a flag in assert/retract to call update hooks. These really matter for dynamic incremental predicates, but should not be measurable otherwise.

There is a general extra price for meta-calling due to the wrap_predicate/4 primitive. The effect seems pretty small though.

I cannot reproduce your figures. Over the whole run I get 3.78 (8.13) vs. 3.67 (8.03). This figure varies a bit between runs and boils down to 3%. Note that re-compiling the system with trivial changes often leads to a few percent difference, I guess due to different cache behavior.

Note that loading library(apply_macros) makes more difference as this inlines forall/2 rather than meta-calling it. Also using scripts/pgo-compile.sh to build the system is likely to make more difference.

Did you really compile on the same machine with the same compiler and same configuration?

1 Like