You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/index.md
+35-4Lines changed: 35 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -90,8 +90,39 @@ to their generic docstrings. Here are some of those supported functions:
90
90
-`eachmatch`
91
91
-`match`
92
92
-`occursin`
93
-
<!-- - `startswith` [TODO] -->
94
-
<!-- - `endswith` [TODO] -->
95
-
<!-- - `findnext` [TODO] -->
96
-
<!-- - `findprev` [TODO] -->
97
93
94
+
## Performance
95
+
96
+
The code search performance bottleneck is parsing. The search itself is about 20x faster
97
+
than parsing and similar in performance to an optimized regex library. Consequently, if you
98
+
want high performance repeated code search, you should cache parsed SyntaxNodes and pass
99
+
them directly to search functions.
100
+
101
+
#### Benchmarks
102
+
103
+
Using the [395 lines of source code of this package as of 6820e64232](https://github.com/LilithHafner/CodeSearch.jl/blob/6820e642320f803407bcbc07e691277dc4d91ae4/src/CodeSearch.jl)
104
+
as a test case, on a 2022 M2 mac running [Asahi Linux](https://asahilinux.org/), we can see the following performance:
0 commit comments