Is there any difference between gosub and procedures in terms of speed?
I want to create a game and I noticed in Waponez II example, the game is structured with gosubs.
thanks!
Gosub or procedures for game development?
Procedures have some overhead (i.e clearing local vars etc) so it'll probably be faster with gosubs, but i think readability will suffer alot if you go the GOSUB way. If i were you i would use procedures if the project is going to be larger than Waponez, for smaller programs it doesn't really matter.
- Joakim Christiansen
- Addict

- Posts: 2452
- Joined: Wed Dec 22, 2004 4:12 pm
- Location: Norway
- Contact:
go for the most readable version on good hardware
once you're done, you can then optimize your code for worse hardware
or code on mid range hardware
by the time your program is finished the hardware is so much faster that it won't matter
once you're done, you can then optimize your code for worse hardware
or code on mid range hardware
by the time your program is finished the hardware is so much faster that it won't matter
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB - upgrade incoming...)
( The path to enlightenment and the PureBasic Survival Guide right here... )
( The path to enlightenment and the PureBasic Survival Guide right here... )


