Judd Apatow strains to get out of adolescent mode with his third writing-directing effort, and he succeeds to some extent. Sure, his characters—mostly male—still suffer from a pervasive case of arrested development and sprinkle the f-bomb, as well as words like “dick” and “cock,” all too liberally into their conversation. (Except for the brain-dead, their hundredth occurrence within the space of a couple of hours should be more wearying than amusing.) But the guys are less like simple cartoons this time around—some real feelings are involved—and if you listen past the scabrous talk, there are very funny lines here. Compared to “The 40 Year Old Virgin” and “Knocked Up,”“Funny People” is a definite advance.

But it’s also a movie that cries out for some outside intervention—somebody who could have persuaded Apatow to whittle down the script, which definitely gets repetitive, or suggested some tightening of the finished footage, especially in the last hour or so. (The picture runs for two-and-a-half, which turns out to be no joke at all.) It’s nice that Apatow is stretching, but by the 120-minute mark, you might find that you’re accompanying his stretch with a stifled yawn.

The running-time is particularly unwarranted because the plot is so terribly thin. It’s set in the word of L.A. comics, where George Simmons (Adam Sandler), a Hollywood superstar who occasionally returns to his roots in stand-up, learns that he has a rare, potentially fatal blood disease. He hires aspiring but dismally unsuccessful comedian Ira Wright (Seth Rogen) to write jokes for him and quickly makes the guy his aide, and at first the only person in whom he confides his condition. His illness makes George aware of how lonely his life is, and he not only brings Ira ever closer, but seeks to re-establish his relationship with the woman he loved but dumped, ex-starlet Laura (Leslie Mann), who’s drawn to him despite the fact that she’s married to a volatile Australian (Eric Bana) and has two daughters (Apatow’s own kids, Iris and Maude). And she responds after learning about his diagnosis.

Much of “Funny People” is devoted to Sandler’s riffs, which are acerbically funny if not hilarious, and are made all the more fascinating by the fact that it’s hard to discern where the star ends and the character begins and by the fact that the whole disease business is treated without descending into schmaltz or sentiment (indeed, some of the best moments are Simmons’ interplay with a tall Scandinavian doctor played in perfect deadpan by Torsten Voges). But a good deal of the picture is devoted to Wright, a schmo who has to deal delicately with the mercurial, demanding star. There’s also a lot of verbal interplay—amusing, for the most part—with his roommates, motor-mouth Leo (Jonah Hill), a stand-up comic himself, and smoothly smug Mark (Jason Schwartzman), who’s made it as the star of a terrible sitcom, and a tentative approach by shy, tongue-tied Ira to Daisy (Aubrey Plaza), a dour neighbor who looks like she might be a member of the Addams family.

Bits and pieces of “Funny People” are great—Sandler’s willingness to plumb the depths of his own celebrity is pretty fearless and his snarky dialogue sounds genuine, while the business with Hill and Schwartzman is almost always clever (even if Hill, as usual, seems to be doing stand-up rather than acting). But as a whole the picture is misshapen and meandering, often ambling along making the same points over and over again. And Rogen, while a genial enough presence, is just too much the hapless nebbish to hold it all together. He’s lost considerable weight, which is somewhat of a disadvantage, as Leo notes incisively at one point; like Sid Caesar, Rogen just isn’t as naturally funny slimmed-down as he was with more bulk. The main problem, though, is the long Laura-and-George sequence that takes up the last forty minutes or so of the movie. Maybe Apatow just couldn’t bear to cut footage of his own daughters, but the episode drags on interminably, with Mann offering little beyond bad accents and even Bana’s manic turn failing to ignite, and though it ends more maturely than you might expect, it still brings an unwelcome touch of sentimentality to the proceedings (as does a final scene between George and Ira). The formula that Apatow had largely avoided up to that point sneaks in a bit.

On the visual side “Funny People” has a rather different look from Apatow’s earlier, slicker fare, with cinematographer Janusz Kaminski providing images that sometimes recall a more ragged seventies vibe, even in the scenes featuring Simmons’ opulent mansion. Schwartzman is credited (along with Michael Andrews) for the original music, but most of the soundtrack consists of pop tunes chosen by music supervisor Jonathan Karp, who offers a good, if predictable, selection. And there are lots of celebrity cameos too—a few sharp (see Ray Romano), others pretty flat and obvious.

“Funny People” isn’t the mature breakthrough movie that Apatow might have been aiming for. Seriously overlong and undeniably self-indulgent, it’s rather like some stand-up routines itself, with some brilliant high spots punctuating more mediocre material and a close that’s a letdown. But it has enough perception and laughs to merit a visit.