fc / Cache

Table of Contents

Motivation

Even with the AWK based indexer, indexing cards before each review gets slow if there are a lot of files / cards.

To work around this, the indexer can be run only one time, caching the results in a hash table.

Advises are added to `delete-file' and `rename-file' remove / update keys from the hash table.

Changes to existing files & new files are detected with a before-save-hook on org-mode files.

During a review many files are changed and saved. To keep this as fast as possible, instead of re-processing files after each save, changed files are collected in `org-fc-cache-queue' and reprocessed in bulk the next time the cache is accessed.

Assuming only a small subset of the flashcard files is changed between reviews, this is much faster than building the full index ch time.

Activation

Caching can be activated/deactivated with M-x org-fc-cache-mode .

To activate this mode when Emacs starts, activate it in your configuration:

(org-fc-cache-mode)

Performance

Setup

18348 cards
2478 files
475860 lines

AWK

Dashboard Elapsed time: 3.642393s
Index Cards in Subdirectory Elapsed time: 0.502262s
Index Cards with Tag Elapsed time: 3.266725s (0.244461s in 1 GCs)

Cache

Cache Build Elapsed time: 3.299303s (0.241431s in 1 GCs)
Dashboard Elapsed time: 0.649638s
Index Cards in Subdirectory Elapsed time: 0.024609s
Index Cards with Tag Elapsed time: 0.038080s

If you have an idea how this page could be improved or a comment send me a mail.