1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-01 10:28:13 +00:00
serenity/Userland/Applications
davidot e746360b9a LibJS: Use NaN boxing to decrease the memory size of Values
Using the fact that there are 2^52-2 NaN representations we can
"NaN-box" all the Values possible. This means that Value no longer has
an explicit "Type" but that information is now stored in the bits of a
double. This is done by "tagging" the top two bytes of the double.
For a full explanation see the large comment with asserts at the top of
Value.

We can also use the exact representation of the tags to make checking
properties like nullish, or is_cell quicker. But the largest gains are
in the fact that the size of a Value is now halved.

The SunSpider and other benchmarks have been ran to confirm that there
are no regressions in performance compared to the previous
implementation. The tests never performed worse and in some cases
performed better. But the biggest differences can be seen in memory
usage when large arrays are allocated. A simple test which allocates a
1000 arrays of size 100000 has roughly half the memory usage.

There is also space in the representations for future expansions such as
tuples and records.

To ensure that Values on the stack and registers are not lost during
garbage collection we also have to add a check to the Heap to check for
any of the cell tags and extracting the canonical form of the pointer
if it matches.
2022-08-15 17:11:25 +02:00
..
3DFileViewer Base: Launch FileSystemAccessServer at session start-up 2022-08-14 21:52:35 +01:00
About Everywhere: Add sv suffix to strings relying on StringView(char const*) 2022-07-12 23:11:35 +02:00
AnalogClock Everywhere: Add sv suffix to strings relying on StringView(char const*) 2022-07-12 23:11:35 +02:00
Assistant Everywhere: Replace single-char StringView op. arguments with chars 2022-07-12 23:11:35 +02:00
Browser Browser: Rename menu item from "Settings" to "Browser Settings" 2022-08-14 23:33:28 +02:00
BrowserSettings Applications: Make settings outer margins and spacing consistent 2022-07-15 12:34:25 +02:00
Calculator Calculator: Set button colors from system palette 2022-07-17 08:44:31 +01:00
Calendar Everywhere: Add sv suffix to strings relying on StringView(char const*) 2022-07-12 23:11:35 +02:00
CharacterMap Everywhere: Add sv suffix to strings relying on StringView(char const*) 2022-07-12 23:11:35 +02:00
ClockSettings Everywhere: Add sv suffix to strings relying on StringView(char const*) 2022-07-12 23:11:35 +02:00
CrashReporter CrashReporter: Turn off line wrapping in the various text editors 2022-08-01 10:29:53 +02:00
Debugger Everywhere: Make the codebase more architecture aware 2022-07-27 21:46:42 +00:00
DisplaySettings DisplaySettings: Add an Effects tab 2022-08-09 12:08:21 +02:00
FileManager FileManager: Add 'Set as Desktop Wallpaper' action to file context menu 2022-08-14 09:44:08 +01:00
FontEditor FontEditor: Mark pasted glyphs as modified 2022-08-14 13:59:19 +01:00
Help Base: Launch FileSystemAccessServer at session start-up 2022-08-14 21:52:35 +01:00
HexEditor Base: Launch FileSystemAccessServer at session start-up 2022-08-14 21:52:35 +01:00
ImageViewer Everywhere: Add sv suffix to strings relying on StringView(char const*) 2022-07-12 23:11:35 +02:00
KeyboardMapper Everywhere: Add sv suffix to strings relying on StringView(char const*) 2022-07-12 23:11:35 +02:00
KeyboardSettings KeyboardSettings: Improve KeymapDialog layout 2022-07-15 12:34:25 +02:00
Magnifier Everywhere: Add sv suffix to strings relying on StringView(char const*) 2022-07-12 23:11:35 +02:00
Mail Base: Launch WebContent at session start-up 2022-08-14 21:52:35 +01:00
MailSettings Applications: Make settings outer margins and spacing consistent 2022-07-15 12:34:25 +02:00
MouseSettings MouseSettings: Show highlight toggle shortcut and new layout tweaks 2022-07-24 15:10:01 +01:00
NetworkSettings NetworkSettings: Remove warning about reboot 2022-07-14 23:26:47 +02:00
PartitionEditor Base: Add Icon for Partition Editor 2022-08-14 00:52:56 +01:00
PDFViewer Base: Launch FileSystemAccessServer at session start-up 2022-08-14 21:52:35 +01:00
Piano Piano: Replace knob instantiations with ProcessorParameterWidgets 2022-07-25 15:25:13 +02:00
PixelPaint Base: Launch ImageDecoder at session start-up 2022-08-14 21:52:35 +01:00
Run Run: Trigger on escape key only once 2022-08-02 12:54:39 +01:00
Settings Everywhere: Add sv suffix to strings relying on StringView(char const*) 2022-07-12 23:11:35 +02:00
SoundPlayer LibDSP: Rename library namespace to DSP 2022-07-19 11:17:45 +01:00
SpaceAnalyzer Everywhere: Replace single-char StringView op. arguments with chars 2022-07-12 23:11:35 +02:00
Spreadsheet LibJS: Use NaN boxing to decrease the memory size of Values 2022-08-15 17:11:25 +02:00
SystemMonitor SystemMonitor: Add some margin around widgets in the process inspector 2022-08-14 23:33:28 +02:00
Terminal Terminal: Update window size increments on terminal font change 2022-08-14 23:33:28 +02:00
TerminalSettings Everywhere: Add sv suffix to strings relying on StringView(char const*) 2022-07-12 23:11:35 +02:00
TextEditor TextEditor: Display widget when needle not found in replace all 2022-08-15 13:09:56 +02:00
ThemeEditor Base: Launch FileSystemAccessServer at session start-up 2022-08-14 21:52:35 +01:00
VideoPlayer LibDSP: Rename library namespace to DSP 2022-07-19 11:17:45 +01:00
Welcome Base: Launch WebContent at session start-up 2022-08-14 21:52:35 +01:00
CMakeLists.txt PartitionEditor: Add the beginnings of a partition editor :^) 2022-07-21 20:13:44 +01:00