If you’re up for something slow, steady, muted, and nicely acted, Mr. Holmes might be up your alley. Based on Mitch Cullin’s 2005 very good novel A Slight Trick of the Mind, the movie is set in 1947 when Sherlock Holmes, Sir Arthur Conan Doyle’s brilliant, screwed-up fictional detective, is a beautiful ruin — a 93-year-old battling the indignity of memory loss and physical decay. He’s sick to death of his own legend and wants to set the record straight about one last case that haunts him and, for once, not have it filtered through the tabloid sensibilities of his long-dead partner John Watson or trivialized by so-so Sherlock Holmes Hollywood movies.

The shambling detective (played by Ian McKellen) tends to his beloved bees for their healing royal jelly on a bucolic Sussex spread where he’s being cared for — and often, viewed with suspicion by — his vinegary, simple, widowed housekeeper (Laura Linney) as he befriends her brilliant, highly excitable 14-year-old son Roger (Milo Parker). “Exceptional children are often the product of unremarkable parents,” Holmes remarks to his protégé. Holmes’ past and present fascinates Roger, a lonely, lively sort of Sherlock in the making, and he encourages his mentor to hurry and capture the details of a case involving a beautiful woman (Hattie Morahan, excellent) who may have been the love of his life.

In the film, lovingly and indulgently directed by Bill Condon (Gods and Monsters and two Twilight flicks), McKellen is really something — big surprise, right? He plays Holmes in three different interwoven time periods and he’s so wily, full of regret, and magnetic that you can’t look away for a second. It’s hard to imagine him having anything to do with Robert Downey Jr.’s distortion of Holmes as a two-fisted action hero but at least he’s in the same universe as Benedict Cumberbatch’s cerebral and charismatic crackpot. The cozy movie dodders and lags, especially in its last third, but if you fall in step with its mellow melancholy, it’s worth a wallow.