Skip to content

TreeItem is too slow #56234

@fabiospampinato

Description

@fabiospampinato
  • VSCode Version: 1.25.1
  • OS Version: 10.13.5

I've added the following view to Todo+:

screen shot 2018-08-13 at 00 58 43

I've been benchmarking it against magento2, which contains about 30k files and 2M lines of code. If the user has ag installed in his system the process of finding those todos is quite fast, its takes about 4s to do that on my laptop.

Quite surprisingly though the bulk of the time is spent on these lines, which are executed about 1k times, since the extension creates about 1k TreeItems under these circumstances:

screen shot 2018-08-13 at 01 05 42

  • Adding the tooltips requires about 500 extra milliseconds, I would expect that number to be near 0ms, I see basically nothing going on here that can justify that number.

  • Adding the commands requires about 4 extra seconds. 4 seconds for doing what? Creating those objects should be almost free, and until those TreeItems get clicked they don't even change anything as far as the user is concerned, I think.

  • Adding the icons requires about 14 extra seconds. There are less than 10 different images loaded, but for some reason loading them a few hundred times is that slow.

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable bugtree-viewsExtension tree view issues

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions