I know this is a somewhat nebulous question but which algorithm would be more efficient and/or "faster"?
Searching through a preloaded JavaScript array of names or using the MySQL query "SELECT NAME WHERE NAME LIKE '%VARIABLE%'? The MySQL would be called using jquery AJAX to access a PHP file.
A little background on my website, it is a site primarily for mobile users and uses a mix of jquery and php to deliver content. In this case the user would be searching for a specific name within a list of ~22,000 unique names.
I have also thought about storing the table using LocalStorage as a cache, but then that requires an additional (though maybe less costly?) step of verifying/updating/loading the cache.
If more information is needed please let me know and thanks in advance.
EDIT:
A bit of extra information, the user can and probably will be searching for multiple non-unique values. For example: a search value of 'Jane' can and should return the results 'Jane Smith', 'Janet Smith', 'Jane Doe', 'Janess Whatver', 'jfhfuhd_JANE_dfifhf, Blah' (don't know who would ever have a name like that but if it was in the database and they searched Jane it should be return along with the others)