Assume $K$ is perfect, i.e., $K$ is quasi-isomorphic to a bounded complex $P^\bullet$ of finite projective modules, see Definition \ref{definition-perfect}. If $E_i$ is represented by the complex $E_i^\bullet$, then $\bigoplus E_i$ is represented by the complex whose degree $n$ term is $\bigoplus E_i^n$. On the other hand, as $P^n$ is projective for all $n$ we have $\Hom_{D(R)}(P^\bullet, K^\bullet) = \Hom_{K(R)}(P^\bullet, K^\bullet)$ for every complex of $R$-modules $K^\bullet$, see Derived Categories, Lemma \ref{derived-lemma-morphisms-from-projective-complex}. Thus $\Hom_{D(R)}(P^\bullet, E^\bullet)$ is the cohomology of the complex $$ \prod \Hom_R(P^n, E^{n - 1}) \to \prod \Hom_R(P^n, E^n) \to \prod \Hom_R(P^n, E^{n + 1}). $$ Since $P^\bullet$ is bounded we see that we may replace the $\prod$ signs by $\bigoplus$ signs in the complex above. Since each $P^n$ is a finite $R$-module we see that $\Hom_R(P^n, \bigoplus_i E_i^m) = \bigoplus_i \Hom_R(P^n, E_i^m)$ for all $n, m$. Combining these remarks we see that the map of Derived Categories, Definition \ref{derived-definition-compact-object} is a bijection. \medskip\noindent Conversely, assume $K$ is compact. Represent $K$ by a complex $K^\bullet$ and consider the map $$ K^\bullet \longrightarrow \bigoplus\nolimits_{n \geq 0} \tau_{\geq n} K^\bullet $$ where we have used the canonical truncations, see Homology, Section \ref{homology-section-truncations}. This makes sense as in each degree the direct sum on the right is finite. By assumption this map factors through a finite direct sum. We conclude that $K \to \tau_{\geq n} K$ is zero for at least one $n$, i.e., $K$ is in $D^{-}(R)$. \medskip\noindent Since $K \in D^{-}(R)$ and since every $R$-module is a quotient of a free module, we may represent $K$ by a bounded above complex $K^\bullet$ of free $R$-modules, see Derived Categories, Lemma \ref{derived-lemma-subcategory-left-resolution}. Note that we have $$ K^\bullet = \bigcup\nolimits_{n \leq 0} \sigma_{\geq n}K^\bullet $$ where we have used the stupid truncations, see Homology, Section \ref{homology-section-truncations}. Hence by Lemma \ref{lemma-commutes-with-countable-sums} we see that $1 : K^\bullet \to K^\bullet$ factors through $\sigma_{\geq n}K^\bullet \to K^\bullet$ in $D(R)$. Thus we see that $1 : K^\bullet \to K^\bullet$ factors as $$ K^\bullet \xrightarrow{\varphi} L^\bullet \xrightarrow{\psi} K^\bullet $$ in $D(R)$ for some complex $L^\bullet$ which is bounded and whose terms are free $R$-modules. Say $L^i = 0$ for $i \not \in [a, b]$. Fix $a, b$ from now on. Let $c$ be the largest integer $\leq b + 1$ such that we can find a factorization of $1_{K^\bullet}$ as above with $L^i$ is finite free for $i < c$. We will show by induction that $c = b + 1$. Namely, write $L^c = \bigoplus_{\lambda \in \Lambda} R$. Since $L^{c - 1}$ is finite free we can find a finite subset $\Lambda' \subset \Lambda$ such that $L^{c - 1} \to L^c$ factors through $\bigoplus_{\lambda \in \Lambda'} R \subset L^c$. Consider the map of complexes $$ \pi : L^\bullet \longrightarrow (\bigoplus\nolimits_{\lambda \in \Lambda \setminus \Lambda'} R)[-i] $$ given by the projection onto the factors corresponding to $\Lambda \setminus \Lambda'$ in degree $i$. By our assumption on $K$ we see that, after possibly replacing $\Lambda'$ by a larger finite subset, we may assume that $\pi \circ \varphi = 0$ in $D(R)$. Let $(L')^\bullet \subset L^\bullet$ be the kernel of $\pi$. Since $\pi$ is surjective we get a short exact sequence of complexes, which gives a distinguished triangle in $D(R)$ (see Derived Categories, Lemma \ref{derived-lemma-derived-canonical-delta-functor}). Since $\Hom_{D(R)}(K, -)$ is homological (see Derived Categories, Lemma \ref{derived-lemma-representable-homological}) and $\pi \circ \varphi = 0$, we can find a morphism $\varphi' : K^\bullet \to (L')^\bullet$ in $D(R)$ whose composition with $(L')^\bullet \to L^\bullet$ gives $\varphi$. Setting $\psi'$ equal to the composition of $\psi$ with $(L')^\bullet \to L^\bullet$ we obtain a new factorization. Since $(L')^\bullet$ agrees with $L^\bullet$ except in degree $c$ and since $(L')^c = \bigoplus_{\lambda \in \Lambda'} R$ the induction step is proved. \medskip\noindent The conclusion of the discussion of the preceding paragraph is that $1_K : K \to K$ factors as $$ K \xrightarrow{\varphi} L \xrightarrow{\psi} K $$ in $D(R)$ where $L$ can be represented by a finite complex of free $R$-modules. In particular we see that $L$ is perfect. Note that $e = \varphi \circ \psi \in \text{End}_{D(R)}(L)$ is an idempotent. By Derived Categories, Lemma \ref{derived-lemma-projectors-have-images-triangulated} we see that $L = \Ker(e) \oplus \Ker(1 - e)$. The map $\varphi : K \to L$ induces an isomorphism with $\Ker(1 - e)$ in $D(R)$. Hence we finally conclude that $K$ is perfect by Lemma \ref{lemma-summands-perfect}.