Last Comment Bug 204092 - Build NSPR on Solaris with -xO4 optimization
: Build NSPR on Solaris with -xO4 optimization
Status: RESOLVED FIXED
:
Product: NSPR
Classification: Components
Component: NSPR (show other bugs)
: 4.1.2
: Sun Solaris
: P2 normal (vote)
: 4.4
Assigned To: Kirk Erickson
: Wan-Teh Chang
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2003-05-01 11:51 PDT by Kirk Erickson
Modified: 2003-05-19 12:06 PDT (History)
5 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
Proposed patch for TIP of NSPR (562 bytes, patch)
2003-05-08 21:33 PDT, Kirk Erickson
wtc: review+
Details | Diff | Splinter Review
Selfserv Stress with proposed patch for TIP of NSPR (2.12 KB, text/html)
2003-05-08 21:36 PDT, Kirk Erickson
no flags Details
Proposed patch for NSPRPUB_RELEASE_4_1_BRANCH (477 bytes, patch)
2003-05-08 22:26 PDT, Kirk Erickson
wtc: review-
Details | Diff | Splinter Review
Proposed patch for TIP of NSPR (596 bytes, patch)
2003-05-09 01:12 PDT, Kirk Erickson
no flags Details | Diff | Splinter Review
Proposed patch for NSPRPUB_RELEASE_4_1_BRANCH (470 bytes, patch)
2003-05-15 14:26 PDT, Kirk Erickson
no flags Details | Diff | Splinter Review
Proposed patch for TIP of NSPR (512 bytes, patch)
2003-05-16 13:32 PDT, Wan-Teh Chang
kirk.erickson: review+
dbaron: approval1.4+
Details | Diff | Splinter Review
Proposed patch for NSPRPUB_RELEASE_4_1_BRANCH (430 bytes, patch)
2003-05-16 13:49 PDT, Wan-Teh Chang
no flags Details | Diff | Splinter Review

Description Kirk Erickson 2003-05-01 11:51:35 PDT
Chris, of the iWS team reported that there are no
known vulnerabilities compiling -xO4, and that the
webserver is being compiled with -xO4.

Pallab reported gains in iWS stress compiling NSS 
and NSPR -xO4.

I opened this bug to propose a patch for the TIP,
and subsequently NSPRPUB_RELEASE_4_1_BRANCH.  

Note, currently we use default optimization (-xO2) in
buiding NSPR on Solaris.  I will open a sister bug to
propose a similiar change in NSS, shifting from -xO3 
to -xO4.
Comment 1 Kirk Erickson 2003-05-08 21:33:52 PDT
Created attachment 122819 [details] [diff] [review]
Proposed patch for TIP of NSPR

Patch for the TIP of NSPR.
Comment 2 Kirk Erickson 2003-05-08 21:36:03 PDT
Created attachment 122820 [details]
Selfserv Stress with proposed patch for TIP of NSPR

This was with NSS compiled -xO3 and NSPR compile -O (-xO2),
and -xO4 (XXX-x04 runs).  Its a small gain, basically a wash.
Something like .16% at 1 op/sec on both restarts and full handshakes.

Pallab, could you document the gain you saw in iWS performance
when NSPR was compiled -xO4 compared to without (-x02), and email
me so I can update this bug and lobby for checkin?
Comment 3 Wan-Teh Chang 2003-05-08 21:46:39 PDT
Comment on attachment 122819 [details] [diff] [review]
Proposed patch for TIP of NSPR

r=wtc.
Comment 4 Kirk Erickson 2003-05-08 22:26:04 PDT
Created attachment 122823 [details] [diff] [review]
Proposed patch for NSPRPUB_RELEASE_4_1_BRANCH

Proposed patch for NSPRPUB_RELEASE_4_1_BRANCH.
Comment 5 Wan-Teh Chang 2003-05-08 22:34:04 PDT
Comment on attachment 122823 [details] [diff] [review]
Proposed patch for NSPRPUB_RELEASE_4_1_BRANCH

You need to set OPTIMIZER to -xO4 when BUILD_OPT is defined.
Comment 6 Kirk Erickson 2003-05-09 01:12:51 PDT
Created attachment 122831 [details] [diff] [review]
Proposed patch for TIP of NSPR

> You need to set OPTIMIZER to -xO4 when BUILD_OPT is defined.

