Fix resource loading perf regression, add perf debugging.
Better perf debugging.