Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 454720 - dev-lang/v8 compiled with snapshot=off noticeably slower on sunspider
Summary: dev-lang/v8 compiled with snapshot=off noticeably slower on sunspider
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Chromium Project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-30 17:36 UTC by wbrana
Modified: 2013-02-18 21:49 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Diff against v8-3.16.11.1 (v8-ebuild.patch,1.29 KB, patch)
2013-02-17 22:04 UTC, Mike Gilbert
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description wbrana 2013-01-30 17:36:02 UTC
Sunspider 0.9.1 http://www.webkit.org/perf/sunspider/sunspider.html

173.2 ms Chrome
185.8 ms Chromium

Chromium was compiled with compiler and flags which should be very similar to ones used with Chrome

GCC 4.4.7
www-client/chromium: -O2 -march=x86-64 -fomit-frame-pointer
dev-lang/v8: -O3 -march=x86-64 -fomit-frame-pointer

using different flags with v8 didn't help
Comment 1 Paweł Hajdan, Jr. (RETIRED) gentoo-dev 2013-01-31 11:50:56 UTC
Please stop it. I've said "Feel free to file a separate bug after figuring out why exactly the slowdown occurs.". This bug is just re-iterating the 7% slowdown on your system.

Some possible things to try:

1. Compile chromium in "vanilla" configuration, e.g. no system libs on your system.

2. Use a more recent gcc.

3. Have a _hypothesis_ that can be validated. Do not just say it's slower and post some numbers and flags. Say why you think it's slower, post the number and flags, and also post the numbers for your suggested fix.

4. If your suggested fix is to use google-chrome, why don't you do just that? :) Benchmarks do depend on how things have been compiled, that's no news.

5. I'm still open to possible ideas for improvements (we *might* even get back to bundled v8 since both projects are closely related, and other consumers of v8 seem not to keep up with the updates - e.g. nodejs), but for that you need to suggest a change and provide performance data for the case with and without the change.

*** This bug has been marked as a duplicate of bug 454542 ***
Comment 2 wbrana 2013-01-31 12:46:37 UTC
about half of difference is caused by v8 compiled with snapshot=off on hardened

with system v8 compiled with snapshot=on
177.8 ms with GCC 4.7 and custom-cflags
~180 ms with GCC 4.4.7

I prefer to use web browser compiled on my machine because of various reasons.
Comment 3 Paweł Hajdan, Jr. (RETIRED) gentoo-dev 2013-02-01 11:49:46 UTC
(In reply to comment #2)
> about half of difference is caused by v8 compiled with snapshot=off on
> hardened
> 
> with system v8 compiled with snapshot=on
> 177.8 ms with GCC 4.7 and custom-cflags
> ~180 ms with GCC 4.4.7
> 
> I prefer to use web browser compiled on my machine because of various
> reasons.

This is reasonable. I'll look into making it possible to build with snapshot=on on hardened (PaX).
Comment 4 Mike Gilbert gentoo-dev 2013-02-06 17:28:13 UTC
(In reply to comment #3)
> This is reasonable. I'll look into making it possible to build with
> snapshot=on on hardened (PaX).

I think we will have to pax-mark the mksnapshot program part-way through the build process to make this happen.
Comment 5 Mike Gilbert gentoo-dev 2013-02-17 22:04:20 UTC
Created attachment 339190 [details, diff]
Diff against v8-3.16.11.1

Here's an ebuild patch that should work. Please review.

To summarize it:

1. Define src_configure, and move all the gyp-related logic there.

2. Call make to generate out/Makefile.${myarch} using gyp.

3. In src_compile, call make to build the mksnapshot command, and then pax-mark it.

4. Call make again to generate the snapshot file and build the rest of the binaries.

I think this should be pretty reliable, unless v8 upstream makes some major change to their top-level makefile.
Comment 6 Paweł Hajdan, Jr. (RETIRED) gentoo-dev 2013-02-18 10:42:21 UTC
(In reply to comment #5)
> Created attachment 339190 [details, diff] [details, diff]
> Diff against v8-3.16.11.1
> 
> Here's an ebuild patch that should work. Please review.

LGTM (Looks Good To Me). Awesome!
Comment 7 Mike Gilbert gentoo-dev 2013-02-18 16:54:41 UTC
+  18 Feb 2013; Mike Gilbert <floppym@gentoo.org> v8-3.16.11.1.ebuild,
+  v8-9999.ebuild:
+  Adjust build process to enable snapshot on PaX systems, bug 454720.

Should we apply this for 3.15?
Comment 8 Paweł Hajdan, Jr. (RETIRED) gentoo-dev 2013-02-18 21:30:00 UTC
(In reply to comment #7)
> +  18 Feb 2013; Mike Gilbert <floppym@gentoo.org> v8-3.16.11.1.ebuild,
> +  v8-9999.ebuild:
> +  Adjust build process to enable snapshot on PaX systems, bug 454720.
> 
> Should we apply this for 3.15?

Up to you. Fine for me. :)
Comment 9 Mike Gilbert gentoo-dev 2013-02-18 21:49:14 UTC
Done.

@wbrana: If you find any other ways to improve performance here, let us know.