Discussion GNU Prolog

In this section we will provide a critical discussion of the comparison with the GNU Prolog system. The GNU Prolog ranks second in our comparison of interpreters. The average speed up factor relative to the Jekejeke Prolog system is around 66.6%. This is a little bit worse than the average speed up factor of SWI Prolog. The worst speed up factor is around 85.8% for query. The best speed up factor is around 37.4% for nrev.

Picture 9: GNU Prolog Performance

GNU Prolog and SWI Prolog are not only similar what concerns the average speed up factor. But the Prolog systems also share a similar pattern of speed ups among the test programs. We only see a considerable difference in the test programs tictac, queens and mtak. The SWI Prolog system shows a significantly better relative performance for these test programs. On the other hand the relative performance for the test program query is better.

Most of the test programs that are better than the average compared to Jekejeke Prolog are deterministic. Therefore we might conclude that GNU Prolog has a better handling of deterministic predicates than we do. In particular we find those test programs that have structure resulting arguments above the average. In our PLM based architecture the cost for structure resulting arguments is the variable instantiation and then a dispose instruction that executes to no avail. In a WAM based architecture the structure is simply newly allocated.

Concerning the DCG expansion the GNU Prolog system is able to merge terminals into the head like SWI-Prolog can do. But contrary to SWI Prolog it does not put additional unification steps inside the grammar rules for DCG actions. In theory this should give a relative speed advantage. But we do not find such a result, which is more astonishing since query performs better. We can only conclude that query performs better because of faster arithmetic and not because of faster indexing. Since the better indexing would be also seen in the merging of terminals into the head for the calc test program.

Kommentare