Psychosonic Lab · Experiment 11

How fast is a key typed into a note?

One Mac's own log, three builds, and the count that found the cause

Notesmith for Mac times every key you type and writes the result to a log on your Mac. We read that log on the developer's own Mac, in a library of about 1,400 notes, across three builds made before Mac 1.2 came out. In the large list the median key took 443 to 445 ms in build 85 and 49 ms in build 86. The script below prints the same lines from your own log.

Typed 2026-11-06 to 2026-11-12 · macOS 27.2 · MacBook Pro, Apple M3 Pro, 36 GB · Notesmith for Mac 1.2, TestFlight builds 82, 85 and 86
Notesmith: psychosonicconsulting.com/notesmith

01

The question

01.1

What is being asked

In a library of about 1,400 notes, is the median key typed into a note drawn in under 50 milliseconds?

01.2

Why it matters

A key that arrives a beat late feels like a heavy keyboard. Notesmith's log used to record only freezes of 300 milliseconds or more, so a key that took 60 left nothing to read. In early November the developer felt typing was a little behind, and there was no number to say by how much.

01.3

What counts as under 50 milliseconds

Fifty milliseconds is where the log starts counting a key as slow, well past one frame at 60 Hz. The timer runs from the moment macOS stamps the key to the end of the pass that draws it. It leaves out the display's own delay of about a frame, which is the same for every build.

02

Method

02.1

The timer

Notesmith for Mac times each key typed in a note. It reads the system's own timestamp on the key event and stops the clock when the last observer of the run loop pass that handled the key fires, after AppKit has drawn and Core Animation has committed. For every 200 keys it writes one line to the log: the median, the slowest 5%, the worst key, how many keys took 50 ms or more, and the Mac's load average. A line holds counts and durations only. No character, key code or note is ever written.

02.2

The library and the Mac

The developer's own notes: about 1,400 notes and 57,285 blocks when last counted, with pictures, tags and colours, on a MacBook Pro, Apple M3 Pro, 36 GB. The Mac was in ordinary use with other work running, which is why every line carries the load average.

02.3

Real window, real library

The results are from the real app in a real window, typing into the real library. Tests in code, run against a copy of the same library, had said a key costs about 10 ms once the editor's own costs were fixed. Build 85 carries those fixes and the real window said 443 to 445 ms in the large list. The tests measured the editor. They could not see the list beside it, which was most of the time.

02.4

Counting what runs

To find where the time went we did two things. We sampled the main thread of the signed build while typing, with macOS's sample tool. And we built a bench: a debug build holding 1,400 made-up notes, with a script typing 150 keys through the real text view, counting how many times the window's main view and a note row were rebuilt.

02.5

One change at a time, with a test

Each change had a test written for it, and we checked that the test fails when the change is taken out. Each build was then installed on the same Mac and typed in. The builds are the rows of the results.

03

Materials

03.1

The script

One file of Python, 96 lines, standard library only. It reads Notesmith's log and prints the typing lines by build, or as CSV. It is shown in full below with its checksum. It changes nothing.

03.2

The data

performance-excerpt.log is the developer's log, unchanged, cut to the launch, typing and freeze lines of builds 82, 85 and 86. typing.csv is what the script makes of it. lists.csv says which list was open for each line, written from the developer's account because the log does not record it. meta.json holds the build notes, the sampling summary and the bench's two runs.

typing-lines.py 96 lines · sha256 993527d8e75b3a044f158c33b206b1eb5a9eef6440bfeb6becb5f4d434e781de
Show the script in full
#!/usr/bin/env python3
"""Read the typing lines Notesmith for Mac writes to its own performance log.

Notesmith times every key you type in a note, from the moment macOS stamps the key
event to the end of the pass that draws it, and writes one summary line for every 200
keys. A line holds counts and durations only, never a character, a key code or a note.
This script lists those lines, grouped by the build that wrote them.

    python3 typing-lines.py                      # your log, every build
    python3 typing-lines.py --csv > typing.csv   # the same, as a spreadsheet
    python3 typing-lines.py PATH/performance.log # a log you copied somewhere

Standard library only. It reads the log and changes nothing.
"""
import argparse
import csv
import os
import re
import sys

# Notesmith for Mac is sandboxed, so its log is inside its container.
DEFAULT_LOG = os.path.expanduser(
    "~/Library/Containers/com.langberg.privatenote/Data/Library/Application Support/"
    "PrivateNote/performance.log")

LAUNCH = re.compile(r"^(\S+)\s+launch (\S+) \((\d+)\)")
TYPING = re.compile(
    r"^(\S+)\s+typing · (\d+) keys · p50 (\d+)ms p95 (\d+)ms max (\d+)ms · (\d+) over 50ms"
    r"(?: · load ([\d.]+))?")
HANG = re.compile(r"^(\S+)\s+HANG (\d+)ms\s+@ (.*?)(?: · load ([\d.]+))?$")

COLUMNS = ["build", "utc", "keys", "p50_ms", "p95_ms", "max_ms", "over_50ms", "load"]


