Should history manager cache results? · Issue #15388 · ipython/ipython · GitHub
Skip to content

Should history manager cache results? #15388

Open

Description

@krassowski

JupyterLab has inline completion which searches the history based on what user types. Since user usually types extra characters, it could be faster if instead of redoing the computation we filtered within previous results. In ipykernel this is exposed in https://github.com/ipython/ipykernel/blob/213cbf668219fe4e62afc97ee875bb9ead893899/ipykernel/ipkernel.py#L626-L641

Same optimization might be useful for IPython history completions too.

Activity

  1. krassowski commented on Sep 9, 2026

    @krassowski
    MemberAuthor

    It looks like caching results is not useful in itself - see LLM benchmarking report in https://gist.github.com/krassowski/e8a11492e760d54f72b419e860f6b656.

    Adding a covering index isntead might give us a significant boost (worst case scenario goes down from 183 ms to 37 ms at 1M history rows) at a cost of 50% increase disk usage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions