// Improved profiling tool