Smart contracts are rather strange from a performance standpoint.
The Ethereum Virtual Machine is a state machine that updates with each block. A block contains a list of transactions that were included. This can include multiple/many transactions from the same sender. The new state is determined from the old state, plus whatever changes result from the transactions included in the block.
The included transactions may be trivial or complex and costly. This has no impact at all on timing. Transactions are either included in their entirety or they are not included at all. Either they happened or they did not.
There is a delay after sending a transaction until that transaction is included in a mined block. There is nothing one can do to speed that up. When a transaction is included in a block, the processing time can be considered more or less instant without any regard to how efficient the function is. Efficiency is encouraged economically . More complex transactions cost a little more.
The code looks fine.
Hope it helps.