Skip to content

Instantly share code, notes, and snippets.

@glennsarti
Last active November 23, 2018 01:32
Show Gist options
  • Save glennsarti/b4af7c9b8aa6bcfc0b7cd70ae027530b to your computer and use it in GitHub Desktop.
Save glennsarti/b4af7c9b8aa6bcfc0b7cd70ae027530b to your computer and use it in GitHub Desktop.

Scenarios:

Default - No change to the TokenOperations.FoldableRegions metjhod

No Dupe - Removed the check for duplicate regions (Test case had none)

No Dupe or Sort - Removed the check for duplicate regions and removed the region sorting

FOLDABLEREGIONS ... - These metrics came from calling the FoldableRegions method

GETREGIONS ... - These metrics include creating a script file, tokenizing it and THEN calling the FoldableRegions method

Same test script for all with 3840 detected folding regions

Source Repo - https://github.com/glennsarti/PowerShellEditorServices/tree/syntax-folding-performance


Average Duration of the FoldableRegions method

Default - 121.4589 ms

No Dupe - 121.0129333 ms

No Dupe or Sort - 120.0091 ms


Default:

**************
FOLDABLEREGIONS Before: 09:17:11
FOLDABLEREGIONS After: 09:17:11
**************
FOLDABLEREGIONS Diff: 123.0133
**************
**************
GETREGIONS Before: 09:17:11
GETREGIONS After: 09:17:11
**************
GETREGIONS Regions: 3840
GETREGIONS Diff: 288.9402
**************
**************
FOLDABLEREGIONS Before: 09:19:02
FOLDABLEREGIONS After: 09:19:02
**************
FOLDABLEREGIONS Diff: 120.0022
**************
**************
GETREGIONS Before: 09:19:01
GETREGIONS After: 09:19:02
**************
GETREGIONS Regions: 3840
GETREGIONS Diff: 285.9206
**************
**************
FOLDABLEREGIONS Before: 09:19:14
FOLDABLEREGIONS After: 09:19:14
**************
FOLDABLEREGIONS Diff: 121.3612
**************
**************
GETREGIONS Before: 09:19:14
GETREGIONS After: 09:19:14
**************
GETREGIONS Regions: 3840
GETREGIONS Diff: 298.3641
**************

No Dupe:
**************
FOLDABLEREGIONS Before: 09:22:17
FOLDABLEREGIONS After: 09:22:17
**************
FOLDABLEREGIONS Diff: 120.001
**************
**************
GETREGIONS Before: 09:22:16
GETREGIONS After: 09:22:17
**************
GETREGIONS Regions: 3840
GETREGIONS Diff: 296.9691
**************
**************
FOLDABLEREGIONS Before: 09:22:30
FOLDABLEREGIONS After: 09:22:30
**************
FOLDABLEREGIONS Diff: 117.9986
**************
**************
GETREGIONS Before: 09:22:30
GETREGIONS After: 09:22:30
**************
GETREGIONS Regions: 3840
GETREGIONS Diff: 295.5093
**************
**************
FOLDABLEREGIONS Before: 09:22:44
FOLDABLEREGIONS After: 09:22:44
**************
FOLDABLEREGIONS Diff: 125.0392
**************
**************
GETREGIONS Before: 09:22:44
GETREGIONS After: 09:22:44
**************
GETREGIONS Regions: 3840
GETREGIONS Diff: 301.9997
**************


No Sorting or dupe detect:
**************
FOLDABLEREGIONS Before: 09:19:56
FOLDABLEREGIONS After: 09:19:56
**************
FOLDABLEREGIONS Diff: 117.0299
**************
**************
GETREGIONS Before: 09:19:56
GETREGIONS After: 09:19:56
**************
GETREGIONS Regions: 3840
GETREGIONS Diff: 288.9367
**************
**************
FOLDABLEREGIONS Before: 09:20:12
FOLDABLEREGIONS After: 09:20:12
**************
FOLDABLEREGIONS Diff: 124.9988
**************
**************
GETREGIONS Before: 09:20:12
GETREGIONS After: 09:20:12
**************
GETREGIONS Regions: 3840
GETREGIONS Diff: 290.9987
**************
**************
FOLDABLEREGIONS Before: 09:20:25
FOLDABLEREGIONS After: 09:20:25
**************
FOLDABLEREGIONS Diff: 117.9986
**************
**************
GETREGIONS Before: 09:20:25
GETREGIONS After: 09:20:25
**************
GETREGIONS Regions: 3840
GETREGIONS Diff: 287.9997
**************
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment