If you store names in sorted order, you can use binary search to find the namespace in sorted order starting with the name fragment that the user has typed so far, instead of checking all the names one by one.
In a system with a rather strange programming language, where I wanted to find all matches containing what the user had typed so far in any position, I got a satisfactory result for a small implementation effort, reviving http://en.wikipedia.org/wiki / Key_Word_in_Context . (Once at university, I looked for the KWIC physical index, printed using an IBM linear printer, and then linked as a document for that purpose only.
source share