]> Repositorios git - scryer-prolog.git/commit
remove optional (+)/1 prefix in get_atts/2 and put_atts/2 calls
authorMarkus Triska <[email protected]>
Sun, 20 Aug 2023 19:38:33 +0000 (21:38 +0200)
committerMarkus Triska <[email protected]>
Tue, 22 Aug 2023 19:52:55 +0000 (21:52 +0200)
commit24456e9703f1d23b4b75985e0a11608e18adaa29
treea258481aa1dcd1b24d750fc741d8125b93460a96
parent7f024f3b8dbfee71e9110e568444e89fc72c7a4f
remove optional (+)/1 prefix in get_atts/2 and put_atts/2 calls

The (+)/1 prefix in get_atts/2 at line 4219 by itself already causes a
greater than 15% slowdown for the benchmark shown in #1730:

    ?- N #= 2^14,
       time(((between(1, N, _),
              X #\= Y,
              false)
            ; true)).

The performance impact is not a good reason to remove the optional
(+)/1 prefix! Performance issues should be addressed at the root, in
this case get_atts/2 (#1962). We should never manually work around
performance issues in built-in predicates.

In contrast, readability is a good argument, and I find the calls
slightly easier to read without the optional (+)/1 prefix.

The prefix is now consistently omitted when possible.
src/lib/clpz.pl