Setting OPTIMIZER had no effect for me.  This patch sets
OPTIMIZER_FLAGS when MOZ_OPTIMIZE is non-zero (BUILD_OPT=1),
and we're not compiling with gcc.

NSPR before (-xO2):
-rwxrwxr-x   1 ke119340 staff	  396380 May  8 22:36 libnspr4.so
-rwxrwxr-x   1 ke119340 staff	   40080 May  8 22:37 libplc4.so
-rwxrwxr-x   1 ke119340 staff	   16756 May  8 22:36 libplds4.so

NSPR after (-xO4):
-rwxrwxr-x   1 ke119340 staff	  427492 May  9 00:43 libnspr4.so
-rwxrwxr-x   1 ke119340 staff	   40112 May  9 00:43 libplc4.so
-rwxrwxr-x   1 ke119340 staff	   18204 May  9 00:43 libplds4.so
Comment 7 Kirk Erickson 2003-05-15 14:01:29 PDT
Comment on attachment 122831 [details] [diff] [review]
Proposed patch for TIP of NSPR

Wan-Teh - we concluded this patch for the TIP was ready for checkin, right?

You liked the original, but this one differs in that MOZ_OPTIMIZE must be
non-zero.
Comment 8 Kirk Erickson 2003-05-15 14:04:06 PDT
Current NSPR version is 4.4.  Set priority P2, and target milestone 4.4.1.
Also targeting NSPRPUB_RELEASE_4_1_BRANCH.
Comment 9 Kirk Erickson 2003-05-15 14:26:27 PDT
Created attachment 123445 [details] [diff] [review]
Proposed patch for NSPRPUB_RELEASE_4_1_BRANCH

Updated 4.1 fix as per discussion with Wan-Teh yesterday.
Now we set OPTIMIZER = -xO4 when BUILD_OPT is defined.
Comment 10 Wan-Teh Chang 2003-05-16 13:32:01 PDT
Created attachment 123535 [details] [diff] [review]
Proposed patch for TIP of NSPR

This patch is essentially the same as Kirk's.
The if statement that Kirk's modifying may change
soon to test -n "$MOZ_DEBUG" instead, so it is better
not to use it.
Comment 11 Wan-Teh Chang 2003-05-16 13:49:30 PDT
Created attachment 123536 [details] [diff] [review]
Proposed patch for NSPRPUB_RELEASE_4_1_BRANCH

Kirk, your patch is incorrect because the part you modified
is ifdef'd for Solaris x86.  Please try this patch.  Thanks.
Comment 12 Kirk Erickson 2003-05-17 09:22:48 PDT
Comment on attachment 123535 [details] [diff] [review]
Proposed patch for TIP of NSPR

Apparently, this already got checked in.  It worked for me. Thank-you Wan-Teh.
Comment 13 Kirk Erickson 2003-05-17 09:33:03 PDT
Comment on attachment 123536 [details] [diff] [review]
Proposed patch for NSPRPUB_RELEASE_4_1_BRANCH

Checked in Wan-Teh's version of the 4.1 branch patch, after testing:

Checking in SunOS5.mk;
/cvsroot/mozilla/nsprpub/config/SunOS5.mk,v  <--  SunOS5.mk
new revision: 3.15.2.3; previous revision: 3.15.2.2
done
Comment 14 Kirk Erickson 2003-05-17 09:35:16 PDT
Closing.  Both the TIP and NSPRPUB_RELEASE_4_1_BRANCH
changes have been updated to compile -xO4 under Solaris.
Comment 15 Wan-Teh Chang 2003-05-17 10:24:37 PDT
Comment on attachment 123535 [details] [diff] [review]
Proposed patch for TIP of NSPR

Requesting mozilla 1.4 approval.  Compile NSPR
on Solaris with -xO4 optimization, the same
optimization level the rest of Mozilla is compiled
with
(http://lxr.mozilla.org/seamonkey/source/configure.in#1401).
Risk is low.  No known compiler optimization bugs
with -xO4.
Comment 16 Wan-Teh Chang 2003-05-19 12:06:26 PDT
Comment on attachment 123535 [details] [diff] [review]
Proposed patch for TIP of NSPR

Patch checked in on the NSPRPUB_PRE_4_2_CLIENT_BRANCH
for mozilla 1.4 final.

Note You need to log in before you can comment on or make changes to this bug.