Re: Iterative visiting of all source files
Eric Ludlam <[email protected]> Wed, 24 Dec 2014 18:40:10 -0500
| Newsgroups | gmane.emacs.semantic |
|---|---|
| Message-ID | <[email protected]> |
On 12/24/2014 01:51 PM, rjd wrote: > Thanks Eric. > > How would you feel about a feature that did parse all files and store the db > in memory? That way when I do "someSymbol." I get all the tags beloning to > someSymbol in random access time. Is this not what intellisense does? I do > not know if it stores it in memory, but at the minute I cannot see why this > would be a bad idea. The only issue that comes to mind is if something > changes - if I add a member to a class as long as semantic can append to the > database in real-time I think it would be fine... Hi, Semantic's tag storage works as follows: Each file is parsed, and tags stored in a database structure in memory. In idle time, it periodically saves those databases to disk. When you restart Emacs, if tags are needed for a file, it will first load them from disk into memory if available, and only if the file wasn't already parsed will it reparse. It will detect if a file changed since the last time the tag DB was written, and reparse if needed. Once a tag table is loaded in memory, it stays in memory. What is sometimes slow for completion is when all the tables currently in memory are indexed into a structured table for faster searching. Due to the way files and headers are organized, there is one such index per file. Once the structure is there, it is pretty fast. Another way it can be slow is if the tag tables are so big Emacs forces your computer to start swapping, or the search just takes a long time because the table is so long. I've profiled that part many times to squeak out as much redundancy as possible, but when it comes down to it, you need to do several searches for one completion for the symbols being completed, the data types being completed, etc. I'd recommend profiling any cases you know as feeling slow to see where the time is being taken to know for sure what we'd need to do. Eric ------------------------------------------------------------------------------ Dive into the World of Parallel Programming! The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net