[m-rev.] for review: faster int to decimal string conversion

Zoltan Somogyi zoltan.somogyi at runbox.com
Sun Oct 17 16:57:00 AEDT 2021


2021-10-17 16:44 GMT+11:00 "Julien Fischer" <jfischer at opturion.com>:
> 3. Should I add the benchmarking code I used to the benchmarks?

Yes.

> -int_to_string(N) = S1 :-
> -    int_to_string(N, S1).
> +:- pragma foreign_proc("C",
> +    int_to_string(I::in) = (S::uo),
> +    [will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],

The C code looks good; I can't vouch for the C# and Java versions.

The original code had the function version of int_to_string forward
to the predicate version, which is what the library usually does.
Your diff reverses this. Why? 

Zoltan.


More information about the reviews mailing list