Simon Gust
Member
Might as well make it a thread if that is legal.
What I want here is for people to take similar functions or whole methods and compare their speed.
Like distance_to_object() vs distance_to_point() vs point_distance().
While the functions are different and might not work for every situation, it is still interesting to see which one is really faster. I mean, the GM devs could tell us but where would the fun be in that.
To start this off, like I declared in my status update I wanted to know what the fastest way it is to fill a 128x128 sized surface with pixels of various colors. I will go into it later but clear is:
draw_sprite() not so fast (sprite is 1 pixel large)
draw_point_colour() fast (a bit better than draw_point() with draw_set_color())
draw_vertex_colour() very fast (~50% faster)
all three fulfill the purpose of filling the surface with points / pixels.
So, what are your thoughts? Is it faster for you too? Are there even faster ways?
What I want here is for people to take similar functions or whole methods and compare their speed.
Like distance_to_object() vs distance_to_point() vs point_distance().
While the functions are different and might not work for every situation, it is still interesting to see which one is really faster. I mean, the GM devs could tell us but where would the fun be in that.
To start this off, like I declared in my status update I wanted to know what the fastest way it is to fill a 128x128 sized surface with pixels of various colors. I will go into it later but clear is:
draw_sprite() not so fast (sprite is 1 pixel large)
draw_point_colour() fast (a bit better than draw_point() with draw_set_color())
draw_vertex_colour() very fast (~50% faster)
all three fulfill the purpose of filling the surface with points / pixels.
So, what are your thoughts? Is it faster for you too? Are there even faster ways?