# Compartment performance question

**URL:** https://discuss.codemirror.net/t/compartment-performance-question/9891
**Category:** Uncategorized
**Created:** [September 21, 2026, 9:41pm UTC](https://discuss.codemirror.net/t/compartment-performance-question/9891 "2026-09-21T21:41:11Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![feraxhp](https://discuss.codemirror.net/user_avatar/discuss.codemirror.net/feraxhp/32/4963_2.png) [@feraxhp](https://discuss.codemirror.net/u/feraxhp)
#### Post date: [September 21, 2026, 9:41pm UTC](https://discuss.codemirror.net/t/compartment-performance-question/9891/1 "2026-09-21T21:41:11Z")

</div>

HI, i have a question on what is actually better for a dynamic theme to be configured. I have a set of specs that are based on `css variables`. that means that the theme specs will never change. But the current behavior of the theme plugins is to update all the theme on a compartment to handle the transaction for the editor to realize that the theme change form light to dark, and so on…

1. Is it better to have _ **1 theme** _ in the compartment that has the specs and the (`isDark`) option in it, or is it better to have _ **2 themes** _, one with the specs and the other with the option (`isDark`) on the compartment?
2. is there other way to send the transaction for the theme (light or dark) on the editor?

My main concern is that 1 theme holding both will cause an necessary processing of the specs that will not change at all.

---

<div class="post-metadata">

### Author: ![marijn](https://discuss.codemirror.net/user_avatar/discuss.codemirror.net/marijn/32/136_2.png) [@marijn](https://discuss.codemirror.net/u/marijn)
#### Post date: [September 22, 2026, 5:28am UTC](https://discuss.codemirror.net/t/compartment-performance-question/9891/2 "2026-09-22T05:28:59Z")

</div>

> [@feraxhp](#):
>
> 1. Is it better to have _ **1 theme** _ in the compartment that has the specs and the (`isDark`) option in it, or is it better to have _ **2 themes** _, one with the specs and the other with the option (`isDark`) on the compartment?

I don’t think this will matter at all, performance-wise.

> [@feraxhp](#):
>
> 1. is there other way to send the transaction for the theme (light or dark) on the editor?

A compartment is the most straightforward way to handle this, I think.
