would creating bindings to a physics engine via cgo see any significant decrease in performance?
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
would creating bindings to a physics engine via cgo see any significant decrease in performance?
On Monday, November 30, 2009 2:23:05 PM UTC-8, adam_smith wrote:
And what happens when I'm using gccgo compiler?
Do functions from the go compiled code and C libraries have the same calling conventions, thus the overhead is zero?
the overhead for translating between calling convention and switch stacks is small,the major part of cgo overhead comes from coordination with the goroutine scheduler.(for example, the scheduler might need to create new OS thread to run other readygoroutines)
I understand that the stack needs to be switched, but minux implied
that this isn't where most of the overhead comes from. The call to a C
function may also spawn a new thread, which would be used for running
other goroutines. Erwin and I are just wondering whether this is
really necessary.
> http://play.golang.org/p/0Nc6Dlj6lU
>
> Here are the results:
>
> Before the patch: 820.0469ms
> After the patch (syscall on): 841.0481ms
> After the patch (syscall off): 326.0186ms
Forgot to mention that calling the regular Go test() function takes
35.002ms in my example (with inlining disabled), so cgo is still 9x
slower, but that's a lot better than 24x.
Selected and weighted 'how-many-times-more compared to the-program-that-used-least' scores are compressed into one number, the weighted geometric mean, at the risk of being "neat, plausible, and wrong".
They are claiming to be "at the risk of being \"neat, plausible, and wrong\"."Thanks,
The patch sounds great. I think It is better to move responsibility for thread blocking to user C code. If the code does a lot of computation, then he needs to consider running it in separate OS thread.
Still didn't get an answer for Do functions from the gccgo compiled code and gcc complied C libraries have the same calling conventions?
On Mar 2, 2013 5:11 PM, "Robert Zaremba" <robert....@zoho.com> wrote:
>
> Still didn't get an answer for Do functions from the gccgo compiled code and gcc complied C libraries have the same calling conventions?
Yes, they do. Multiple return values are handled as a struct.
The cgo code for gccgo is simpler (take a look). But it still has to switch stacks.
Ian
think this behavior is appropriate when executing any and all CThe scheduler interaction makes sense for system calls, but I don't
functions.
Even in that perfect world cgo is currently necessary, because youneed to tell that Go scheduler that you might be about to block in a
way that the Go scheduler does not understand.
When and if the Go scheduler gets smarter, then it is possible to
imagine that cgo would not be necessary for gccgo if you were able to
compile all of your C libraries with -fsplit-stack.
Here's a vote for a new runtime.CgoSyscallOff bool option... who's with me?
preventing other goroutines from running while in cgo, but assumingCan you clarify how my patch could lead to a deadlock? I can see it
that cgo returns eventually, wouldn't the scheduler just pick up where
it left off?
El lunes, 4 de marzo de 2013 00:12:23 UTC, Isaac Gouy escribió:Now, here, we have Archos pointing to an obscure table of geometric means, supposedly as some-kind-of evidence to do with binding to a C library -- instead of actually finding data to do with binding to a C library. (Hint -- regex-dna.c in go/test/bench/shootout uses pcre, maybe compare it with a Go program that uses a pcre binding.)
If you think that the Shootout benchmark is irrelevant then ...
Irrelevant because the regexp package is not optimized and it is know to be quite slow.
in fact is one of the packages with worst performance in the Go standard library.
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
My use case is to use rrdtool through go binding (using cgo - https://github.com/ziutek/rrd) for hight traffic server.
Then when it comes to handle 1k concurrent request / second, and on each request I want to fire some event to rrdtool, then this rrd will force to create 1k real OS threads?
Thanks,
So my statement is true?
And the right way to do (when the request time is smaller then launching new OS thread) it is to control the number of cgo using appropriate Semaphore.