MMGC_MEMORY_PROFILER exacts a price even when disabled

RESOLVED DUPLICATE of bug 660800

Status

Tamarin
Profiler
P3
normal
RESOLVED DUPLICATE of bug 660800
8 years ago
7 years ago

People

(Reporter: Lars T Hansen, Unassigned)

Tracking

(Blocks: 3 bugs)

unspecified
Q1 12 - Brannan
x86
Mac OS X
Dependency tree / graph
Bug Flags:
flashplayer-bug +

Details

(Whiteboard: PACMAN)

Attachments

(1 obsolete attachment)

(Reporter)

Description

8 years ago
The machine is a MacPro, Release builds.  'avm' is TR and 'avm2' is TR with MMGC_MEMORY_PROFILER disabled, no other difference.

Slowdowns of 5-10% are typical when the profiler support is compiled in.  This difference is to a significant extent attributable to double boxing - the fast AllocDouble method can't be used when the profiler is enabled.  Even when AllocDouble is disabled in a non-profiler build are there strange outliers.

We need to reduce this overhead to make DEBUGGER builds affordable, but we also need to be sure to disable MMGC_MEMORY_PROFILER in non-DEBUGGER builds.

(Since AllocDouble makes such a huge difference it's probably the case that many of these benchmarks are not representative of flash apps.)

test                                                   avm    avm2     %sp 

scimark/FFT.as                                        3844    3505     8.8 
scimark/LU.as                                         4237    3997     5.7 
scimark/MonteCarlo.as                                 3659    3405     6.9 
scimark/SOR.as                                        4113    3706     9.9 
scimark/SparseCompRow.as                               140     135     3.6 

v8/crypto.as                                           317     332     4.7
v8/deltablue.as                                        652     656     0.6
v8/raytrace.as                                        1996    2095     5.0
v8/richards.as                                         634     648     2.2
v8/typed/crypto.as                                     327     344     5.2
v8/typed/deltablue.as                                 1081    1080    -0.1
v8/typed/raytrace.as                                  3971    4055     2.1
v8/typed/richards.as                                  1558    1591     2.1

jsbench/Crypt.as                                      5336    4831     9.5
jsbench/Euler.as                                     11564   10801     6.6
jsbench/FFT.as                                        9934    9218     7.2
jsbench/HeapSort.as                                   4859    4862    -0.1
jsbench/LUFact.as                                    11553   10661     7.7
jsbench/Moldyn.as                                    13348   12138     9.1
jsbench/RayTracer.as                                 12170   11281     7.3
jsbench/Series.as                                    13933   12087    13.2
jsbench/SOR.as                                       46996   42271    10.1
jsbench/SparseMatmult.as                             18669   17568     5.9
jsbench/typed/Crypt.as                                1154    1181    -2.3
jsbench/typed/Euler.as                               13284   11917    10.3
jsbench/typed/FFT.as                                  5656    5104     9.8
jsbench/typed/HeapSort.as                             2152    2043     5.1
jsbench/typed/LUFact.as                              11879   10344    12.9
jsbench/typed/Moldyn.as                               5756    5336     7.3
jsbench/typed/RayTracer.as                            2020    2030    -0.5
jsbench/typed/Series.as                              13033   11311    13.2
jsbench/typed/SOR.as                                 34735   30349    12.6
jsbench/typed/SparseMatmult.as                        3216    3224    -0.2

mmgc/gcbench.as                                       4354    4330     0.6
mmgc/ofib-rc.as                                        334     330     1.2
mmgc/ofib.as                                          1289    1246     3.3
mmgc/sfib.as                                           576     543     5.7


With AllocDouble disabled in avm2: some highlights (all others are < 4% slower):

test                                                   avm    avm2     %sp

mmgc/ofib.as                                          1289    1231     4.5
mmgc/sfib.as                                           575     543     5.6

jsbench/Crypt.as                                      5309    4747    10.6
jsbench/Series.as                                    13861   12233    11.7
jsbench/typed/HeapSort.as                             2155    2058     4.5
jsbench/typed/Series.as                              13011   11947     8.2
(Reporter)

Comment 1

8 years ago
Created attachment 412465 [details] [diff] [review]
Disable profiler in non-DEBUGGER builds

Will also submit this to the Player, if appropriate.
Attachment #412465 - Flags: review?(treilly)

Updated

8 years ago
Attachment #412465 - Flags: review?(treilly) → review+

Comment 2

8 years ago
its appropriate, using debugger builds for memory profiler is a nice compromise of convienence vs. performance
(Reporter)

Comment 3

8 years ago
Comment on attachment 412465 [details] [diff] [review]
Disable profiler in non-DEBUGGER builds

redux changeset:   3122:ec20090ae5b9

Leaving bug open:
- need to export this fix to the Player
- need to consider the AllocDouble optimization even when the memory profiler is enabled, at least in R-D builds
- need to figure out why some programs are much slower even when removing the AllocDouble optimization
Attachment #412465 - Attachment is obsolete: true
(Reporter)

Updated

8 years ago
Priority: -- → P3
Target Milestone: --- → flash10.1
(Reporter)

Comment 4

8 years ago
Submitted proposed change to avmhost-features for review by Steven / Jim Corbett.
(Reporter)

Updated

8 years ago
Whiteboard: Has patch
(Reporter)

Comment 5

8 years ago
Status:

- Jim says Steven has approval rights for the patch; Steven says he'll push the
  patch to the Player code
- AllocDouble will be more generally applicable after the streamlining of
  GC::Alloc (bug #528338) lands
- We should re-measure once the streamlining patch lands because it changes
  the structure of GC::Alloc and GC::Free very much.

As a result of the above I'm lowering the priority of this bug to "nice to have".
Priority: P3 → P5
(Reporter)

Updated

8 years ago
Whiteboard: Has patch

Updated

8 years ago
Target Milestone: flash10.1 → flash10.2

Comment 6

8 years ago
Note that we recently stopped locking the GCHeap lock on every alloc/free which should help.

Updated

8 years ago
Blocks: 555460
(Reporter)

Updated

8 years ago
Assignee: lhansen → nobody
Status: ASSIGNED → NEW
Priority: P5 → P3
Summary: [Speed] MMGC_MEMORY_PROFILER exacts a price even when disabled → MMGC_MEMORY_PROFILER exacts a price even when disabled
Whiteboard: Performance
(Reporter)

Comment 7

8 years ago
We need to re-test now and either do further work or close it.
Whiteboard: Performance → PACMAN
(Reporter)

Updated

8 years ago
Component: Garbage Collection (mmGC) → Profiler
QA Contact: gc → profiler

Updated

7 years ago
Flags: flashplayer-bug+

Updated

7 years ago
Blocks: 605516

Comment 8

7 years ago
I added a dependency edge to bug 605516 (removing DEBUGGER config); feel free to remove the edge if its invalid.  if we close this bug then its moot anyway.

Updated

7 years ago
Blocks: 645018

Updated

7 years ago
Target Milestone: Q3 11 - Serrano → Q1 12 - Brannan
(Reporter)

Updated

7 years ago
Status: NEW → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 660800
You need to log in before you can comment on or make changes to this bug.