After a whole day of debugging my new algorithm for converting binary to decimal, I was able to trim my time.
D:\Programs\G'MIC\gmic-community>gmic tic rep_bin2dec 1${rep_random_bits\ 89999} toc
[gmic]./ Start G'MIC interpreter (v.3.3.6).
[gmic]./ Initialize timer.
[gmic]./ Elapsed time: 0.599 s.
[gmic]./ End G'MIC interpreter.
D:\Programs\G'MIC\gmic-community>gmic tic rep_bin2dec 1${rep_random_bits\ 89999} toc
[gmic]./ Start G'MIC interpreter (v.3.3.6).
[gmic]./ Initialize timer.
[gmic]./ Elapsed time: 1.509 s.
[gmic]./ End G'MIC interpreter
Top one is new, bottom one is old. If it was single-threaded only for new one, it’d be 1 s.
The new one is essentially the old algorithm as in the idea* still remains the same, but enables multi-threading, and more compressed code.
*idea = The usage of Schönhage-Strassen multiplication algorithm, and base 10-million.
Also, this verifies it works:
D:\Programs\G'MIC\gmic-community>gmic echo ${rep_bin2dec\ 1110100000000000000000111111111111111111111100000000000001111111111111111111111100000000000101010101010101001011111111111111101111110000000000}
[gmic]./ Start G'MIC interpreter (v.3.3.6).
5052513913269773216455623635086885525584896
[gmic]./ End G'MIC interpreter.
D:\Programs\G'MIC\gmic-community>python
Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug 1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> 0b1110100000000000000000111111111111111111111100000000000001111111111111111111111100000000000101010101010101001011111111111111101111110000000000
5052513913269773216455623635086885525584896
>>> exit(