Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pull Requests #1

Open
cchamplin opened this issue May 1, 2016 · 6 comments
Open

Pull Requests #1

cchamplin opened this issue May 1, 2016 · 6 comments

Comments

@cchamplin
Copy link

Hey, just wondering if you guys are looking for/accepting pull requests into the project?

I've done some work on a fork (static casting between v8.Value and native go types and back, wrapped go objects with prototype handlers for functions and property handling). The changes add quite a bit of boilerplate to the code, but should provide more performance around marshaling data back and forth.

Code is available here: https://github.com/cchamplin/go-v8/commits/stage

Not sure if you're interested in that kind of thing but let me know.

@forwidur
Copy link
Contributor

forwidur commented May 2, 2016

Thanks a lot for the contribution!

Let me go through your fork and see if there are breaking changes for us.

@forwidur
Copy link
Contributor

Our functional tests pass.

But the unittests seem to be failing for me:

--- FAIL: TestInterfaceWrap (0.00s)
panic: runtime error: cgo argument has Go pointer to Go pointer [recovered]
    panic: runtime error: cgo argument has Go pointer to Go pointer

goroutine 834 [running]:
panic(0xadb460, 0xc8208b5b10)
    /usr/local/go/src/runtime/panic.go:464 +0x3e6
testing.tRunner.func1(0xc8206953b0)
    /usr/local/go/src/testing/testing.go:467 +0x192
panic(0xadb460, 0xc8208b5b10)
    /usr/local/go/src/runtime/panic.go:426 +0x4e9
github.com/fluxio/go-v8.(*Prototype).AddMethod(0xc8205f3780, 0xb17aa0, 0xb, 0xc8207834c0)
    /home/mag/work/flux/genie/backend/src/github.com/fluxio/go-v8/v8.go:483 +0x16a
github.com/fluxio/go-v8.TestInterfaceWrap(0xc8206953b0)
    /home/mag/work/flux/genie/backend/src/github.com/fluxio/go-v8/v8_test.go:1023 +0x339
testing.tRunner(0xc8206953b0, 0x106a0f8)
    /usr/local/go/src/testing/testing.go:473 +0x98
created by testing.RunTests
    /usr/local/go/src/testing/testing.go:582 +0x892
exit status 2

Could you take a look?

Thanks again for contributing!

@augustoroman
Copy link

Indeed, the problem is
cchamplin@7b78893#commitcomment-17442893

On Wed, May 11, 2016 at 3:27 PM Max Grigorev [email protected]
wrote:

Our functional tests pass.

But the unittests seem to be failing for me:

--- FAIL: TestInterfaceWrap (0.00s)
panic: runtime error: cgo argument has Go pointer to Go pointer [recovered]
panic: runtime error: cgo argument has Go pointer to Go pointer

goroutine 834 [running]:
panic(0xadb460, 0xc8208b5b10)
/usr/local/go/src/runtime/panic.go:464 +0x3e6
testing.tRunner.func1(0xc8206953b0)
/usr/local/go/src/testing/testing.go:467 +0x192
panic(0xadb460, 0xc8208b5b10)
/usr/local/go/src/runtime/panic.go:426 +0x4e9github.com/fluxio/go-v8.(*Prototype).AddMethod(0xc8205f3780, 0xb17aa0, 0xb, 0xc8207834c0)
/home/mag/work/flux/genie/backend/src/github.com/fluxio/go-v8/v8.go:483 +0x16agithub.com/fluxio/go-v8.TestInterfaceWrap(0xc8206953b0)
/home/mag/work/flux/genie/backend/src/github.com/fluxio/go-v8/v8_test.go:1023 +0x339
testing.tRunner(0xc8206953b0, 0x106a0f8)
/usr/local/go/src/testing/testing.go:473 +0x98
created by testing.RunTests
/usr/local/go/src/testing/testing.go:582 +0x892
exit status 2

Could you take a look?

Thanks again for contributing!


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
#1 (comment)

@cchamplin
Copy link
Author

Ah, ya been testing on 1.5. I was hoping to avoid doing a map lookup for the function pointer and wrapper data after we call back into Go (for performance reasons). We're already losing ~160ns every time we traverse between Go and C :-/.

I'll try and get a rework committed in the next day or so. Thanks for the review!

@forwidur
Copy link
Contributor

forwidur commented May 12, 2016

We're already losing ~160ns every time we traverse between Go and C :-/.

Looks too high, how did you measure that? Should not be more than a 100 or so instructions.

Thanks for the review!

Thanks for doing the work! :-D

@cchamplin
Copy link
Author

That figure comes from Russ Cox (https://groups.google.com/d/msg/golang-nuts/NNaluSgkLSU/0bq1kXZueCwJ) and Mikael Gustavsson. It's mostly a result of go establishing a global local every time it crosses the go->c boundary

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants