Obsidian briefly freezes when receiving focus

Steps to reproduce

  1. Move focus away from Obsidian. (For example, click into another window, or your desktop)
  2. Move focus back to Obsidian.

Expected result

Obsidian is immediately responsive

Actual result

I observe a ~4-5 second freeze before Obsidian becomes responsive

Environment

  • Operating system: macOS Monterey
  • Debug info:
SYSTEM INFO:
	Obsidian version: v1.0.3
	Installer version: v0.15.6
	Operating system: Darwin Kernel Version 21.5.0: Tue Apr 26 21:08:37 PDT 2022; root:xnu-8020.121.3~4/RELEASE_ARM64_T6000 21.5.0
	Login status: not logged in
	Insider build toggle: off
	Live preview: on
	Legacy editor: off
	Base theme: dark
	Community theme: none
	Snippets enabled: 0
	Restricted mode: on

RECOMMENDATIONS:
	none

Additional information

Watching the macOS console while performing the reproduction steps, I see:

default	15:07:42.410279-0700	Obsidian	[d <private>] <PKHost:0x14714b810> Completed discovery. Final # of matches: 4
default	15:07:42.411185-0700	Obsidian	4 plugins found
default	15:07:42.411242-0700	Obsidian	[d <private>] <PKHost:0x14714b810> Beginning discovery for flags: 1024, point: (null)
default	15:07:43.437374-0700	Obsidian	[d <private>] <PKHost:0x14714b810> Completed discovery. Final # of matches: 0
default	15:07:43.437431-0700	Obsidian	Plugin <private> not enabled, skip it.
default	15:07:43.437621-0700	Obsidian	Service with identifier com.apple.messages.ReplyExtension passes activation rule: 1
default	15:07:43.438829-0700	Obsidian	Service with identifier com.apple.messages.ShareExtension passes activation rule: 1
default	15:07:43.440160-0700	Obsidian	Service with identifier com.apple.Notes.SharingExtension passes activation rule: 1
default	15:07:43.440437-0700	Obsidian	3 compatible services found for attributes <private>
default	15:07:43.440448-0700	Obsidian	Discovery done
default	15:07:43.440469-0700	Obsidian	Discover extensions with attributes <private>
default	15:07:43.440500-0700	Obsidian	[d <private>] <PKHost:0x14714b810> Beginning discovery for flags: 1024, point: com.apple.ui-services
default	15:07:44.442321-0700	Obsidian	[d <private>] <PKHost:0x14714b810> Completed discovery. Final # of matches: 0
default	15:07:44.442466-0700	Obsidian	0 plugins found
default	15:07:44.442578-0700	Obsidian	0 compatible services found for attributes <private>
default	15:07:44.442641-0700	Obsidian	Discovery done
default	15:07:44.442722-0700	Obsidian	Discover extensions with attributes <private>
default	15:07:44.442857-0700	Obsidian	[d <private>] <PKHost:0x14714b810> Beginning discovery for flags: 1024, point: com.apple.services
default	15:07:45.445210-0700	Obsidian	[d <private>] <PKHost:0x14714b810> Completed discovery. Final # of matches: 0
default	15:07:45.445353-0700	Obsidian	0 plugins found
default	15:07:45.445461-0700	Obsidian	0 compatible services found for attributes <private>
default	15:07:45.445522-0700	Obsidian	Discovery done
default	15:07:45.445832-0700	Obsidian	Sorted services: <private>
default	15:07:45.445899-0700	Obsidian	It took 4508 ms to get sharing services sync for mask <private>
default	15:07:45.486247-0700	spindump	Obsidian [12227]: slow hid response: not sampling due to conditions 0x8002

This line seems suspect, and matches the approximate time of the freeze that I see

default 15:07:45.445899-0700 Obsidian It took 4508 ms to get sharing services sync for mask <private>

example

1 Like

no idea.

I can second that. Yesterday everything worked as always :-). But then (I believe after auto-updating this morning), the same behavior as described 5s freezes when focusing or changing files.

I also tried to look into the dev console, but nothing is reporting. Continuing to investigate :slight_smile:

Update:
I also use macOS Monterey.

I ran the chrome profiler, and one can see that it is stuck for 4s.

It is in the function:

requestUpdateLayout()

Hard to give more info as it is obfuscated.

I also added the profiler files such that one can look at them. As you will notice, my vault is tiny (10 files). So vault size should not be the issue. I also deactivated any cloud sync that was happening in this folder.

Chrome Profiling:
http://jsdev.vsos.ethz.ch/Profile-20221103T101752.json

Image of the profiler:

I hope this helps :slight_smile: But happy to assist further

I’m experiencing the same issue on macOS Monterey, Obsidian 1.0.3. Started on Tuesday / Wednesday I think.

Also on Monterey and getting a delay. (Not 5 seconds, but it is multiple seconds.)

I’m afraid, the same freezing for me after v1.0.3 update :frowning:
macos Monterey 12.1

Sorry, seems could be macos-related things. After system restart/upgrade do not see any freeze in obsidian so far.

@joennlae Side note: how did you set up that Chrome profiler in such a way that it shows the function names/definitions?