I have a package that defines custom InputAliases and applies them via:
CurrentValue[$FrontEndSession, InputAliases] = Append[CurrentValue[$FrontEndSession, InputAliases], $MyAliases];
With NotebookAutoSave -> True, I get a visible lag between a cell finishing evaluation and its output appearing on screen. This happens even in a brand-new notebook under 100 KB, so it isn’t about file size or accumulated output. Turning NotebookAutoSave off removes the lag completely.
My current workaround is to disable native autosave and trigger the save myself after the front end is idle:
DelayedSave[] := With[{nb = EvaluationNotebook[]},
RunScheduledTask[NotebookSave[nb], {10^-11}]];
SetOptions[EvaluationNotebook[],
NotebookAutoSave → False, CellEpilog :> DelayedSave[]];
This hides the lag, since the save happens after the output is already displayed.
Questions:
- Is
NotebookAutoSave -> Truefundamentally synchronous — does it block the UI thread until the write completes — or could something else (e.g., session-levelInputAliases, front-end metadata) be responsible for a lag that appears only when this option is on? - Is there a supported way to get autosave-like behavior without blocking, short of reimplementing it with
RunScheduledTask/SessionSubmit? - Is
CurrentValue[$FrontEndSession, InputAliases]known to have performance costs distinct from a notebook-levelInputAliasesoption or a stylesheet-based one?
Any insight or a better solution into how NotebookAutoSave is implemented internally, or known interactions with InputAliases, would help.