Adding the complete architecture for search benchmarking#2740
Adding the complete architecture for search benchmarking#2740mortenpi merged 48 commits intoJuliaDocs:masterfrom
Conversation
test/search/real_search.jl
Outdated
| end | ||
|
|
||
| # Run the wrapper | ||
| result = read(`node -e $wrapper_js`, String) |
There was a problem hiding this comment.
Since we already have a file, can't we just do node file.js?
There was a problem hiding this comment.
but we're replacing the placeholders with their values here
wrapper_js = replace(wrapper_js, "__SEARCH_INDEX__" => JSON.json(search_index_data))
wrapper_js = replace(wrapper_js, "__QUERY__" => "\"" * query * "\"")
There was a problem hiding this comment.
A couple of thoughts:
- We could add a
make search-benchmarkscommand: https://github.com/JuliaDocs/Documenter.jl/blob/master/Makefile - We could add a simple CI job that runs these benchmarks on CI. It should be fine to just copy-paste a thing here for now: https://github.com/JuliaDocs/Documenter.jl/blob/master/.github/workflows/CI.yml
- It would be good to have a more realistic reference manual / search index we test against. Options: Documenter's manual or Julia manual. As we discussed on the call, let's start with Documenter.
There was a problem hiding this comment.
This duplicates the search.js, so it would be good to somehow avoid the duplication here by reusing the search.js in the tests. It would likely require some changes on how we handle the search.js file.
Documenter.jl/assets/html/js/search.js
Lines 189 to 216 in 022c013
…jl and ensured that the Node.js process runs in the correct directory
mortenpi
left a comment
There was a problem hiding this comment.
I think I would be happy to merge this as the first iteration if we could get the duplication & version number sorted as well!
test/search/real_search.jl
Outdated
| write(io, wrapper_js) | ||
| close(io) | ||
| cd(@__DIR__) do | ||
| result = read(`node $path`, String) |
There was a problem hiding this comment.
Could we make this use the Node JLL? This means that the user wouldn't have to install Node just to run the benchmarks -- we can pull it in via the Julia package manager.
There's some example usage here for example: https://github.com/JuliaComputing/MultiDocumenter.jl/blob/e112da8b744f3393d037a7380e544797c2a41953/src/search/pagefind.jl#L31-L55
.github/workflows/CI.yml
Outdated
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '20.x' | ||
| - name: Install Node.js dependencies | ||
| run: npm install | ||
| working-directory: test/search |
There was a problem hiding this comment.
If we switch to the Node JLL, we can remove these.
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20.x' | |
| - name: Install Node.js dependencies | |
| run: npm install | |
| working-directory: test/search |
…aceholder with its value
|
how's this implementation @mortenpi ? |
this closes #2417.