  Lookup table decoding is fast and distance-preserving, making it attractive
for near-term quantum computer architectures with small-distance quantum
error-correcting codes. In this work, we develop several optimization tools
that can potentially reduce the space and time overhead required for flag
fault-tolerant quantum error correction (FTQEC) with lookup table decoding on
Calderbank-Shor-Steane (CSS) codes. Our techniques include the compact lookup
table construction, the Meet-in-the-Middle technique, the adaptive time
decoding for flag FTQEC, the classical processing technique for flag
information, and the separated $X$ and $Z$ counting technique. We evaluate the
performance of our tools using numerical simulation of hexagonal color codes of
distances 3, 5, 7, and 9 under circuit-level noise. Combining all tools can
result in more than an order of magnitude increase in pseudothreshold for the
hexagonal color code of distance 9, from $(1.34 \pm 0.01) \times 10^{-4}$ to
$(1.42 \pm 0.12) \times 10^{-3}$.
