discourse/plugins
Roman Rizzi a27e20c300
PERF: Speed up embedding text preparation. (#33791)
When collecting text for vectorizing a topic, we iterate over as many
posts as possible within the context window, parsing their cooked
attribute using Nokogiri. We noticed this method doesn't scale well when
working with larger contexts.

Instead, we'll collect as much unparsed cooked text as we can, then
parse it all in a single Nokogiri call.

I ran this a hundred times in a benchmark, and the perf gains are
significant:

```
user     system total        real
prepare_target_text:           114.887620   3.731693 118.619313 (118.952465)
prepare_target_text_bis:        10.264950   0.186204  10.451154 ( 10.465957)
```

Tried running it 1k times, but the old method took too long.
2025-07-23 13:52:48 -03:00
..
automation Update translations (#33746) 2025-07-23 00:13:58 +02:00
chat Update translations (#33746) 2025-07-23 00:13:58 +02:00
checklist DEV: Silence post-stream-widget-overrides in the checklist plugin (#33743) 2025-07-22 14:47:33 -03:00
discourse-adplugin Update translations (#33788) 2025-07-23 12:39:43 +02:00
discourse-affiliate Update translations (#33746) 2025-07-23 00:13:58 +02:00
discourse-ai PERF: Speed up embedding text preparation. (#33791) 2025-07-23 13:52:48 -03:00
discourse-apple-auth Update translations (#33746) 2025-07-23 00:13:58 +02:00
discourse-assign Update translations (#33746) 2025-07-23 00:13:58 +02:00
discourse-calendar Update translations (#33746) 2025-07-23 00:13:58 +02:00
discourse-chat-integration Update translations (#33746) 2025-07-23 00:13:58 +02:00
discourse-data-explorer Update translations (#33746) 2025-07-23 00:13:58 +02:00
discourse-details UX: show all preinstalled plugins and label them as such (#33681) 2025-07-17 15:11:52 -04:00
discourse-gamification FIX: Suspended and deleted users from showing on Leaderboards (#33627) 2025-07-23 09:39:28 -05:00
discourse-github Update translations (#33746) 2025-07-23 00:13:58 +02:00
discourse-graphviz DEV: Move discourse-graphviz to core (#33570) 2025-07-15 16:38:05 +02:00
discourse-hcaptcha Update translations (#33746) 2025-07-23 00:13:58 +02:00
discourse-lazy-videos UX: show all preinstalled plugins and label them as such (#33681) 2025-07-17 15:11:52 -04:00
discourse-local-dates UX: show all preinstalled plugins and label them as such (#33681) 2025-07-17 15:11:52 -04:00
discourse-login-with-amazon Update translations (#33746) 2025-07-23 00:13:58 +02:00
discourse-lti Update translations (#33746) 2025-07-23 00:13:58 +02:00
discourse-math DEV: Move discourse-math to core (#33570) 2025-07-15 16:38:05 +02:00
discourse-microsoft-auth Update translations (#33746) 2025-07-23 00:13:58 +02:00
discourse-narrative-bot UX: show all preinstalled plugins and label them as such (#33681) 2025-07-17 15:11:52 -04:00
discourse-oauth2-basic Update translations (#33746) 2025-07-23 00:13:58 +02:00
discourse-openid-connect Update translations (#33746) 2025-07-23 00:13:58 +02:00
discourse-patreon Update translations (#33746) 2025-07-23 00:13:58 +02:00
discourse-policy Update translations (#33746) 2025-07-23 00:13:58 +02:00
discourse-post-voting Update translations (#33788) 2025-07-23 12:39:43 +02:00
discourse-presence UX: show all preinstalled plugins and label them as such (#33681) 2025-07-17 15:11:52 -04:00
discourse-reactions Update translations (#33746) 2025-07-23 00:13:58 +02:00
discourse-rss-polling Update translations (#33746) 2025-07-23 00:13:58 +02:00
discourse-solved DEV: Enhance how the Solve plugin displays the accepted answer (#33757) 2025-07-23 12:01:35 -03:00
discourse-subscriptions Update translations (#33746) 2025-07-23 00:13:58 +02:00
discourse-templates Update translations (#33788) 2025-07-23 12:39:43 +02:00
discourse-topic-voting Update translations (#33746) 2025-07-23 00:13:58 +02:00
discourse-user-notes Update translations (#33746) 2025-07-23 00:13:58 +02:00
discourse-zendesk-plugin Update translations (#33746) 2025-07-23 00:13:58 +02:00
footnote UX: rich editor footnotes position (#32566) 2025-05-05 09:12:09 -03:00
poll UX: show all preinstalled plugins and label them as such (#33681) 2025-07-17 15:11:52 -04:00
spoiler-alert DEV: Replace toolbar popup menu with DMenu (#33247) 2025-07-03 09:57:16 +10:00
styleguide UX: show all preinstalled plugins and label them as such (#33681) 2025-07-17 15:11:52 -04:00