Indexing or �How We Made Indexes Shared and Faster
Eugene Petrenko
@jonnyzzz
How may Find Usages work?
Find Usages
Find Usages
Rename Refactoring
Old Times
Simple Syntax Highlighting
Smart Code Inspections & Highlighting
Experiment: Full Text Search
Grepping IntelliJ Community
Grepping IJ Community
Grepping IntelliJ Community
Full Text Search in IntelliJ
Trigram Index
“Swapper32”
Swa
wap
app
ppe
per
er3
r32
{
Trigram Index
“Swapper32”
Swa
wap
app
ppe
per
er3
r32
{
Trigram Index
“Swapper32”
Swa
wap
app
ppe
per
er3
r32
{
Trigram Index
“Swapper32”
Swa
wap
app
ppe
per
er3
r32
{
}
Trigram Index: Building
File -> List(Trigrams) /// building�Trigram -> List(File) /// using
Swa
wap
...
...
...
...
r32
{
Local Trigram Index Math
Local (inverted) Index:
Trigram -> List(File)
Swa
wap
...
...
...
...
r32
{
Local Index Formally
Local (inverted) Index:
Key -> List(File)
8m
9m
9m
9m
Class by Name Search
Find Usages
Find Usages Inside
Looking for the “Swapper32” identifier
Rename Refactoring
Indexes Are Used in IntelliJ
How Many Indexes are There?
Indexing can be slow
13m
Indexing is �done per IDE
14m
We spend human years per week on indexing
15m
Shared Indexes
15m
Shared Indexes
Shared Index Math (for one index)
Downloaded Shared Index:
Key -> List(Hash)
Local part for a Downloaded Shared Index:
File -> hash(File content)
Hash -> List(File)�
Shared Trigram Index Math
Trigram -> List(Hash) /// downloaded
File <- hash(File content) /// local
...
...
...
...
{
Shared
“Swapper32”
Combined Trigram Index Lookup
...
...
...
...
{
}
Local
Shared
“Swa”
Building a Trigram Shared Index
File -> hash(File content) -> List(Trigrams) /// building�Trigram -> List(Hash) /// using
Swa
wap
...
...
...
...
r32
{
It does not replace
Now,
Indexing completes faster
20m
Shared Indexes Allows to
Compatibility
Public Shared Indexes
We build public shared indexes for the community:
Building Shared Indexes
Distributing Shared Indexes
Project Shared Indexes
Project Shared Indexes Setup (Preview)
IntelliJ
Shared Indexes CDN
Shared Indexes�Job Runner
VCS
Experiments
31m
JDK Indexes
JDK Index Example
Empty project with Amazon Corretto 11.0.9 on macOS
37% less time
Maven Libraries Shared Index
Maven Libraries Shared Index
Empty Gradle IntelliJ plugin project (or IJSDK) indexing on macOS:
64% less time
IntelliJ Community Project Example
The sources of all IntelliJ Community clean indexing time on macOS:
51% less time
IntelliJ Community project shared indexes are also included in the public shared indexes and configured for the project
IntelliJ Community with Shared Indexes
IntelliJ Ultimate Project Example
The sources of all IntelliJ-based IDEs indexing time on macOS:
52% less time
Continuous measurements
37m
Continuous Measurements
JDK Indexing time experimental data
IntelliJ Ultimate codebase indexing
Do not trust me,�Trust your profiler!
40m
What Affects the Results
How can I try�shared indexes?
42m
You Are Using Bundled Shared Indexes
Downloading Shared Indexes
Also check the Settings/Preferences
Downloadable Shared Indexes CDN Use
Try Project Shared Indexes
Follow the Guide: How To Try Shared Indexes
Shared Indexes in�IntelliJ Platform
47m
Shared Indexes Naming
Shared Indexes: IntelliJ Community
Shared Indexes: IntelliJ Ultimate
Shared Indexes: IntelliJ-based IDEs
Shared Indexes or �How we made�indexing complete faster
Q & A / Thanks!
twitter: @jonnyzzz / email: jo@jetbrains.com
twitter: @jonnyzzz / email: jo@jetbrains.com
Thanks!
// THE END
Shared Indexes for IntelliJ-based IDEs
How would IDE look for a symbol?
GoLand
Attach the shared index
Try Shared Indexes for Your Project