JetBrains / JetBrains/markdown

Markdown makes huge amount of memory allocations during indexing

Open
#120 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Kotlin
Stars
958
Forks
104
Avg merge
17h 30m
Merged PRs (30d)
12

Description

The `LookaheadText.testFromPosition` depends on `String.subSequence` which actually copies the content over to a new array:
ultimate – LookaheadText kt  jetbrains markdown  2023-05-18 21-17-40

As a result during 15s of indexing, even 1.7GB of data can be allocated. You can check it out by profiling indexing of https://github.com/JetBrains/ring-ui/tree/master in WebStorm.

It seems that it would be best to use something similar to `com.intellij.util.text.CharSequenceSubSequence` to save a lot on memory allocations.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.