idk much about this UI thing because i'm a backend developer but i painstakingly split the hero art into several animated background layers so that i could swap out the character based on if you get a 404 or 500 or something (and it means dark mode's gonna be sick)
In the next version of Bun
Bun.stringWidth() 处理中文、日文、韩文字符的速度提升了 7~56 倍
Bun.stringWidth() が中国語・日本語・韓国語の文字で 7〜56 倍高速化されました
Bun.stringWidth()가 중국어·일본어·한국어 문자에서 7~56배 빨라졌습니다
How is Elysia 2 this fast
It's the "zero-copy" approach
It's very easy to allocate a new array/object, eg. { ...a, ...b } or [...a] or a.concat(b)
We basically reuse things as much as possible
For example, when user provides a primitive validator with an empty option (eg. t.String()), instead of creating a new object, we reuse an existing one instead, marking it as "reference"
Another example is when merging local and global lifecycle, merging multiple objects is an easy way out, but this means if you have a new 100k objects, user-provided and existing blueprint is there doing nothing after these new objects are created
Instead, we use the object that the user provided as a base to mutate later, then store the snapshot of what is needed to process as a "reference", then "link" all objects and arrays when they are actually needed
This means we basically reuse the input instead of creating a new one
But this is hard to do in JavaScript because there's no explicit reference or pointer
If you accidentally change the reference value, you will blow something up instantly and have no idea how or where because there's no explicit "reference", no indicator at all
If you didn't properly design with this approach at the very start and constantly have this approach in mind, it's not going to work
This means we have to rewrite the entire thing from the ground up, and it's extremely hard
This is why I haven't been very active since the new year, I was busy playing around with this just to make sure it would work at this scale