The currently recommended approach is to use VBOs. Basically, put all your vertices in lists and give them to the driver. Then when you’re ready, issue a “draw call” (such as glDrawElements, glDrawArrays, etc.) to tell the GPU to render them all at once in one “batch”.
In practice you can get even higher performance from VBOs by additionally using bindless (on NVidia), or VAOs (on NVidia/AMD). But plain VBOs are likely to be so much faster than your immediate mode code that you probably won’t even care.
Of course, if you don’t care about long-term portability, you can try using a display list. Particularly on NVidia, the performance of this can rival VBOs+bindless, and they are very easy to try. Note: display lists were deprecated in OpenGL 3.