# Faster Editor Opening - Reuse Editor instead of new instance?

**URL:** <https://forums.ankiweb.net/t/faster-editor-opening-reuse-editor-instead-of-new-instance/69016>\
**Category:** Development\
**Created:** [February 27, 2026, 6:14pm UTC](https://forums.ankiweb.net/t/faster-editor-opening-reuse-editor-instead-of-new-instance/69016 "2026-02-27T18:14:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![thehafenator](https://avatars.discourse-cdn.com/v4/letter/t/71e660/32.png) [@thehafenator](https://forums.ankiweb.net/u/thehafenator)\
**Post date:** [February 27, 2026, 6:14pm UTC](https://forums.ankiweb.net/t/faster-editor-opening-reuse-editor-instead-of-new-instance/69016/1 "2026-02-27T18:14:09Z")

</div>

Hi there!  
I noticed that on My Surface Pro 9, Windows 11, Anki Version 25.09.2, launching the editor is really slow. I tried a few different things like turning on different power plans, setting anki/python process as high, but it it still takes roughly 1 second for the window to be drawn, and another ~.5-1 second for the content to be visible to the user. This did persist, even using a ‘basic’ card with a few words on the back/front. While 1.5-2 seconds isn’t much for opening up the editor, it does add up overtime.

I wrote a python add on (with help from AI) to cache the editor on startup (see here: [https://ankiweb.net/shared/info/2101230922](https://ankiweb.net/shared/info/2101230922)). It reuses/hides the editor box it is dismissed, and closes it when the application shuts down. A simple Autohotkey script showed that the editor is only able to open/close about 8-10 times in 10 seconds, but the text still doesn’t render between opens, meaning it’s even slower. With the add on, it is opening 28 times in ten seconds and the text is rendered each time. The editor now opens very quickly - `set_note()` on a the cached webview instance is ~40ms, but `EditCurrent. __init__ ()` + webview init is ~700ms.

Looking at the \__init_\_.py DialogManager.open, it does look like this “Fast Path/reopen” already does exist in the code - maybe it’s a bug?

```auto
def open(self, name, \*args, \*\*kwargs):
(creator, instance) = self.\_dialogs\[name\]
if instance:
instance.reopen(\*args, \*\*kwargs) # fast path — already exists
else:
instance = creator(\*args, \*\*kwargs) # slow path — creates new
self.\_dialogs\[name\]\[1\] = instance

```

Because closeEvent always calls cleanup(), markClosed(“EditCurrent”) is always set to None, so every open goes through the slow path:

editcurrent.py line 63-67

```auto
def cleanup(self) → None:
gui_hooks.operation_did_execute.remove(self.on_operation_did_execute)
self.editor.cleanup()
saveGeom(self, “editcurrent”)
aqt.dialogs.markClosed(“EditCurrent”) # ← sets instance to None

def closeEvent(self, evt):
self.editor.call_after_note_saved(self.cleanup) # ← always calls cleanup

```

Just thought I would bring this up. I had wondered if I should suggest this to be added to Anki overall, but it seems like that may have already been the original intent.

---

<div class="post-metadata">

**Author:** ![abdo](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/abdo/32/654_2.png) [@abdo](https://forums.ankiweb.net/u/abdo)\
**Post date:** [February 27, 2026, 7:29pm UTC](https://forums.ankiweb.net/t/faster-editor-opening-reuse-editor-instead-of-new-instance/69016/2 "2026-02-27T19:29:38Z")

</div>

> [@thehafenator](#):
>
> Looking at the _init_.py DialogManager.open, it does look like this “Fast Path/reopen” already does exist in the code - maybe it’s a bug?

DialogManager’s goal is to ensure only a single instance of a dialog is open at any time, so it’s working as expected.

---

<div class="post-metadata">

**Author:** ![thehafenator](https://avatars.discourse-cdn.com/v4/letter/t/71e660/32.png) [@thehafenator](https://forums.ankiweb.net/u/thehafenator)\
**Post date:** [February 27, 2026, 8:04pm UTC](https://forums.ankiweb.net/t/faster-editor-opening-reuse-editor-instead-of-new-instance/69016/3 "2026-02-27T20:04:49Z")

</div>

Thank you for your reply!

Could you explain the logic behind creating a new dialogue box each time instead of reusing an old one? My thought would be that it would be much faster to reuse the existing instance, at the cost of a little bit of ram, and that seems to be case from my testing. Anything I’m missing here?

---

<div class="post-metadata">

**Author:** ![abdo](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/abdo/32/654_2.png) [@abdo](https://forums.ankiweb.net/u/abdo)\
**Post date:** [February 27, 2026, 11:34pm UTC](https://forums.ankiweb.net/t/faster-editor-opening-reuse-editor-instead-of-new-instance/69016/4 "2026-02-27T23:34:41Z")

</div>

Caching windows/pages is just not the norm in apps. I assume a basic implementation wouldn’t be too hard to do, but having to stay compatible with all sorts of add-ons can complicate things considerably. (Anki needs to ensure no hooks/events are run when the editor is hidden)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/1X/8f1279ababc5879d54e4838989f606cfe55af8c7.jpeg) [@system](https://forums.ankiweb.net/u/system)\
**Post date:** [March 29, 2026, 11:34pm UTC](https://forums.ankiweb.net/t/faster-editor-opening-reuse-editor-instead-of-new-instance/69016/5 "2026-03-29T23:34:49Z")

</div>

Closed on March 29, 2026, 11:34pm UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
