--
You received this message because you are subscribed to the Google Groups "MOO Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to MOO-talk+unsubscribe@googlegroups.com.
To post to this group, send email to MOO-...@googlegroups.com.
Visit this group at https://groups.google.com/group/MOO-talk.
For more options, visit https://groups.google.com/d/optout.
- TimMy advice would be to just start programming very efficient MOO-code, rather than moving MOO-code to builtins.However, on nowadays hardware, a few ticks more isn't gonna hurt your MOO's performance. Also, builtins are difficult to write, can't be modified on the fly and come with risk of memory leaks (if not well programmed).is_player() and $object_utils:isa do completely different things, so there's no way to compare them.But to answer your other question: yes, builtins can be more efficient (if well programmed), simply because it doesn't have to be converted from MOO to bytecode.
2017-11-21 3:45 GMT+01:00 Wolfgang Faust <wolfg...@gmail.com>:
In general, the number of ticks used directly corresponds to CPU usage, so code that uses fewer ticks is more efficient. What does the implementation of $ou:isa() look like? All the is_player() builtin does is check the FLAG_USER on the object (plus some argument shuffling); I'm not sure how MOO code could do that without calling the builtin, or be more efficient than an array index plus a bit shift.MOO code is also blocking unless it explicitly calls suspend() or related functions; I'm not sure why isa would need to do that.
On Mon, Nov 20, 2017 at 8:08 PM, Nathan Smith <lordva...@gmail.com> wrote:
hello folks
Just a quick question for y'all tonight.
Is a builtin more efficient than a moo code that does the same thing.
The reason I ask this, is because I was experimenting with is_player(player), and $ou:isa(player, $player);
Now, is_player() uses about 4 times less ticks than isa, give or take, however, is_player is a builtin, and so we can assume blocking.
Which one, there more, is best to use.
If $ou:isa is the way to go, would it be worth putting some code it that forces any call to is_player to just be rerouted to $ou:isa?
Thanks muchly
--
You received this message because you are subscribed to the Google Groups "MOO Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to MOO-talk+u...@googlegroups.com.
To post to this group, send email to MOO-...@googlegroups.com.
Visit this group at https://groups.google.com/group/MOO-talk.
For more options, visit https://groups.google.com/d/optout.
--The views expressed above are exclusively mine, if anyone's.
--
You received this message because you are subscribed to the Google Groups "MOO Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to MOO-talk+u...@googlegroups.com.