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

Disable zealous GC in release builds. #60

Merged
merged 1 commit into from Nov 9, 2015

Conversation

@asajeffrey
Copy link
Member

asajeffrey commented Nov 3, 2015

Review on Reviewable

@jdm
Copy link
Member

jdm commented Nov 3, 2015

@bors-servo
Copy link
Contributor

bors-servo commented Nov 3, 2015

📌 Commit 049d78d has been approved by jdm

@bors-servo
Copy link
Contributor

bors-servo commented Nov 3, 2015

Testing commit 049d78d with merge 6abb142...

bors-servo added a commit that referenced this pull request Nov 3, 2015
Disable zealous GC in release builds.



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/mozjs/60)
<!-- Reviewable:end -->
@jdm
Copy link
Member

jdm commented Nov 3, 2015

@michaelwu
Copy link
Contributor

michaelwu commented Nov 3, 2015

It's not enabled. An additional env flag is required to turn it on.

@bors-servo
Copy link
Contributor

bors-servo commented Nov 3, 2015

☀️ Test successful - travis

@asajeffrey
Copy link
Member Author

asajeffrey commented Nov 3, 2015

Running the Dromaeo JS tests with and without gczeal enabled at compile-time... Without gczeal: http://i.imgur.com/iXNJf9e.png. With gczeal: http://i.imgur.com/FP17NH3.png. Looks like about 5% difference in performance on tests which perform allocation.

@jdm
Copy link
Member

jdm commented Nov 3, 2015

Ok! A measurable difference is a valid reason to turn it off, I think.

@jdm
Copy link
Member

jdm commented Nov 3, 2015

@bors-servo
Copy link
Contributor

bors-servo commented Nov 3, 2015

📌 Commit 049d78d has been approved by jdm

@michaelwu
Copy link
Contributor

michaelwu commented Nov 4, 2015

@bors-servo: r-
(don't think it matters but I'll r- to be sure)

There are functions which are only built when GC zeal is enabled, but which are specified in the bindings. You'll have to remove the GC zeal functions in the bindings to make this work everywhere. Unfortunately, the platforms we actually test on normally don't show this problem, but it can break windows and android.

I agree with this change, btw. It was only due to linking that zeal needed to be enabled everywhere, but I don't think we need to set the zeal from code. Setting zeal via env vars should be enough.

@asajeffrey
Copy link
Member Author

asajeffrey commented Nov 5, 2015

Hmm, that's annoying. We're living with a 5% slowdown because of issues on platforms we don't test against. We should at least open an issue for this and leave it open until we fix the bindings.

@michaelwu
Copy link
Contributor

michaelwu commented Nov 5, 2015

Fix the bindings and this can land. This affects Android, Windows, and CEF bindings. I think you just need to delete the gc zeal functions in all the jsapi_* files.

@asajeffrey
Copy link
Member Author

asajeffrey commented Nov 5, 2015

OK, I'll have a look at the jsapi files later today.

@asajeffrey
Copy link
Member Author

asajeffrey commented Nov 5, 2015

@michaelwu are you meaning:

