Replies: 7 comments 13 replies
-
As you have the liberty on how to write the term file, why not write a clause file and skip assert all together by simply consulting the file? Some post-processing not possible at the time the file is written? P.S. Also note that e.g. SWI-Prolog use a foreign library to accelerate predicates such as |
Beta Was this translation helpful? Give feedback.
-
Could you provide concrete data?
So at least for your test case, it is not surprising that Scryer did not terminate. |
Beta Was this translation helpful? Give feedback.
-
On another note: I'm experimenting with writing the term file as a single fact with all the data as a single list in the fact's argument. It crashes with Scryer but works well with SWI:
|
Beta Was this translation helpful? Give feedback.
-
What I have tired. A million facts
In Scryer that is ~64s vs ~35s in SWI.
|
Beta Was this translation helpful? Give feedback.
-
To summarize: Scryer is currently about a factor of two slower than SWI for consulting facts. |
Beta Was this translation helpful? Give feedback.
-
If fast loading isn't available yet, should I close this discussion and open a tracking issue instead? |
Beta Was this translation helpful? Give feedback.
-
Consulting may be twice as slow but I'm not describing the same thing.
The question in the title still stands: how to quickly load many facts? (whether via
Well, we'd have to get to it some day, even if it's lower priority. |
Beta Was this translation helpful? Give feedback.
-
I have a lot of static data which I store in a file as simple Prolog terms. I'd then assert them with
assertz/1
.Loading it seems never ending while I have been able to load it in a few seconds with Sicstus, Eclipse and SWI (latter with read_file_to_terms/3 which uses
read_term/3
internally).For Scryer, I tried the following minimal example:
So, what's the recommended way to load a lot of Prolog terms?
Note that I have liberty on how to write the term file.
I don't know if/how library
pio
could be made to work more efficiently than the above.Beta Was this translation helpful? Give feedback.
All reactions