Perf: improved inlines cache logic