This section contains recommendations for speeding up different aspects of Source Insight.
Source Insight has many interesting and useful display features for formatting source code. Some of those features require a significant amount of processing.
The display code has been sped up considerably to be able to provide more features with acceptable performance. It is possible to reduce the display functionality to speed it up.
The Preferences: Syntax Formatting dialog box lets you specify how detailed you want the display. Each option has a performance cost. The significant options are listed here, starting with the least costly, to the slowest and most costly:
1.Apply styles for references to members
2.Apply styles for symbol declarations
3.Apply styles for local symbol declarations
4.Apply styles for references to function-local symbols
5.Apply styles for non-function-local symbols
6.Find references using the Project Symbol Path
7.Qualify member references
In general, identifying "references" is slower than "declarations". Identifying references to symbols can be slower if the project is very large, because each reference has to be resolved with a symbol lookup.
The symbol lookup engine has been heavily optimized to allow formatting references to symbols at "display speed". A lot of information is cached in the process, so you may notice that the first time you open a file and start scrolling around in it, it may slow down sometimes. Subsequent viewing of the file will speed up.
Some people want the fastest possible display. However, you may be willing to sacrifice a little of that speed in turn for more useful information that increases productivity.
Typing and filtering symbol lists can become slow if you have a large project, and you have the Project Settings: Quick browsing for symbol name fragments turned on. Source Insight is trying to perform name fragment matching on a large name fragment index.
You can address this two different ways. Either you can turn off name fragment indexing in the Project Settings dialog box, or you can change the behavior of the list filtering with the Preferences: Typing dialog box.
The Project Settings options control what is stored and indexed in the symbol database.
The Preferences: Typing options control how the information is used in the lists. You do need the name fragment information in the database to use the symbol name fragment matching features of the lists. (But, not for file name lists.)
If memory permits, leave Project Settings: Quick browsing for symbol name fragments enabled, and turn off Preferences: Typing: Match name fragments while typing. Even with name fragment matching while typing disabled, you can still use it by prefixing what you type with a space. That is, prefixing what you type with a space toggles the name fragment matching on and off.
If you encounter a lot of disk thrashing while trying to match any name fragments in lists, then your project may be just too big for the available memory.
In Preferences: Typing, turning off both "Match name fragments" and "Match members" will speed it up more and return list filtering to version 2.1 functionality.
A very large project will take a while to build or rebuild. To speed it up, you can try the following:
In Project Settings, turn off Quick browsing for symbol name fragments. This index option uses a lot of memory and slows the indexing process.
In Project Settings, turn off Quick browsing for member names. This index option can use a lot of memory also.
Reduce the number of file types that are added to your projects. By default, Source Insight comes with many file types defined, such as Visual Basic files, and ASP files. If you have files like that in your source tree, but you have no need to work on them, then remove them from your project. You can permanently exclude those file types from your projects by selecting Options > File Type Options and un-checking the option Include when adding to projects – for each type of file you want to exclude from your projects.
Break your project into smaller projects. If you want to still use the Jump To Definition command between the projects, you can add the "sub-projects" to the project symbol path, which is defined in the Preferences: Symbol Lookups dialog box.
The Relation Window shows relationships between symbols. It works like the Context Window in that it works in the background and automatically shows information about what is selected. For example, if you select a function call, it can show you the call tree starting at that function.
The Relation Window can require a lot of processing. Some relationships are slower to compute. The relationships fall into three categories, listed here from fastest to slowest:
Contains – show the contents of the current symbol. For example, show members of a struct.
Calls – show what other symbols are referred to by the current symbol. For example, show functions that are called by the current function.
References – show what other symbols refer to the current symbol. For example, show functions that call the current function.
For very large projects, the "References" relationship will be by far the slowest to compute. The performance seems very acceptable on a Pentium II machine with a moderate sized project (about 200,000 lines of code).
Limiting the relations to non-reference type relations will speed the Relation Window up.
It also works well to lock the Relation Window. To lock the Relation Window, click on the lock button in the Relation Window toolbar. You can refresh the Relation Window at any time by using the Refresh Relation Window command, or by clicking on the Refresh button in the Relation Window toolbar.
As you type an identifier, the auto-completion window pops up to propose matching identifier names. Every time you type a character, Source Insight considers the symbol data for that file to be "stale". To give you the most accurate auto-completion results, Source Insight would need to reparse your file after each character you type. There is an option that controls this in the Preferences: Symbol Lookups dialog box.
The Parse locally before lookup option causes Source Insight to reparse before the auto-completion window appears. On a fast machine, or in a small file, the speed will be acceptable. However, turning this option off will result in a faster response.
Use Lookup References instead of Search Files.
There are several ways to search across multiple files in Source Insight. The commands: Search Files, Lookup References, and Search Project all perform multi-file searches.
The fastest type of search in Source Insight is the Lookup References search. When you search this way, Source Insight looks for references to a single whole-word item. When you search for a single whole-word, Source Insight uses a special index file to make the search fast. It's a good idea to get into the habit of using Lookup References, instead of Search Files, when you can.
The Lookup References command has a few options that affect its speed.
The Smart Reference Matching option means that the search is scope and context-sensitive; the search results will only contain matches for references to the exact symbol you specify, using the surrounding context. This option slows the process down because each same-string occurrence has to be qualified with a symbol lookup, which requires some parsing on the fly. If you turn this off, it will work like the Search Files command; that is, it will search for the string across all the project files.
The Skip Comments and Search Only Comments options also slow the search down a little, but not as much as the smart reference matching option.