Determining the optimal fingering has literally been studied for centuries so you should take advantage of that existing knowledge.There are a number of frequently occurring patterns which you should know the fingering to, these include scales and arpeggios and you should learn those in all keys.