tree-sitter

tree-sitter fun
2020-02-19T04:16:35.042100Z

i tried to compute the total for range creation for clojure.core and the numbers i'm seeing are 130ms to 140ms -- that's totaling up the difference between times right before creating a range and right after creation. my initial measurements suggest that just traversing the tree (no range creation and thus no coloring either) takes 200ms or so. may be i should try using the query api to see if there is any difference in taversal speed. i'm not sure if i'm doing this stuff right though (collecting (.getTime (js/Date.))) -- will try to go over this stuff more again later.

pez 2020-02-19T05:36:56.042900Z

I fail at finding the thread to profile.

2020-02-19T05:47:32.044100Z

i found this but haven't digested it yet: https://www.nicoespeon.com/en/2019/11/fix-vscode-extension-performance-issue/

2020-02-19T05:57:48.044800Z

btw, the machine i'm testing on is one of these: https://www.msi.com/Content-creation/Prestige-15-A10X/Specification

2020-02-19T05:58:27.045600Z

if so, the base frequency is nicer

2020-02-19T05:59:10.045900Z

as well as some other things πŸ™‚

2020-02-19T06:44:40.046Z

it looks like the profiler agrees that making ranges takes around 130 ms here

2020-02-19T06:45:21.046800Z

i got this info by adapting the steps from the article posted earlier

pez 2020-02-19T06:46:48.047100Z

Cool!!!

pez 2020-02-19T06:50:20.048900Z

Can you somehow see if making ranges for large files is somehow more expensive than in β€œnormal” files?

pez 2020-02-19T06:50:39.049600Z

Maybe it rather is things like doc.positionAt that takes increasingly longer.

2020-02-19T07:03:49.049800Z

i chose clojure's main.clj which is approximately 1/10 in length:

$ ls -al main.clj core.clj 
-rw-r--r-- 1 user user 263653 Feb 10 12:18 core.clj
-rw-r--r-- 1 user user  26200 Aug 14  2019 main.clj
the time it took was about 1/10 as well

2020-02-19T07:04:07.050200Z

wdyt?

pez 2020-02-19T07:07:55.051100Z

I think that I need to profile my code a bit closer. 😎

2020-02-19T07:10:07.052Z

ha ha ha πŸ™‚ well, i hope i'm not screwing things up on this end -- it's entirely possbile!

pez 2020-02-19T07:25:22.053100Z

Very good. Now I measure it in a way that doesn't indicate the increasing cost of Postions and Ranges for larger files.

2020-02-19T08:24:50.053500Z

ok, may be we're both doing it ok then πŸ™‚