Going through a long array to find an item

So in the game I’m getting item names from a database and finding the right object with that name, to do that I’ve thought of two options:

1)Putting every item in an array and searching in that array the name I got from internet REST API, which means going through 1000 items (In blueprint),
2)By using findObject in C++, find the object by the string I’ve taken from the database,

Question is: Is going through 1000 items in an array expensive, or creating that array, be it an array of strings or objects? Which method do you think is less expensive? Is there a better way to do this?

C++ is definetly faster than in blueprint but doing it in BP is also OK. Do you need to do that often or just once?

Well, every time a user withdraws an item from his/her bank, this operation has to be done.

Definetly do not search for every object in the scene. Creating an array with reference to your objects seem a good way to go. 1000 isnt that much to go throught, to be safe, do it in C++ and you’ll get a nice perf boost.

Yes I have that index unless the player leaves the game. When he leaves and say comes back tomorrow, I have to get the items from the database, I’m getting the items’ names as strings from the database, and I have to find the actual items by looking at those names. Anyone can help with that? Or I’ll have to go through 1500 array.

As others said before, it’s best if you can always just use the index and not search by name. If you still must search by name, then you should be putting them into a TMap and not a TArray.