Hello, While testing another patch for agenda fontification, I noticed that agenda can spend up to half!! time doing org-up-heading-safe. Mostly inside queries for inherited tags and properties. I managed to make org-up-heading-safe up to 50x faster using position cache. If this patch also works for others, org-agenda-use-tag-inheritance might become much less of an issue. Benchmark: 1. (elp-instrument-function #'org-up-heading-safe) 2. Run agenda 3. (elp-results) ;; function, # calls, total time, avg time Without cache: org-up-heading-safe 27555 8.4234025759 0.0003056941 With cache, first run: org-up-heading-safe 23227 0.5300747539 2.282...e-05 With cache, second run on unchanged buffer: org-up-heading-safe 23227 0.1447754880 6.233...e-06 Best, Ihor