The script for actress Olivia Wilde’s directorial debut has reportedly been making the rounds in Hollywood for ten years (the initial version was on the 2009 Black List of promising unproduced screenplays), which makes perfect sense: “Booksmart” is essentially a gender-reversal variant of the surprise 2007 smash “Superbad.” (The linkage is accentuated by the fact that Beanie Feldstein, who plays one of the leads, is the sister of Jonah Hill, who co-starred in the earlier movie with Michael Cera.)

Not that there aren’t differences between the two pictures. The high school seniors determined to fill their pre-graduation weekend with raucous fun aren’t a couple of desperately nerdy guys this time around, but two brainy best friends who discover to their horror that they’ve pointlessly wasted the chance to have a good time for the past four years by applying themselves unstintingly to studying and campus service in order to get into good colleges—only to find that the classmates they’ve looked down on as hopeless, time-wasting goof-offs have all gotten into great universities (or landed great jobs) too.

The realization that they could have had both success and enjoyment inspires aggressive Molly (Feldstein) to convince her more compliant pal Amy (Kaitlyn Dever) that they should make up for what they’ve missed by going all out in the few hours they have left. Their objective involves crashing a party being held by Nick (Mason Gooding), the class VP to Molly’s President whom she dismisses as a dim-witted dullard but is secretly infatuated with anyway. The problem is that the shebang is at Nick’s aunt’s house, and they don’t know where it is. Molly is also prodding Amy to make some sort of move toward skateboarding Ryan (Victoria Ruesga), the tomboyish girl she’s interested in.

Their wacky attempts to get to the party bring the duo into contact with some of the school staff—the principal (Jason Sudeikis), who’s a Lyft driver on the side, and their teacher Ms. Fine (Jessica Williams), whom they call on for help at one point (and who’s being pursued by a student played by Eduardo Franco). They also have to deal with Amy’s flaky parents (Will Forte and Lisa Kudrow), who have been preparing a very different sort of graduation party. There’s also a pizza delivery man (Michael Patrick O’Brien) from whom they try to extract information, only to be rebuffed.

But their classmates are the major players in the evening’s adventure: George (Noah Galvin), the histrionic drama guy who’s holding a party of his own; Annabelle (Molly Gordon), who’s branded with a reputation as an easy lay; Hope (Diana Silvers), known for her caustic tongue; and many more. The strangest, though, are Jared (Skyler Gisondo), the ultra-rich kid whose money can’t buy him friends, even if he’s hosting a party on a ship, and his girlfriend, flamboyant Gigi (Billie Lourd), who periodically appears out of left field to engage in some new outrageous conduct, and who sometimes spikes drinks with drugs. (An encounter with her concoctions leads to an animated sequence in which the girls imagine themselves as a couple of dolls.)

Molly and Amy eventually do wind up at Nick’s party, where both initially appear to be making progress in assimilating with their classmates and connecting with the people they’d like to know better. But then the obligatory collapse occurs, and they find themselves at odds with one another; they split up, but not, of course, for long.

It’s admittedly a switch to see a raucous high school story like this told from a female perspective, and Wilde and her cast bring a good deal of energy to it. In the final analysis, though, the vibe isn’t all that different from so many recent teen farces or even the John Hughes pictures of the eighties. It’s one of the better raunchy high school comedies to come down the pike recently, but apart from the gender switch the level of innovation is actually pretty modest.

Still, the quality of the writing is better than the norm, Wilde and editor Jamie Gross keep things moving, and production designer Katie Byron, costumer April Napier and cinematographer Jason McCormick create a convincing ambience. Most importantly, Feldstein and Dever prove a fine pair, and all of the small army of supporting players put over their characters with enthusiasm, even if some of them (Lourd, Gisondo and Galvin, for example) play things very broadly.

Apart from the gender transformation of the leads “Booksmart” might alter the “Superbad” formula only slightly, but it’s winning enough to make you want to return to high school, for a couple of hours at least.