SWI-Prolog / packages-semweb

The SWI-Prolog RDF store
29 stars 15 forks source link

FIXED: Better ordering of pre_ground_object/2 clauses #106

Closed likelion closed 2 years ago

JanWielemaker commented 2 years ago

Thanks. Before I try to understand the implications, what is the intend?

likelion commented 2 years ago

The reason is pretty simple: to speedup pre_ground_object that is used in many high-performance operations such as rdf, rdf_assert, etc. To take full advantage of the first argument indexing, I put all clauses with uniquely unifiable terms first to avoid multiple checks (for integer, float, string, etc.) in cases where head unification may happen immediately. Also IRIs are often more common objects than literals and their processing is also simpler, so happens first as well.

JanWielemaker commented 2 years ago

Makes sense. Once upon a time the system should deal with this itself :smile: