I've replicated your MWE with 20 copies over the sample text. Importantly, if you replace all \sfrac
commands with "ordinary" \frac
commands, the difference in compile times between the programs with and without microtype feels negligible. This suggests that it's not some inherent deficiency (or, if you will, programming bug) in the microtype package that's causing the big slowdown but, rather, some kind of extra spacing/stretchability features built into the \sfrac
macro that is forcing microtype to work extra hard.
By the way, with 20 copies of the sample text you provide, the outputs of the program with and without microtype are definitely not identical. Specifically, whereas both pdf files consist of one long paragraph of 24 lines, only lines 1-6 and 18-24 of these paragraphs are identical. The 11 lines in between these blocks, i.e., lines 7-17, are at first set more loosely in the version with microtype enabled than in the "plain" version (without microtype), but by the end of line 17 the microtype version has fully caught up with the plain version (thus causing lines 18-24 to be the same again). Eyeballing the two pdf files side-by-side does not show much of a visual difference at first glance. However, on further inspection I notice that the microtype version succeeds, in lines 14-17, in displaying the longer math sequence somewhat more harmoniously (i.e., more even interword spacing). Not a huge difference, for sure, but it may be important for sticklers...
Finally, in case someone wants to experiment with what I've reported, here's my version of the MWE:
\documentclass{minimal}
\usepackage{xfrac,microtype}
\newcommand{\textblock}{Divide $4$ by $2$: $\sfrac{4}{2} =
\sfrac{40}{20} \neq \sfrac{42}{22} \neq\sfrac{2}{3}= \sfrac{4}{6}$.
If you use many $\sfrac{1}{2}$, $\sfrac{7}{8}$ and
microtype together it will take loooong to compile. }
\begin{document}
%% 20 repetitions of the text contained in "textblock"
\textblock \textblock \textblock \textblock \textblock
\textblock \textblock \textblock \textblock \textblock
\textblock \textblock \textblock \textblock \textblock
\textblock \textblock \textblock \textblock \textblock
\end{document}