# ProseMirror vs Lexical performance test

**URL:** <https://discuss.prosemirror.net/t/prosemirror-vs-lexical-performance-test/7681>\
**Category:** Uncategorized\
**Created:** [October 6, 2024, 11:28pm UTC](https://discuss.prosemirror.net/t/prosemirror-vs-lexical-performance-test/7681 "2024-10-06T23:28:21Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![ViktorVaczi](https://discuss.prosemirror.net/user_avatar/discuss.prosemirror.net/viktorvaczi/32/1919_2.png) [@ViktorVaczi](https://discuss.prosemirror.net/u/ViktorVaczi)\
**Post date:** [October 6, 2024, 11:28pm UTC](https://discuss.prosemirror.net/t/prosemirror-vs-lexical-performance-test/7681/1 "2024-10-06T23:28:21Z")

</div>

Hey everyone,

At [Emergence Engineering](https://emergence-engineering.com/) we were curious about Lexical, Meta’s relatively new rich text editor framework. We’ve been working with ProseMirror for a long time, and a new contender in this space is always interesting, especially if it’s backed by a huge company. So we tested both on the performance front to see if Meta’s solution is better or not:

> **[Rich Text Editors in Action: Stress Test On Lexical and ProseMirror](https://emergence-engineering.com/blog/lexical-prosemirror-comparison)**
>
> This article explores how Lexical and ProseMirror handle long-term use and heavy data stress.

My conclusion: ProseMirror wins.

---

<div class="post-metadata">

**Author:** ![mustafa0x](https://discuss.prosemirror.net/user_avatar/discuss.prosemirror.net/mustafa0x/32/1045_2.png) [@mustafa0x](https://discuss.prosemirror.net/u/mustafa0x)\
**Post date:** [October 8, 2024, 4:57am UTC](https://discuss.prosemirror.net/t/prosemirror-vs-lexical-performance-test/7681/2 "2024-10-08T04:57:01Z")

</div>

Thanks, interesting post!

> Meanwhile, we recorded the timestamps in every 200 nodes to see how the increasing content affects their speed (and loss).

This statement wasn’t completely clear to me.

> **Conclusions** : Lexical’s total of script executing time increases faster than ProseMirror’s, which is probably linked to its **faster** handling of increasing content and more frequent garbage collection.

I think this should be “slower handling of increasing content”.

 ![image](https://discuss.prosemirror.net/uploads/secondsite/original/2X/6/6da2f90c0399860bf9c1cb9f8dbf411ad6f99aa7.png)

Memory usage difference is over 2 orders of magnitude?!

---

<div class="post-metadata">

**Author:** ![ViktorVaczi](https://discuss.prosemirror.net/user_avatar/discuss.prosemirror.net/viktorvaczi/32/1919_2.png) [@ViktorVaczi](https://discuss.prosemirror.net/u/ViktorVaczi)\
**Post date:** [October 9, 2024, 10:14pm UTC](https://discuss.prosemirror.net/t/prosemirror-vs-lexical-performance-test/7681/3 "2024-10-09T22:14:54Z")

</div>

Hey,

we just got an update for this article and the memory consumption was caused by Lexical’s history plugin. Without that they’re kind of similar, will post an update soon!

---

<div class="post-metadata">

**Author:** ![prosed](https://discuss.prosemirror.net/letter_avatar_proxy/v4/letter/p/aeb1de/32.png) [@prosed](https://discuss.prosemirror.net/u/prosed)\
**Post date:** [October 10, 2024, 11:51pm UTC](https://discuss.prosemirror.net/t/prosemirror-vs-lexical-performance-test/7681/4 "2024-10-10T23:51:07Z")

</div>

It seems like the only place Lexical surpasses ProseMirror is in `LayoutCount`.

I wonder if, in the long run, ProseMirror could be optimized in this regard.

---

<div class="post-metadata">

**Author:** ![ViktorVaczi](https://discuss.prosemirror.net/user_avatar/discuss.prosemirror.net/viktorvaczi/32/1919_2.png) [@ViktorVaczi](https://discuss.prosemirror.net/u/ViktorVaczi)\
**Post date:** [October 11, 2024, 12:47am UTC](https://discuss.prosemirror.net/t/prosemirror-vs-lexical-performance-test/7681/5 "2024-10-11T00:47:19Z")

</div>

For me it looks like Lexical has a little bit better performance, worse docs, same bundle size, worse community / tooling.

---

<div class="post-metadata">

**Author:** ![prosed](https://discuss.prosemirror.net/letter_avatar_proxy/v4/letter/p/aeb1de/32.png) [@prosed](https://discuss.prosemirror.net/u/prosed)\
**Post date:** [October 13, 2024, 10:18pm UTC](https://discuss.prosemirror.net/t/prosemirror-vs-lexical-performance-test/7681/6 "2024-10-13T22:18:50Z")

</div>

I don’t understand how Lexical has better performance. The results seem to suggest otherwise except for that single point. Can you elaborate on your thoughts?

---

<div class="post-metadata">

**Author:** ![ViktorVaczi](https://discuss.prosemirror.net/user_avatar/discuss.prosemirror.net/viktorvaczi/32/1919_2.png) [@ViktorVaczi](https://discuss.prosemirror.net/u/ViktorVaczi)\
**Post date:** [October 13, 2024, 11:31pm UTC](https://discuss.prosemirror.net/t/prosemirror-vs-lexical-performance-test/7681/7 "2024-10-13T23:31:15Z")

</div>

It’s in the first graph: it does more nodes in less time. I find it hard to make real sense of the results too btw 🙂 The higher scriptTime could mean that it would choke the even queue earlier ( with more plugins etc ), then ProseMirror could be faster, but I didn’t want to get into such theories.

Will publish the updated results this week ( without History, which caused the high memory usage ), they show a little bit of lead for Lexical in every graph except memory which is still a bit higher.

---

<div class="post-metadata">

**Author:** ![prosed](https://discuss.prosemirror.net/letter_avatar_proxy/v4/letter/p/aeb1de/32.png) [@prosed](https://discuss.prosemirror.net/u/prosed)\
**Post date:** [October 14, 2024, 6:50pm UTC](https://discuss.prosemirror.net/t/prosemirror-vs-lexical-performance-test/7681/8 "2024-10-14T18:50:54Z")

</div>

Does Lexical include history in its core? I feel like testing without history paints an unrealistic picture of real-world use, although it does get to the core functionality better.

I see I read the NodeCount results inverse of what was intended though, so that explains a bit of my confusion.

I still agree that ProseMirror is the right choice these days. I did a lot of research into Lexical and started implementing it before I threw up my hands and moved to ProseMirror (via TipTap.)

---

<div class="post-metadata">

**Author:** ![ViktorVaczi](https://discuss.prosemirror.net/user_avatar/discuss.prosemirror.net/viktorvaczi/32/1919_2.png) [@ViktorVaczi](https://discuss.prosemirror.net/u/ViktorVaczi)\
**Post date:** [October 31, 2024, 1:39pm UTC](https://discuss.prosemirror.net/t/prosemirror-vs-lexical-performance-test/7681/9 "2024-10-31T13:39:39Z")

</div>

Update: we’ve re-tested with disabled History in Lexical, now they’re close with Lexical usually leading a little bit. Check the updated article! Still, ProseMirror is the better choice nowadays.
