This, we do not know. Only God knows. So we do not really know which of the saints went directly to heaven, already so purified as to be able to stand in the presence of the holiness of God. I don't know. Probably they also had, at least, a fairly short time to be purified from the "dust," I would say, of this earthly life. Not from serious sins or "dirty" things, because they lived holy lives, but perhaps from some remaining dust, some imperfections, which even saints had. Because only God is holy. We say in the prayer of the Gloria, "Tu solus Sanctus," you alone are holy. Only Our Lady was immaculately conceived and went directly to heaven.
As for the martyrs, who died through direct violence, or like the good thief, by a special grace of the Lord, they may have entered heaven immediately. But usually, even the canonized saints probably had to pass, maybe for a short time, through a light or so-called purgatory. It is like entering a great palace or a beautiful castle. Before you step into the most beautiful room, the throne room, there is a small vestibule. And so, the saints, those good people who died in the grace of God, likely had to be prepared a little to enter into the unspeakable holiness and glory of God.