Answer the question
In order to leave comments, you need to log in
How to speed up the output of a very large number to the console?
I have a very large number (number length is 200000 digits). I print it to the console like this: System.out.println(myBigInt);
or System.out.println(String.valueOf(myBigInt));
This takes me about 5 seconds. I need to reduce the time it takes to print such a number to the console. Any ideas?
Answer the question
In order to leave comments, you need to log in
With such volumes of data, the bottleneck is the terminal itself, it simply does not have time to display the data. Try redirecting the output to a file.
UPD: Here is a proposed method that is about 10 times faster than toString
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question