function object on svn?

Forum for plugin, effect and behavior programmers. Please use the Help & Support forum for help using Construct.

Post » Fri Nov 04, 2011 1:12 am

@Ashley if you have the time:

found a major efficiency issue with function object where calling functions using an expression runs at about one third the speed of calling using the addparam and callfunction actions.

I remade a basic version of the function object and ran into a similar speed issue, which I fixed, and it now runs faster using expressions than the original function object using the action method. I'd like to implement this fix on the official object, and also try and find the source of some other stability and speed issues some users have mentioned. if you have a chance ashley, please add Function object to svn, or if you pm me a link, I'll fix it and add it to the svn. thanks!Kyatric2011-11-04 03:05:40
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Fri Nov 04, 2011 9:38 am

I sure do hope this happens, functions are the bread and butter of more complex projects and every bit of performance counts.
B
19
S
6
G
6
Posts: 1,101
Reputation: 5,646

Post » Fri Nov 04, 2011 7:55 pm

[Quote]Davioware found a major efficiency issue with function object where calling functions using an expression runs at about one third the speed of calling using the addparam and callfunction actions.
[/Quote]

*Cough* Fixed.

Also, Lucid, What was the bug?Davioware2011-11-04 19:58:08
B
25
S
3
G
6
Posts: 1,197
Reputation: 5,620

Post » Fri Nov 04, 2011 9:43 pm

that's true davioware, it was your discovery. you'll notice I didn't say "I" found. in that case when a sentence begins with "found", the "davioware" is assumed. as far as what the bug was - remember, my fix was on the remade function object, so it may not be the same, but the framerates were so similar, I think it probably was.

in my test version at first I had the plugin assuming all params were strings, thinking checking the type was an unnecessary step that would slow things down since construct can use them all interchangeabl. I suppose the way the runtime interprets strings is slower than floats and ints, specifically when it's converting back and forth between strings and floats, and back again, which makes sense.

I just changed it so it checks the type of each value before returning the value in the param expression. that made all the difference. 4.5x the speed lucid2011-11-05 08:05:42
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461


Return to Construct engineering

Who is online

Users browsing this forum: No registered users and 0 guests