본문으로 건너뛰기
cccskills
무료GitHub에 공개

apple-notes-performance-tuning

Measure and tune Apple Notes automation for large collections. Reduce unnecessary data reads, introduce a local cache, and sync only changed notes while checking response times, synchronization accuracy, and the ability to undo tuning changes.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

원문원문 설명 보기

Optimize Apple Notes automation performance for large note collections. Trigger: "apple notes performance".

실행 점수 미검증

설치 방법 보기

이럴 때 유용합니다

  • Investigate slow searches across a large note collection
  • Reduce data reads during bulk note exports
  • Introduce a local cache for note queries
  • Check incremental sync performance and accuracy

포함된 파일(1)

  • SKILL.md6.9 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Apple Notes Performance Tuning

Overview

Apple Notes automation performance degrades linearly with note count because JXA loads all note objects into memory when you access a collection. A vault with 10,000+ notes can take 30+ seconds for a simple list operation. The primary bottleneck is the Apple Events bridge between your script and Notes.app — every property access (name, body, date) is a separate IPC call. This guide covers caching strategies, incremental sync, batch optimization, and architectural patterns to keep automation responsive at scale.

Prerequisites

  • A scoped workload baseline, performance budget, and a non-production corpus for tests.
  • A private encrypted cache with retention, redaction, and explicit access controls; a cache is a duplicate of sensitive notes.
  • A feature flag and rollback plan for polling interval, cache, or batching changes.

Instructions

  1. Measure a bounded read-only workload before changing timeouts, concurrency, or poll intervals.
  2. Minimize fields and property calls; never cache a body when an opaque identifier or timestamp is sufficient.
  3. Keep cache updates idempotent, encrypted, and scoped; reconcile change cursors before writing a new cursor.
  4. Roll back a tuning change if latency, sync behavior, or data-reconciliation evidence regresses.

Performance Benchmarks

Operation100 notes1,000 notes10,000 notes
List all (names only)~0.5s~3s~30s
Search by name (.whose())~0.3s~2s~20s
Full-text search (body scan)~1s~8s~80s
Create single note~0.2s~0.2s~0.2s
Export all to JSON~1s~10s~100s
Count notes only (.length)~0.1s~0.3s~1s

Strategy 1: Minimize Property Access

// BAD: Each property access is a separate Apple Event IPC call
const Notes = Application("Notes");
const allNotes = Notes.defaultAccount.notes();
allNotes.forEach(n => {
  console.log(n.name());   // IPC call 1
  console.log(n.body());   // IPC call 2
  console.log(n.modificationDate()); // IPC call 3
});
// With 1000 notes = 3000 IPC calls

// GOOD: Batch extract in a single JXA evaluation
const data = Notes.defaultAccount.notes().map(n => ({
  title: n.name(),
  modified: n.modificationDate().toISOString(),
}));
// Single JXA evaluation, much faster for bulk reads

Strategy 2: Local SQLite Cache

#!/bin/bash
# Export notes to SQLite for fast local queries
DB="$HOME/.notes-cache.db"
sqlite3 "$DB" "CREATE TABLE IF NOT EXISTS notes (
  id TEXT PRIMARY KEY, title TEXT, body TEXT, folder TEXT,
  created TEXT, modified TEXT, indexed_at TEXT
);"

osascript -l JavaScript -e '
  const Notes = Application("Notes");
  Notes.defaultAccount.notes().map(n => JSON.stringify({
    id: n.id(), title: n.name(), body: n.plaintext(),
    folder: n.container().name(),
    created: n.creationDate().toISOString(),
    modified: n.modificationDate().toISOString()
  })).join("\n");
' | while IFS= read -r line; do
  echo "$line" | jq -r '[.id, .title, .body, .folder, .created, .modified, now | todate] | @csv' \
    | sqlite3 "$DB" ".import /dev/stdin notes"
done 2>/dev/null

# Now query locally (instant)
sqlite3 "$DB" "SELECT title FROM notes WHERE body LIKE '%project%' ORDER BY modified DESC LIMIT 10;"

Strategy 3: Incremental Sync

// src/sync/incremental.ts
import { execSync } from "child_process";
import { readFileSync, writeFileSync } from "fs";

const LAST_SYNC_FILE = ".notes-last-sync";

function getLastSync(): Date {
  try { return new Date(readFileSync(LAST_SYNC_FILE, "utf8").trim()); }
  catch { return new Date(0); } // First run: sync everything
}

