Closed Bug 137559 Opened 22 years ago Closed 12 years ago

OS X: Mozilla gives fewer nullEvents than expected to plugin

Categories

(Core Graveyard :: Plug-ins, defect, P2)

PowerPC
macOS
defect

Tracking

(Not tracked)

RESOLVED INVALID
Future

People

(Reporter: msintov, Unassigned)

Details

(Keywords: perf, Whiteboard: [FLASH][PL2:NA],top100)

From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0b; Windows NT 5.0)
BuildID:    20011022

Netscape 6.2 on OS X gives a plugin fewer nullEvents than expected.  The Flash 
Plugin currently does not fully use Carbon Events, and thus relies on 
nullEvents for processing time.  This setup works for Classic Netscape browsers 
(including 4.* and 6.2, though we do see a slight decrease in nullEvents in the 
Classic 6.2 build), but for OS X Netscape 6.2, the number of nullEvents 
received drops significantly.  As a comparison, OS X NS 6.2 hands off 25% of 
the nullEvents that OS X IE 5.1 does.

Reproducible: Always
Steps to Reproduce:
1. Create a plugin that does nothing other than count the number of nullEvents 
received, by putting a global counter in npshell.cpp and incrementing it when 
NPP_HandleEvent receives a nullEvent.
2. Install this plugin.
3. Run the browser.
4. Navigate to content that uses this plugin.
5. Observe the event counter and compare to other browsers.

Actual Results:  The number of nullEvents received by the plugin on OS X NS 6.2 
is far fewer than on Classic NS 4.* or 6.2, or OSX IE 5.1.

Expected Results:  More idle time should be provided to the plugin via 
nullEvents.
QA Contact: madhur → rakeshmishra
Michelle, can you reproduce this problem using a Mozilla (rather than Netscape)
build?
Assignee: joki → beppe
Severity: enhancement → normal
Component: Event Handling → Plug-ins
QA Contact: rakeshmishra → shrir
Michelle,
Do you find the same is true with recent Mozilla nightly builds:
http://ftp.mozilla.org/pub/mozilla/nightly/latest/

I wonder if the timer is not going off enough or its being starved?
Assignee: beppe → peterl
Status: UNCONFIRMED → NEW
Ever confirmed: true
Confirming this is still happening with a testcase Michelle sent.

I think maybe a tester plugin may be needed here to more accuratly measure the
rate of nullevents sent to IE, 4.x, and Opera and compare to us.
Status: NEW → ASSIGNED
Keywords: 4xp
Priority: -- → P3
Summary: OS X Netscape 6.2 gives fewer nullEvents than expected to plugin → OS X: Mozilla gives fewer nullEvents than expected to plugin
Whiteboard: [FLASH]
Target Milestone: --- → mozilla1.1alpha
4.x sent null events, from the main event loop, whenever the program was idle.
This basically sent messages as fast as possible when nothing else was
happening. We are now sending these messages at a fixed interval... when we send
them too fast we kill the cpu and/or block other timer processing, when we send
them to slowly macromedia complains. ;)

Other timer related bugs I'm aware of are bug 111982 and bug 123273. Although
these are related to the SetTimeout() timer, the problem remains the same... too
many timer callbacks kills the system, too few appears to be non-performant.

I think we really need to come up with a better model for giving time which is
dependent on the current cpu load rather than on fixed interval timers.
In the CarbonEvent world where RunApplicationEventLoop replaces WaitNextEvent
the concept of application idle time breaks down.  A periodic timer is the new
solution but, as Brian notes, the issue is what frequency to set for this timer.
 Since the needed/desired frequency varies from plugin to plugin perhaps it's
time to expand the plugin API to allow a plugin to specify the refresh rate it
needs/wants? 
Whiteboard: [FLASH] → [FLASH][PL2:NA]
adding nsbeta1+
Keywords: nsbeta1+
Target Milestone: mozilla1.1alpha → mozilla1.2alpha
Target Milestone: mozilla1.2alpha → mozilla1.3alpha
moving to 1.3 beta
Target Milestone: mozilla1.3alpha → mozilla1.3beta
nsbeta1-. Peter is overloaded with higher priority issues.
Keywords: nsbeta1+nsbeta1-
Priority: P3 → P2
Target Milestone: mozilla1.3beta → Future
apple seems to have solved the flash plugin problem with their lates Safari release.
the speed greatly increased. still not as good as IE, but they are close. also opening 
multiple browser windows with cpu-intensive flash content won't bring safari down as it 
can Mozilla.

maybe you guys should have a chat? ;-)

environment: OS X 10.2.4
Whiteboard: [FLASH][PL2:NA] → [FLASH][PL2:NA],top100
There's no reason Mac plugins have to be fed null events in a CFRunLoop world.
The plugins could just install Carbon timers, or do other CFRunLoop magic.

Michelle: is this still an issue?
(In reply to comment #10)
> There's no reason Mac plugins have to be fed null events in a CFRunLoop world.
> The plugins could just install Carbon timers, or do other CFRunLoop magic.
> Michelle: is this still an issue?

Yes, this is still an issue. Do you think that if we used Carbon timers, the 
Flash Player would get more time and we wouldn't have timing problems with the 
browser? We are very interested in finding a solution so please feel free to 
email me offline: msintov@macromedia.com.
Michelle, is this still unresolved?
Assignee: peterl-bugs → nobody
Status: ASSIGNED → NEW
QA Contact: shrir → plugins
Plugins should not be relying on nullEvents and we aren't going to be providing further fixes for for the Carbon or classic event models unless they are critical.
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → INVALID
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.