Do what I did and go to a store and hold them all (and by all I mean Ruger, Sig, H&K, Walther, etc). I was previously a Glock fan, but when I held all the brands in my hand it was the S&W and Walther that felt the most comfortable.
The Glock shape I had been used to all of a sudden felt terrible. I don't mind the blocky look, but the blocky feel is just horrible compared to everything else that's available now. Glock may have been able to get away with it 15 years ago, but no longer.
However, S&W is universally reviewed as having the
worst trigger in the category, where at least the Glock's is okay.
Taking all of these things into consideration, and researching it even more, I made the decision to buy the Walther PPQ because it was super comfortable, had amazing quality, and had the
best trigger in the category. Most of the ones in Canada are the M1 model with the paddle mag release on the trigger guard, but I went with the harder-to-find M2 with the conventional button mag release.
I know you're primarily asking about Glock and S&W, but both of those pistols have compromises. Go with the Walther if you want the best of all worlds, and you're willing to pay a bit more. ###y as heck, too: