mthom / scryer-prolog

A modern Prolog implementation written mostly in Rust.
BSD 3-Clause "New" or "Revised" License
1.93k stars 116 forks source link

Interesting candidate predicates for native compilation #2369

Open triska opened 3 months ago

triska commented 3 months ago

With great interest, I follow the recent native compilation work of @aarroyoc, available in the cranelift-jit branch.

What are interesting candidate predicates for native compilation, where often a lot of time is spent and which would likely help improve performance measurably in many applications? Personally, I think the following predicates are suitable candidates for trying and evolving this new feature:

  1. the predicates of library(assoc), especially get_assoc/3, and insert/5 and the predicates it uses. Since library(assoc) is heavily used by library(clpb) with very large AVL trees, this would likely measurably improve performance on various benchmarks such as the one in #207.
  2. several rather self-contained and frequently needed predicates in library(clpz), such as
  3. format_cell//1 in library(format).

I hope this is useful. Thank you a lot @aarroyoc for working on this feature, I think this will attract even more attention to Scryer!

aarroyoc commented 3 months ago

This is a good list. Thanks for creating it! I'll keep it as a reminder of the features I need to implement to make them faster.