We probably won’t need to stay up all night this election day.

The May 17 Pennsylvania primary elections shouldn’t create anything like the days-long anxiety of November 2020, when the counting of mail ballots dragged on. There’s a very good chance we’ll know the Democratic and Republican nominees for Senate and governor a few hours after polls close.

As always, things can change, races can be unexpectedly close. At the moment, though, you can expect a whole lot of votes to be counted by the end of the night. (Razor-thin margins in crowded GOP primaries for Senate and governor could change that.)

But some local elections officials worry the smooth, speedy count they expect will mask the structural challenges to tallying ballots that remain despite two years of nonpartisan pleas for changes to state law. Widespread use of mail ballots, which take longer to count, can still mean longer waits for results in high-turnout, nationally watched elections — like Pennsylvania’s statewide races this fall.

“If it seems like smooth sailing [this primary], it’s not because the system is set up for success,” said Lee Soltysiak, Montgomery County’s chief clerk.

Here’s what you need to know about how votes are being cast and counted.

Republican votes will get counted quickly because they’re still avoiding mail ballots

Then-President Donald Trump created a sharp partisan divide in the way voters cast ballots when he spent much of 2020 lying that mail ballots were a source of widespread fraud. Republicans followed Trump’s lead and largely stayed away from voting by mail, while Democrats embraced the method as the pandemic raged.

That divide continues today, with registered Democrats making up more than three-quarters of the 789,000 voters who had requested mail ballots as of Wednesday, according to the Pennsylvania Department of State.

This split means Republicans’ votes are counted faster than Democrats’ votes, since a large majority of Republicans will likely vote in person and those votes are quickly machine-counted the way they always have been. Mail ballots take longer to count, meaning more Democrats’ votes take longer to count.

In a general election, that can make it seem like a Republican is “winning,” but neither candidate is winning or losing: The Republican candidate’s votes are just being counted faster.

But the dynamic is different in a primary. In the case of the Republican contest, votes being mostly cast — and counted — on election day means it’s likely the competitive and nationally watched GOP races for Senate and governor will be called quickly.

But Democrats may be starting to move back to in-person voting, too

Most Pennsylvania votes cast for Joe Biden in 2020 were mail ballots.

But since then, the share of votes cast by mail has fallen for both Democratic and Republican candidates.

That means the in-person votes quickly tabulated on election night could also make up most of the Democratic votes, meaning early calls in that party’s Senate primary.

Fewer mail ballots mean they’re counted faster

Turnout has a straightforward effect on vote count: When there are fewer mail ballots to count, they get counted more quickly. The trends so far indicate much, if not most, of the mail vote will be counted on election day.

The number of mail ballots requests has been lower than many county elections officials expected, about 789,000 so far, only slightly higher than the 752,000 requested by this point in last year’s municipal primary.

That number will continue to rise before election day, but it will almost surely be lower than this November’s general election. And that will be below the turnout presidential races bring.

“The primaries are not the general election, but the midterm election is also not the presidential election,” said Charles Stewart, a political scientist at MIT who studies data in election administration.

The piles of mail ballots waiting to be counted on May 17 should be done by the end of the night, county elections officials said. Some, including in Philly, expect they could be done before polls close in the evening. (Like always, some mail ballots will still need to be tallied in the days after.)

What could delay calling a winner? The margins

To figure out the winner as results come in, news organizations that call races use sophisticated statistical models that take into account a lot of factors.

That means the margin really matters. When one candidate has won a much larger portion of the counted vote than anyone else, and there aren’t a ton of votes left — or there’s no reason the remaining votes would differ significantly from those that have already been counted — it’s much easier to declare that person the winner.

If some races aren’t called quickly, it won’t be because the vote count is slow — it’ll be because the races are super close.

Counties still want ‘pre-canvassing’ for mail ballots

State law bars counties from beginning the process of counting mail ballots until 7 a.m. on election day, the same time polls open. That gives them just 13 hours before polls close, a time when they also have to run the in-person vote.

Counties have adapted to the expansion of mail voting. They’ve bought equipment as simple as letter openers and more tables, and as complex as 40-foot-long ballot-sorting machines. They’ve hired and trained staffers, and gotten a clearer sense of how many people they need across the different vote-counting roles.

“We’ve had time to perfect procedures and know what our resource needs are,” said Lisa Schaefer, executive director of the County Commissioners Association of Pennsylvania. But more needs to be done, she said: “Just because we can do it now based on what we’ve learned doesn’t mean it’s the best way to do things.”

County elections officials have long advocated for one particular change: Let them begin “pre-canvassing” before election day.

Being allowed to open all the envelopes and prepare ballots for scanning and counting would be a huge help, they say.

“It’s a race against time to get the results in,” Philadelphia elections chief Lisa Deeley said. “So it does matter — if we can shave a day, it makes a big difference.”

Attempts to change state law on pre-canvassing have repeatedly stalled. Republicans, who control the legislature, have either not advanced pre-canvassing legislation or tied it to larger changes that Democratic Gov. Tom Wolf opposes.

Until that change is made, county officials warned, a fast vote count this election won’t prepare us for November and beyond.

“The need for pre-canvassing, for elections boards to be able to begin to count ballots prior to election day, is still essential to getting a timely and accurate vote count in a high-turnout election,” Soltysiak said. “And absent that, we will wait for results that everyone is on the edge of their seats to receive.”