[m-rev.] for review: speed up remove_{leq,gt}

Julien Fischer jfischer at opturion.com
Thu Jan 19 14:41:02 AEDT 2023


On Thu, 19 Jan 2023, Zoltan Somogyi wrote:

> Improve the remove_{leq,gt} sparse bitset ops.
> 
> library/sparse_bitset.m:
> library/fat_sparse_bitset.m:
>     Speed up the remove_leq and remove_gt operations by moving a
>     loop invariant computation, the conversion of the boundary item's index
>     into an <offset,bitposn> pair, out of the loop.
>
>     Eliminate some unnecessary differences between the two modules,
>     e.g. clear_bit being a predicate rather than a function.

...

> diff --git a/tests/hard_coded/test_tree_bitset.m b/tests/hard_coded/test_tree_bitset.m
> index 90e9b630c..a06906185 100644
> --- a/tests/hard_coded/test_tree_bitset.m
> +++ b/tests/hard_coded/test_tree_bitset.m

...

> @@ -288,6 +302,48 @@ do_run_test(Write, WhichTest, List1 - List2, !IO) :-
>          true
>      ),
> 
> +    ( if
> +        ( WhichTest = test_remove_leq
> +        ; WhichTest = test_all
> +        ),
> +        get_middle(List1, Mid1Leq)
> +    then
> +        % We want to include the parameter we test the remove_leq operation
> +        % with in the output when we are debugging the either the operation

s/the either/either/

That looks fine otherwise.

Julien.



More information about the reviews mailing list