On the impact of argument passing on the performance of the WAM and B-Prolog
Bart Demoen, Phuong‐Lan Nguyen · Lirias · 2000
B-Prolog deviates from WAM mainly by its parameter passing mechanism: parameters are pushed on the control stack instead of being passed through argument registers. Also, the B-Prolog emulator has a quite high performance on the classical benchmark set despite its being ANSI-C compliant. It is therefore tempting to attribute its performance to the parameter passing convention. This issue is investigated here in more detail. Instruction compression was a key issue in this study, so we discuss issues related to it. We next show with a set of articial deterministic and backtracking programs that the WAM and B-Prolog can outperform each other arbitrarily, indicating that - at least for emulators - neither has a systematic advantage over the other. Moreover, we show that whenever the WAM parameter passing schema is worse, a very simple program transformation can be applied which gives WAM the benets of B-Prologs argument passing schema, and this without leaving the WAM framework...