In my app user can make comments in various different ways (e.g. from email). To limit the length of comment is not an option. Some real comments are several millions of chars long which makes Comment component to render them around 2-4 seconds.
Is there any known way of optimization I can use to reduce this time?
Comments can be HTML or plain text.
The optimal way to do this is to set a maximum initial render to the comment let us say 30 chars this will go for all of the next solutions
then add a see more... button to let the user selectively expand the desired comment.
you can also make a separate view to the comment if possible
another page/ view to render the full comment
if the above 2 solutions don't fit then you will have to deal with the loading time and add extra Loaders/ indicators to help the user assess the waiting time