def read(path):
    """Yield (kind, row) for each launch, typing and hang line, in file order."""
    build = "before the first launch line"
    with open(path, encoding="utf-8", errors="replace") as f:
        for line in f:
            line = line.rstrip("\n")
            m = LAUNCH.match(line)
            if m:
                build = f"{m.group(2)} ({m.group(3)})"
                yield "launch", {"build": build, "utc": m.group(1)}
                continue
            m = TYPING.match(line)
            if m:
                yield "typing", {"build": build, "utc": m.group(1), "keys": int(m.group(2)),
                                 "p50_ms": int(m.group(3)), "p95_ms": int(m.group(4)),
                                 "max_ms": int(m.group(5)), "over_50ms": int(m.group(6)),
                                 "load": m.group(7) or ""}
                continue
            m = HANG.match(line)
            if m:
                yield "hang", {"build": build, "utc": m.group(1), "ms": int(m.group(2)),
                               "where": m.group(3), "load": m.group(4) or ""}


def main():
    ap = argparse.ArgumentParser(description=__doc__.split("\n\n")[0])
    ap.add_argument("log", nargs="?", default=DEFAULT_LOG, help="a performance.log (default: Notesmith's own)")
    ap.add_argument("--csv", action="store_true", help="write the typing lines as CSV")
    ap.add_argument("--since", default="", help="only lines from this UTC date on, like 2026-11-04")
    args = ap.parse_args()
    if not os.path.exists(args.log):
        sys.exit(f"no log at {args.log}. Notesmith writes one once you have typed in a note.")

    rows = [(k, r) for k, r in read(args.log) if r["utc"] >= args.since]
    typing = [r for k, r in rows if k == "typing"]
    if args.csv:
        w = csv.DictWriter(sys.stdout, fieldnames=COLUMNS, lineterminator="\n")
        w.writeheader()
        w.writerows(typing)
        return

    if not typing:
        sys.exit("the log has no typing lines yet. A line is written for every 200 keys typed in a note.")
    current = None
    for kind, r in rows:
        if kind == "typing":
            if r["build"] != current:
                current = r["build"]
                print(f"\nNotesmith {current}")
                print(f"  {'UTC':<21}{'keys':>5}{'p50':>8}{'p95':>8}{'max':>8}{'over 50':>9}{'load':>7}")
            print(f"  {r['utc']:<21}{r['keys']:>5}{r['p50_ms']:>6}ms{r['p95_ms']:>6}ms{r['max_ms']:>6}ms"
                  f"{r['over_50ms']:>9}{r['load']:>7}")
    hangs = [r for k, r in rows if k == "hang" and "typing" in r["where"]]
    if hangs:
        print(f"\n{len(hangs)} time(s) the main thread was blocked for 300 ms or more while you typed:")
        for r in hangs:
            print(f"  {r['utc']}  {r['ms']} ms  build {r['build']}")


if __name__ == "__main__":
    main()
04

Results

Typed 2026-11-06 to 2026-11-12 · macOS 27.2 · MacBook Pro, Apple M3 Pro, 36 GB · Notesmith for Mac 1.2, TestFlight builds 82, 85 and 86

Every typing line the log holds for these builds

BuildWritten (UTC)ListKeysMedian keySlowest 5%Worst keyKeys 50 ms or moreLoad
1.2 (82)2026-11-06 02:07:01Not noted2714 ms397 ms542 ms941.0
1.2 (82)2026-11-06 21:24:42Not noted109523 ms3,094 ms3,861 ms1096.7
1.2 (82)2026-11-06 21:30:50Not noted90585 ms2,145 ms2,569 ms904.7
1.2 (82)2026-11-06 21:41:42Not noted199731 ms8,467 ms11,664 ms18627.1
1.2 (82)2026-11-06 21:46:23Not noted618,333 ms15,259 ms19,439 ms61129.6
1.2 (85)2026-11-11 14:19:04Large list245445 ms2,161 ms2,555 ms2452.1
1.2 (85)2026-11-11 14:19:09Large list52443 ms885 ms951 ms522.2
1.2 (85)2026-11-11 14:26:14Not noted20093 ms4,410 ms5,180 ms2004.1
1.2 (85)2026-11-11 14:26:37Not noted9495 ms4,552 ms5,257 ms944.3
1.2 (85)2026-11-11 14:27:51Small group12146 ms126 ms465 ms383.8
1.2 (86)2026-11-12 23:54:40Large list20049 ms104 ms190 ms984.1
1.2 (86)2026-11-12 23:55:305 notes20048 ms76 ms214 ms883.6
1.2 (86)2026-11-12 23:55:485 notes9645 ms81 ms103 ms383.6

Each line covers up to 200 keys. The list column is the developer's account of which list was open. The medians of build 86 are marked.

What went into each build

BuildWhat was in it
1.2 (82)The first typing fix, which rebuilds one paragraph per key and not the whole note. None of the fixes below.
1.2 (85)Six more: sync stopped asking the system for its peer list on the main thread, an empty sync round did nothing, a screen redraw that changed nothing rebuilt nothing, a key re-read one block's references and not every block's, the list re-read only the notes that changed, a long note's key walked one paragraph and not all of them. And two more: the list worked out the attachments folder once and not once per row per key, and the language model and the font list stopped loading on the main thread.
1.2 (86)The note list in a view of its own, so a key typed in the editor no longer rebuilds the list.

