←back to thread

205 points samspenc | 4 comments | | HN request time: 0.651s | source
1. Sharlin ◴[] No.45147603[source]
Hmm, so what exactly is stored in that gigabyte of tooltips? Even 100,000 tooltips per language should take maybe a few tens of megabytes of space. How many localizations does the editor have?
replies(1): >>45147729 #
2. lukan ◴[] No.45147729[source]
It is not the text data. It is that every tool tip gets made into an UI element.

"Firstly, despite its name, the function doesn’t just set the text of a tooltip; it spawns a full tooltip widget, including sub-widgets to display and layout the text, as well as some helper objects. This is not ideal from a performance point of view. The other problem? Unreal does this for every tooltip in the entire editor, and there are a lot of tooltips in Unreal. In fact, up to version 5.6, the text for all the tooltips alone took up around 1 GB of storage space."

But I assume the 1GB storage for all tooltips include boilerplate. I doubt it is 1 GB of raw text.

replies(2): >>45147819 #>>45152260 #
3. Sharlin ◴[] No.45147819[source]
Yes, I meant the size on disk. I presume the serialization format isn't the most efficient possible. But I can't think of any particular boilerplate that you'd want to store in a file that's just supposed to store localization strings.
4. cardanome ◴[] No.45152260[source]
That seems like a very wastefull way to implement tooltips.

The user can ever only see one single tooltip. (Or maybe more if you have tooltips for tooltips but I don't think Unreal has that, point is, a limited number.)

So initialize a single tooltip object. When the users mouses over an element with an tooltip, set the appropriate text, move the tooltip widget to the right position and show it. If the user moves away, hide it.

Simple and takes nearly no memory. Seems like some people still suffer from 90s OOP brain rot.