function incrementalSync(): void {
  const lastSync = getLastSync();
  const allNotes = JSON.parse(execSync(
    `osascript -l JavaScript -e 'JSON.stringify(Application("Notes").defaultAccount.notes().map(n => ({id: n.id(), title: n.name(), modified: n.modificationDate().toISOString()})))'`,
    { encoding: "utf8" }
  ));

  const changed = allNotes.filter((n: any) => new Date(n.modified) > lastSync);
  console.log(`${changed.length} notes modified since ${lastSync.toISOString()}`);

  // Process only changed notes (fetch full body only for these)
  for (const note of changed) {
    console.log(`Syncing: ${note.title}`);
    // ... process individual note
  }

  writeFileSync(LAST_SYNC_FILE, new Date().toISOString());
}

Strategy 4: Use .whose() for Filtered Queries

// .whose() pushes filtering to Notes.app (faster than client-side filter)
const Notes = Application("Notes");

// Faster than loading all notes and filtering in JS
const recentNotes = Notes.defaultAccount.notes.whose({
  _match: [ObjectSpecifier().modificationDate, ">", new Date(Date.now() - 86400000)]
});

// Search by name (case-insensitive)
const matches = Notes.defaultAccount.notes.whose({
  name: { _contains: "project" }
});

Error Handling

IssueCauseSolution
Script hangs for >60sToo many notes with body() accessUse .length first to assess scale; use cache for large vaults
Memory spike during exportAll note bodies loaded into JXA runtimeProcess in batches; stream to file instead of building array
SQLite cache staleForgot to re-sync after editsRun incremental sync on schedule via launchd
.whose() returns wrong resultsComplex predicates not supported in JXAFall back to full load + JS filter for complex queries
iCloud sync slows writesEach write triggers syncBatch writes with 1s delay; use "On My Mac" for bulk import

Output

Performance tuning yields a baseline, applied configuration, bounded latency result, cache data classification, and rollback result. Metrics and logs use opaque identifiers and aggregate counts; they do not expose note titles, bodies, or query terms.

Examples

For a slow search, benchmark a scoped metadata-only query in the test corpus, enable a feature-flagged cache that stores only identifiers and modification timestamps, then compare p95 latency and reconciliation correctness before rollout. Disable the flag if cursor reconciliation differs.

Resources

Next Steps

For handling rate limits during bulk operations, see apple-notes-rate-limits. For monitoring performance trends, see apple-notes-observability.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Add a synthetic-data CI gate for customer-owned Abridge integration code. Test consent handling, note-review handoffs, redaction, and rollback behavior with mocked vendor boundaries, without connecting CI to a live Abridge or EHR tenant.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Adding regression checks to an Abridge integration repository
  • Testing consent and note-release handling
  • Checking logs for sensitive data exposure
jeremylongshore/tons-of-skills-marketplace2.9천2026년 10월 23일 업데이트

Triage Abridge recording, note review, Epic handoff, and access problems using observed symptoms and approved guidance. Identify the affected workflow stage, organize a minimal timeline, and prepare a redacted escalation record for the responsible team.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Separate recording problems from upload failures
  • Investigate note creation delays and editor issues
  • Identify the responsible team for Epic handoff failures
jeremylongshore/tons-of-skills-marketplace2.9천2026년 10월 23일 업데이트

Map and review an Abridge clinical documentation workflow from consent and recording through draft review, evidence checks, edits, and final disposition. Keep clinician approval explicit, identify failure exits, and separate verified facts from tenant-specific details and pending approvals.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Map a clinical note workflow for a care setting
  • Check where consent and patient identity are verified
  • Review draft notes against linked evidence before sign-off
jeremylongshore/tons-of-skills-marketplace2.9천2026년 10월 23일 업데이트

Audit how clinician-reviewed Abridge note sections map into Epic templates and downstream workflows. Use approved test records to document destinations, exceptions, evidence, rollback steps, and a go or no-go decision for a specific environment.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Checking Abridge note section mappings to Epic templates
  • Auditing a department’s approved documentation handoff
  • Preparing test evidence and a go or no-go decision
jeremylongshore/tons-of-skills-marketplace2.9천2026년 10월 23일 업데이트

Review Abridge adoption and workflow value using local usage records, clinician feedback, and verified contract costs. Build an evidence based decision table covering adoption, quality, support burden, and options to expand, hold, or improve the rollout.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Reviewing adoption after an Abridge rollout
  • Preparing evidence for a renewal decision
  • Comparing workflow outcomes across care settings
jeremylongshore/tons-of-skills-marketplace2.9천2026년 10월 23일 업데이트

Prepare a bounded support bundle for an Abridge issue using allowlisted operational details such as versions, coarse timestamps, and correlation references. Exclude recordings, transcripts, patient identifiers, credentials, and unrestricted logs, then document redactions and review details.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Preparing reviewed evidence for an Abridge support case
  • Documenting redactions and excluded data
  • Collecting approved operational details for an incident
jeremylongshore/tons-of-skills-marketplace2.9천2026년 10월 23일 업데이트

jeremylongshore의 스킬 모두 보기

이 스킬의 문제 신고