A place to discuss everything related to Newton Dynamics.
Moderators: Sascha Willems, walaber
by tshannon » Wed Oct 10, 2012 12:28 pm
I'm probably prematurely optimizing, but I'm a little concerned about the fact that forces seem to only be applied during callback.
I'm working on bindings for the Go language, and right currently there is some considerable overhead for c callbacks in Go code.
Is there any such concept as default force like gravity constantly applied internally in the newton loop?
I haven't done any benching yet to see how much of a problem it'll be, but I'm wondering if I'll have to write some C wrapper code to handle this callback entirely in C so I never have to make the translation to Go. Or maybe handle the callbacks in batch or something.
-
tshannon
-
- Posts: 22
- Joined: Wed Sep 05, 2012 3:21 pm
by Julio Jerez » Wed Oct 10, 2012 12:44 pm
No Newton does not has a default force.
A call back is function call, also virtual functions are call backs.
The overheaded a callback is or the order 1 to a 10 million time to one the cost of the inner loop of a calculation contact and internal reaction forces.
I has writen bindeing pluging for intepreted languages for newton, and even there cost of calling force and touque is neglegible, including languages like Phyton
-
Julio Jerez
- Moderator

-
- Posts: 12426
- Joined: Sun Sep 14, 2003 2:18 pm
- Location: Los Angeles
-
by tshannon » Wed Oct 10, 2012 1:56 pm
Alright. As I said, I may be prematurely optimizing something that's not an issue.
Thanks,
-
tshannon
-
- Posts: 22
- Joined: Wed Sep 05, 2012 3:21 pm
by Julio Jerez » Wed Oct 10, 2012 2:16 pm
In Newton all calbacks are dispached in bach and mode from mutiple threads. They are all re-entrant.
if you assign the same callback to most bodies, the the cost is neglegible because of all of the Branch prediction in maximized
and code cache misses is minimized.
Believe me this is not a problem even on languages like Objective C or Visual basic or even Lua and Phyton, I do not think ti si a proble with GO
-
Julio Jerez
- Moderator

-
- Posts: 12426
- Joined: Sun Sep 14, 2003 2:18 pm
- Location: Los Angeles
-
Return to General Discussion
Who is online
Users browsing this forum: No registered users and 0 guests