Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ruby/rdoc
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: ruby/rdoc
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: opt/server-render-speed
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 3 commits
  • 6 files changed
  • 1 contributor

Commits on Mar 16, 2026

  1. Memoize search_snippet on code objects for 13x faster warm search index

    search_snippet calls snippet() which does full markup parsing + HTML
    conversion. For ruby/ruby with thousands of methods, this dominated
    the search index build time (5.2s cold).
    
    Cache the computed snippet on each code object. After a file change,
    only the affected objects recompute (methods are recreated; ClassModule
    snippets are invalidated in rebuild_comment_from_location).
    
    Results: search_index_warm drops from ~5200ms to ~390ms.
    st0012 committed Mar 16, 2026
    Configuration menu
    Copy the full SHA
    0472eb5 View commit details
    Browse the repository at this point in the history
  2. Pre-build search index on server startup

    Build the search index before accepting connections so it's
    ready for the first request. This moves the 3.6s cold build cost
    from the first search_data.js request to the startup phase where
    the user is already waiting for parsing to complete.
    
    Also populates the search_snippet caches on all code objects,
    making subsequent rebuilds after file changes much faster (~380ms).
    st0012 committed Mar 16, 2026
    Configuration menu
    Copy the full SHA
    105afbf View commit details
    Browse the repository at this point in the history
  3. Make methods list lazy to speed up refresh_store_data

    The methods list (flat_map + sort of 10K+ methods from all classes)
    was computed eagerly on every refresh_store_data call. Since it's
    only needed for building the search index, compute it lazily on
    first access and cache until the next refresh.
    
    Results: refresh_store_time drops from 64ms to 2.9ms (22x faster).
    reparse_cycle_time drops from 309ms to 222ms.
    st0012 committed Mar 16, 2026
    Configuration menu
    Copy the full SHA
    d7f367d View commit details
    Browse the repository at this point in the history
Loading