Fork me on GitHub
#tree-sitter
<
2020-02-19
>
sogaiu04:02:35

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.

pez05:02:56

I fail at finding the thread to profile.

sogaiu05:02:27

if so, the base frequency is nicer

sogaiu05:02:10

as well as some other things 🙂

sogaiu06:02:40

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

sogaiu06:02:21

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

pez06:02:20

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

pez06:02:39

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

sogaiu07:02:49

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

pez07:02:55

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

sogaiu07:02:07

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

pez07:02:22

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

sogaiu08:02:50

ok, may be we're both doing it ok then 🙂