Collecting time taken to index a file.

Hi,

I am going through indexing component of intellij idea.
I would like collect information related to index time for a given file size.

FileBasedIndex.indexFileContent(Project, FileContent) is the function for which I would like to gather data. There are few ways to gather this information:
1. modify FileBasedIndex and add required logging information.
2. use tracing tools like: btrace to inject code on method entry of indexFileContent().

Problem with btrace is its strictly read-only and not possible to invoke methods on params (like: FileContent.getVirtualFile().getName() are not allowed).

I would like to know whether jetbrains does collect such information? How do they gather this information?


Thanks,
Chandra

ps.
I tried using yourkit profiler in tracing mode, but - yourkit adds lot  of overhead and its just provides aggregate information and doesnt  provide hooks to collect additional information (like: fileName, content  size etc).

1 comment

Hi,

First option (modifying source code) is definitely the right way. We don't do a per-file benchmarking and rather do profiling en-mass. I would also recommend using sampling option in YK since it doesn't introduce much overhead. It also worth to tune agent startup options (http://yourkit.com/docs/90/help/startup_options.jsp) to reduce overhead.

0

Please sign in to leave a comment.