Accessing caller information quickly
问题 I'm working on an aspectj aspect which needs to know where it's invoked from. At the moment I'm using new Throwable().getStackTrace(); to access this information but each aspect is taking several hundred microseconds to run. I've looked at the SecurityManager but that only seems to be able to get me the class name. Are there any other alternatives I've missed? Update JMH Benchmark results referred to in my comment on @apangin's answer: Benchmark Mode Cnt Score Error Units MyBenchmark