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

2 Likes

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?

Fresh install on a brand new M1 Pro, whenever I do anything to do with windows/files, even just switching from one open window back into Obsidian, Obsidian will freeze for a good 5 or so seconds before becoming interactable again.

Here’s a short clip of it happening (note: the video didn’t capture the beach ball that would show up as soon as I’d click on any of the files). It would fully prevent any interaction with Obsidian, including scrolling, clicks or text editing (as you can see I was spamming text but it didn’t show up until it unfroze).

Sorry for the terrible quality, giphy absolutely murdered the video quality there but you can still see what’s going on

Any clue to fix this a bit?

I’m on M1 too, and I don’t experience this. What version of MacOS? (I’m still on 12.6, so I haven’t tested the latest yet.)

Can you post your “Show debug info”?

I’m on 12.5.1

SYSTEM INFO:
	Obsidian version: v1.0.3
	Installer version: v1.0.3
	Operating system: Darwin Kernel Version 21.6.0: Wed Aug 10 14:28:23 PDT 2022; root:xnu-8020.141.5~2/RELEASE_ARM64_T6000 21.6.0
	Login status: not logged in
	Insider build toggle: off
	Live preview: off
	Legacy editor: off
	Base theme: dark
	Community theme: none
	Snippets enabled: 0
	Restricted mode: on

RECOMMENDATIONS:
	none

All these bug reports point to al older version of the OS. try to update your OS.

I’m getting a similar issue on Windows 11. When I switch tasks to Obsidian, it often remains stuck for a few seconds. I can start writing, but nothing shows up on the screen, and after a few seconds what I have written appears. It doesn’t seem to happen every single time, just quite often. I’m not sure under what circumstances it happens. (Obsidian v1.1.14)

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.