Replies: 3 comments 34 replies
-
Thank you a lot for sharing this interesting benchmark! Here is the permalink of the raw source file that can be tried immediately: One thing I noticed by looking at the sample queries included in the file is that %?- time(ceiling_vertex_t([3/3,3/4,3/5,4/6,4/7,4/8,5/9,5/10,6/11,6/12], V, true)). %@ % CPU time: 0.426 seconds %@ V = 3/5 %@ ; % CPU time: 0.962 seconds %@ V = 4/8 %@ ; % CPU time: 1.450 seconds %@ V = 5/10 %@ ; % CPU time: 1.972 seconds %@ V = 6/12 %@ ; % CPU time: 1.982 seconds %@ false. Maybe there is a way to speed this up? Often, major performance improvements come from removing unnecessary work. |
Beta Was this translation helpful? Give feedback.
-
In stead, use This makes the code more determinate, that is less leftover choice points à la |
Beta Was this translation helpful? Give feedback.
-
Work on compacting the representation of terms in the heap is ongoing, but once it's finished, it should yield a substantial speed up in all of Scryer. I enthusiastically agree that inlining |
Beta Was this translation helpful? Give feedback.
-
Background: Having played a 'supporting role' in this arXiv paper, complete path enumeration (CPE) has begun to look like a means for definitive treatment of oncology dose-escalation trial designs. I expect in fact that CPE will enable a unification of what are now thought to be disparate classes of dose-finding design. To this end, as part of R package precautionary, I am implementing in
ccd.pl
(GitHub permalink to current revision) a class of 'cumulative cohort designs' (Ivanova, Fluornoy & Chung (2007)) with certain extensions suggested by Liu & Yuan (2015).Problem: Whereas my previous DCG for the elementary but widely-used '3+3' design (see file esc.pl) managed to enumerate all 'reasonably-sized' 3+3 trials in about 20 minutes, my
ccd.pl
code does not enumerate even one trial of practical size in an hour! Achieving my aims with this code probably requires at least a 100x speedup.Question: What are recommended approaches for performance tuning in Prolog? How could I learn where the time is being spent in the above calls? Customary profiling approaches recently helped me to achieve some very nice speedups (see this Twitter thread) of a CPE implemented in R and Rust; does Prolog admit instrumentation for nested attribution of execution time to individual goals and the goals they call? (Presumably, meta-interpretation could help with this?) With Scryer being under such active development, might profiling also point usefully to underlying implementation (or library) issues worth reporting? Are there any intersections with Rust and its tooling that we Scryer Prolog users could exploit for performance tuning?
Edit: Although the particular performance problem that motivated this post is now logged as #975, the underlying question (seeking general advice on Prolog performance tuning) remains.
Beta Was this translation helpful? Give feedback.
All reactions