$ grep -ir zeal rust-mozjs/
rust-mozjs/src/jsapi_linux_32.rs: #[link_name = "Z12JS_GetGCZealP9JSContextPhPjS2"]
rust-mozjs/src/jsapi_linux_32.rs: pub fn JS_GetGCZeal(cx: *mut JSContext, zeal: *mut u8,
rust-mozjs/src/jsapi_linux_32.rs: #[link_name = "_Z12JS_SetGCZealP9JSContexthj"]
rust-mozjs/src/jsapi_linux_32.rs: pub fn JS_SetGCZeal(cx: *mut JSContext, zeal: u8, frequency: u32);
rust-mozjs/src/jsapi_macos_64.rs: #[link_name = "Z12JS_GetGCZealP9JSContextPhPjS2"]
rust-mozjs/src/jsapi_macos_64.rs: pub fn JS_GetGCZeal(cx: *mut JSContext, zeal: *mut u8,
rust-mozjs/src/jsapi_macos_64.rs: #[link_name = "_Z12JS_SetGCZealP9JSContexthj"]
rust-mozjs/src/jsapi_macos_64.rs: pub fn JS_SetGCZeal(cx: *mut JSContext, zeal: u8, frequency: u32);
rust-mozjs/src/lib.rs:pub const JS_DEFAULT_ZEAL_FREQ: u32 = 100;
rust-mozjs/src/jsapi_windows_gcc_64.rs: #[link_name = "Z12JS_GetGCZealP9JSContextPhPjS2"]
rust-mozjs/src/jsapi_windows_gcc_64.rs: pub fn JS_GetGCZeal(cx: *mut JSContext, zeal: *mut u8,
rust-mozjs/src/jsapi_windows_gcc_64.rs: #[link_name = "_Z12JS_SetGCZealP9JSContexthj"]
rust-mozjs/src/jsapi_windows_gcc_64.rs: pub fn JS_SetGCZeal(cx: *mut JSContext, zeal: u8, frequency: u32);
rust-mozjs/src/jsapi_linux_64.rs: #[link_name = "Z12JS_GetGCZealP9JSContextPhPjS2"]
rust-mozjs/src/jsapi_linux_64.rs: pub fn JS_GetGCZeal(cx: *mut JSContext, zeal: *mut u8,
rust-mozjs/src/jsapi_linux_64.rs: #[link_name = "_Z12JS_SetGCZealP9JSContexthj"]
rust-mozjs/src/jsapi_linux_64.rs: pub fn JS_SetGCZeal(cx: *mut JSContext, zeal: u8, frequency: u32);

Should I just put #[cfg(debugmozjs)] in front of each declaration?

@michaelwu
Copy link
Contributor

michaelwu commented Nov 6, 2015

According to https://github.com/servo/mozjs/blob/master/mozjs/js/src/jsapi.h#L4809 there's one function you're missing.

Don't make it conditional. Just delete it. The bindings generator can't generate conditional things so it's not worth it.

@asajeffrey
Copy link
Member Author

asajeffrey commented Nov 6, 2015

OK, I removed them from the generated rust-mozjs/src/jsapi_ARCH.rs files, it works locally (where ARCH is linux_64). Are these files regenerated from mozjs/mozjs/js/src/jsapi.h? If so, should the zeal functions also be removed from jsapi.h, jsapi.hpp and jsapi.cpp?

@michaelwu
Copy link
Contributor

michaelwu commented Nov 7, 2015

No, don't modify the c++ files. The functions are already removed when gc zeal isn't enabled. If they weren't removed then we wouldn't have to remove them from the bindings.

@asajeffrey
Copy link
Member Author

asajeffrey commented Nov 7, 2015

Will do. Of course, this is over in another repo, so I'll submit another PR.

asajeffrey added a commit to asajeffrey/rust-mozjs that referenced this pull request Nov 7, 2015
PR servo/mozjs#60 removes gczeal in release builds.
This gets about a 5% speedup in some Dromaeo JS tests.
Unfortunately, it leaves some dangling symbols that are in the jsapi_ARCH.rs
files, but hace no matching jsapi definitions. This commit removes those
definitions from the bindings.

See servo/mozjs#60 (comment)
@asajeffrey
Copy link
Member Author

asajeffrey commented Nov 7, 2015

@michaelwu: I submitted a PR removing the gczeal bindings servo/rust-mozjs#212

bors-servo added a commit to servo/rust-mozjs that referenced this pull request Nov 7, 2015
Removed gczeal bindings.

PR servo/mozjs#60 removes gczeal in release builds.
This gets about a 5% speedup in some Dromaeo JS tests.
Unfortunately, it leaves some dangling symbols that are in the jsapi_ARCH.rs
files, but hace no matching jsapi definitions. This commit removes those
definitions from the bindings.

See servo/mozjs#60 (comment)

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/rust-mozjs/212)
<!-- Reviewable:end -->
@michaelwu
Copy link
Contributor

michaelwu commented Nov 7, 2015

@bors-servo
Copy link
Contributor

bors-servo commented Nov 7, 2015

📌 Commit 049d78d has been approved by michaelwu

@asajeffrey
Copy link
Member Author

asajeffrey commented Nov 7, 2015

@michaelwu: Thanks!

@larsbergstrom
Copy link
Contributor

larsbergstrom commented Nov 9, 2015

@bors-servo retry try- r=michaelwu

@bors-servo
Copy link
Contributor

bors-servo commented Nov 9, 2015

📌 Commit 049d78d has been approved by michaelwu

@bors-servo
Copy link
Contributor

bors-servo commented Nov 9, 2015

Testing commit 049d78d with merge 3ed24a9...

bors-servo added a commit that referenced this pull request Nov 9, 2015
Disable zealous GC in release builds.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/mozjs/60)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Nov 9, 2015

☀️ Test successful - travis

@bors-servo bors-servo merged commit 049d78d into servo:master Nov 9, 2015
1 of 2 checks passed
1 of 2 checks passed
homu Testing commit 049d78d with merge 3ed24a9...
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants
You can’t perform that action at this time.