Events versus Python - Speed test?

New releases and general discussions.

Post » Fri Jun 10, 2011 2:52 am

I did a quick test and looks like Construct events are going to be ALOT faster. It doesn't surprise me because since we have to use a Construct array then you have to use the Construct call to populate the array and I don't see a way to use Numpy and Python tricks for performance speedup.

Filled a 2000x2000 array with int 5.

In Python:

[code:3cnb83ic]
start = time.clock()
for x in xrange(1,2000):
for y in xrange(1,2000):
Array.SetAtXY(x,y,5)
end = time.clock()
final = end -start
Text.SetText("Final time: " + str(final))

[/code:3cnb83ic]

In Construct just use two named loops, the inside loop a subevent to the first.

Basic Python w/ range(): 20.40
Python w/ xrange(): 20.19
Construct For Loop: 2.28

I didn't bother to check the performance for Numpy array generation with a Python array, but either way 2.28 seconds is hard to beat.
B
8
S
3
G
7
Posts: 835
Reputation: 5,313

Post » Fri Jun 10, 2011 12:12 pm

Thanks for taking the time to do that test Dave.

I think we can conclude that, at least with it's current implementation in C1, Python is no match for Construct's events.

Thanks again guys.
Now I can concentrate on the next stage. :)

Krush.
B
2
S
2
G
3
Posts: 406
Reputation: 2,062

Previous

Return to Construct Classic Discussion

Who is online

Users browsing this forum: No registered users and 5 guests