Re: Harmful Notification Post Rate

2018-03-30 Thread Quincey Morris
On Mar 30, 2018, at 12:22 , Richard Charles  wrote:
> 
> My custom view implements -[NSResponder mouseDragged:] but this has never 
> caused any problems.

I don’t have much to suggest except “try stuff”. I’d try to see what happened 
if I commented out the “mouseDragged” override, if I commented out its contents 
(so that it swallowed the event), and if I commented out its contents but added 
[super mouseDragged: event] to pass the event up the chain.

I wonder if the message reflects the amount of time your mouseDragged is taking 
to handle the event? Maybe 112.994 is “harmful" only because it’s detected that 
your code can’t handle that many per second.

It’s also possible that message is something you can validly ignore. Does it 
happen in a release build, too?

Lastly, what kind of input device is producing these rates? Is it a mouse or a 
trackpad or something else? There might be something to chase after in that 
direction.

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Harmful Notification Post Rate

2018-03-30 Thread Richard Charles
> On Mar 29, 2018, at 10:49 PM, Quincey Morris 
> <quinceymor...@rivergatesoftware.com> wrote:
> 
> On Mar 29, 2018, at 21:00 , Richard Charles <rcharles...@gmail.com> wrote:
>> 
>> How can I figure out what notification is posting at a high rate?
> 
> Not sure, but have you turned on “NSWindow.acceptsMouseMovedEvents” by any 
> chance?

I have not called -[NSWindow acceptsMouseMovedEvents]. My custom view 
implements -[NSResponder mouseMoved:] but the frameworks never call this method 
during a mouse drag.

My custom view implements -[NSResponder mouseDragged:] but this has never 
caused any problems. When I turn on custom logging for mouseDragged: I get 
following output.

Mouse Dragged Rate: 125.7 events per second
Mouse Dragged Rate: 124.1 events per second
Mouse Dragged Rate: 124.2 events per second
Mouse Dragged Rate: 124.8 events per second
Mouse Dragged Rate: 125.2 events per second
Mouse Dragged Rate: 124.6 events per second
Mouse Dragged Rate: 168.3 events per second
2018-03-30 12:58:01.798960-0600 Xsolid[72930:1753914] Detected potentially 
harmful notification post rate of 112.994 notifications per second

This is confusing because several years ago I turned on custom logging and 
recorded that AppKit would throttle NSLeftMouseDragged events to a maximum of 
about 60.0 events per seconds but that obviously is not the case now.

To try and track down the problem I implemented notification logging by 
swizzling the following methods.

-[NSNotification postNotification:]
-[NSNotification postNotificationName:object:]
-[NSNotification postNotificationName:object:userInfo:]

Here is the output when dragging with the mouse in the custom view. I manually 
formatted the output with blank lines after the fact to make it more readable.

NotificationName  TimeIntervalInSeconds
===

NSApplicationWillBecomeActiveNotification   986.597
NSApplicationWillBecomeActiveNotification   986.597
NSApplicationDidBecomeActiveNotification986.597
NSApplicationDidBecomeActiveNotification986.597
NSWindowDidBecomeMainNotification   986.602
NSWindowDidBecomeMainNotification   986.602

MyDocumentWindowDidActivate 986.602
MyDocumentWindowDidActivate 986.602

NSMenuDidChangeItemNotification 986.602
NSWindowDidBecomeKeyNotification986.609
NSWindowDidBecomeKeyNotification986.609

NSGestureEventMaskChanged   986.611
NSGestureEventMaskChanged   986.611

NSApplicationWillUpdateNotification 986.633
NSApplicationWillUpdateNotification 986.633
NSWindowDidUpdateNotification   986.633
NSWindowDidUpdateNotification   986.633
NSApplicationDidUpdateNotification  986.633
NSApplicationDidUpdateNotification  986.633

NSApplicationWillUpdateNotification 986.635
NSApplicationWillUpdateNotification 986.635
NSWindowDidUpdateNotification   986.635
NSWindowDidUpdateNotification   986.635
NSApplicationDidUpdateNotification  986.635
NSApplicationDidUpdateNotification  986.635

NSApplicationWillUpdateNotification 986.723
NSApplicationWillUpdateNotification 986.723
NSWindowDidUpdateNotification   986.723
NSWindowDidUpdateNotification   986.723
NSApplicationDidUpdateNotification  986.723
NSApplicationDidUpdateNotification  986.723

NSApplicationWillUpdateNotification 986.723
NSApplicationWillUpdateNotification 986.723
NSWindowDidUpdateNotification   986.723
NSWindowDidUpdateNotification   986.723
NSApplicationDidUpdateNotification  986.723
NSApplicationDidUpdateNotification  986.723

NSApplicationWillUpdateNotification 987.739
NSApplicationWillUpdateNotification 987.739
NSWindowDidUpdateNotification   987.739
NSWindowDidUpdateNotification   987.739
NSApplicationDidUpdateNotification  987.739
NSApplicationDidUpdateNotification  987.739

NSApplicationWillUpdateNotification 987.745
NSApplicationWillUpdateNotification 987.745
NSWindowDidUpdateNotification   987.745
NSWindowDidUpdateNotification   987.745
NSApplicationDidUpdateNotification  987.745
NSApplicationDidUpdateNotification  987.745

2018-03-30 12:23:07.850854-0600 MyApp[72672:1742782] Detected potentially 
harmful notification post rate of 102.59 notifications per second

My code does not call any of these notifications except 
MyDocumentWindowDidActivate so this is very puzzling.

--Richard Charles

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Harmful Notification Post Rate

2018-03-29 Thread Quincey Morris
On Mar 29, 2018, at 21:00 , Richard Charles  wrote:
> 
> How can I figure out what notification is posting at a high rate?

Not sure, but have you turned on “NSWindow.acceptsMouseMovedEvents” by any 
chance?
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Harmful Notification Post Rate

2018-03-29 Thread Richard Charles
When dragging the mouse the console will issue a warning "Detected potentially 
harmful notification post rate of xxx.xxx notifications per second".

How can I figure out what notification is posting at a high rate?

--Richard Charles

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com