Autocomplete with large completion list (>20000 commands)

I’m trying to implement the LaTeX Language with autocomplete. Since TeX has a ton of different commands, I wanted to ask whether it would be practical to have this as a static list in CodeMirror, or use some external DB for the matching, for efficiency’s sake.

A static client-side list should work fine, I think.