Blocked for 300 ms or more while typing

BuildTyping linesKeysTimes the main thread was blocked
1.2 (82)54868
1.2 (85)57122
1.2 (86)34960

Counted from the freeze lines in the log that name typing. How long each build was used differs, so these are a sign, not a rate.

The bench, a debug build with made-up notes

Median keySlowest 5%Worst keyKeys 50 ms or more, of 150Times the main view was rebuiltNote rows rebuilt
Before: rows built inline189 ms705 ms1,099 ms1424861
After: rows in a view of their own50 ms96 ms112 ms74384not counted

1,400 made-up notes, 150 keys typed through the real text view by a script, 120 ms apart. A debug build is slower than the app you install, and the real library has pictures, tags and colours, so the real lag was larger than the bench showed: 445 ms in the large list against 189 ms. The bench's own log was overwritten by later runs, so these two rows have no raw file.

Where the time went in build 85

Sampling the signed app while typing in the large list: the main thread was busy 91 to 99% of the time. The list's own ForEach took 34 to 39% of it and SwiftUI's list machinery 28 to 34%. The text editor took 3 to 4%. One sitting; the sampling output is not published.

05

What this shows

05.1

Build 82 was more than half a second behind

In build 82 the median key in each of the three longer stretches of typing took 523 to 731 ms.

05.2

Build 85 left the large list behind

In build 85 the median key in the large list took 443 to 445 ms, while the same build in the small group took 46 ms.

05.3

Build 86 closed the gap

In build 86 the median key in the large list took 49 ms, and 45 to 48 ms in a group of five notes. The slowest 5% in the large list went from 885 and 2,161 ms in two lines of build 85 to 104 ms.

05.4

Nothing long blocked typing in 86

The main thread was blocked for 300 ms or more while typing eight times in build 82, two times in build 85 and not once in build 86. Those counts depend on how long each build was used.

05.5

The list was rebuilt three times a key

In the bench the window's main view was rebuilt 486 times in 150 keys, about three a key, and a note row once. The rows were skipped, but each rebuild still made SwiftUI walk the identity of all 1,400 notes, which sampling put at about a third of the main thread. Putting the list in a view of its own took the bench's median key from 189 to 50 ms.

06

What this does not show

06.1

One person, one Mac, one library

Everything here is one developer's library on one MacBook Pro, Apple M3 Pro, 36 GB. A smaller library will not show the large list's lag, and a different Mac may differ.

06.2

A few lines

There are 13 lines and 1,694 keys, typed in sittings of a few minutes. This is a handful of measurements.

06.3

The Mac was busy

Every line has a load average, from 2 to 130. The developer was running other work on the same Mac, so these are numbers for a busy machine. A quiet Mac would likely do better, and build 82's last line, a median of 8,333 ms at a load of 130, is mostly that.

06.4

Which list was open comes from memory

The log does not record the list. Where a line says large or small, that is the developer's account of the sitting. Lines marked not noted are ones nobody can place.

06.5

Several changes at once

Build 85 carried eight changes and the log cannot say which did what. Tests in code measured some of them one at a time, but that is not part of this data.

06.6

Half the keys were still near 50 ms

The 49 ms is the median, so other keys took longer. In the first large-list line of build 86, 98 of 200 keys took 50 ms or more, and the slowest 5% took 104 ms or more.

06.7

Key to drawn, not key to glass

The timer stops when the app has drawn, not when the display shows it. The display adds about one frame, the same for every build, so builds compare fairly but the figures are not the whole delay your eyes see.

06.8

The bench and the sampling are not raw data

The bench's own log was overwritten by later runs of the same tool, and the sampling output is not published. Both appear as figures from our notes of the runs. The tables of typing lines do not depend on them.

06.9

Measured before release

These lines come from three builds made before Notesmith for Mac 1.2 was released (82, 85 and 86). The released 1.2 is build 87. Its note list rows and its editor view are the same code as in build 86; what changed between them is meeting recording, notices and Writing Tools. We did not read a log from 87 itself. Versions before 1.2 do not write these lines.

07

Run it yourself

07.1

You need Notesmith for Mac 1.2

The typing meter is in Notesmith for Mac 1.2, from the Mac App Store. Versions before 1.2 do not have it.

07.2

Type

Open a note and type a few hundred keys. Notesmith writes one line for every 200.

07.3

Read your log

python3 typing-lines.py
It finds Notesmith's log in its container and prints the lines by build. --csv writes them as a spreadsheet and --since 2026-11-06 leaves out older lines.

07.4

Read the columns

Median is the middle key. Slowest 5% is the time one key in twenty took or went over. Over 50 ms counts the keys at or above 50. Load is the Mac's load average when the line was written, so a high one means other work was running.

07.5

If yours differs

Send your lines to info@psychosonicconsulting.com and we will look.

The Signal

One signal a week. No noise.

A short note on building privacy-first software, plus the day each new app ships. No spam, unsubscribe anytime.

Free · ~1 email a week · your address stays yours · RSS feed