1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2026-01-16 00:11:00 +00:00
serenity/Userland/Applications/Spreadsheet
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
..
CellType Everywhere: Add sv suffix to strings relying on StringView(char const*) 2022-07-12 23:11:35 +02:00
Readers Everywhere: Add sv suffix to strings relying on StringView(char const*) 2022-07-12 23:11:35 +02:00
Tests Spreadsheet: Throw if lookup value doesn't exist and no default is given 2022-06-26 22:21:17 +01:00
Writers Everywhere: Replace single-char StringView op. arguments with chars 2022-07-12 23:11:35 +02:00
Cell.cpp Everywhere: Replace single-char StringView op. arguments with chars 2022-07-12 23:11:35 +02:00
Cell.h Spreadsheet: Display a detailed view of a cell error on hover 2022-06-26 22:21:17 +01:00
CellSyntaxHighlighter.cpp Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
CellSyntaxHighlighter.h Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
CellTypeDialog.cpp Spreadsheet: Make conditional-formatting condition-list scrollable 2022-06-30 11:53:50 +02:00
CellTypeDialog.h Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
CMakeLists.txt Userland: Depend some applications on WebContent if it's being used 2022-05-26 21:54:58 +01:00
CondFormatting.gml Spreadsheet: Make conditional-formatting condition-list scrollable 2022-06-30 11:53:50 +02:00
ConditionalFormatting.h LibGUI: Rename ScrollableWidget => AbstractScrollableWidget 2021-05-03 21:03:13 +02:00
CondView.gml Spreadsheet: Use new layout system 2022-06-30 11:51:25 +02:00
csv_export.gml Userland: Run gml-format 2022-02-13 02:36:35 +02:00
csv_import.gml Userland: Run gml-format 2022-02-13 02:36:35 +02:00
ExportDialog.cpp Everywhere: Add sv suffix to strings relying on StringView(char const*) 2022-07-12 23:11:35 +02:00
ExportDialog.h Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
Forward.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
HelpWindow.cpp Everywhere: Add sv suffix to strings relying on StringView(char const*) 2022-07-12 23:11:35 +02:00
HelpWindow.h LibWebView: Move OutOfProcessWebView to a new LibWebView library 2022-05-15 12:17:36 +02:00
ImportDialog.cpp Everywhere: Add sv suffix to strings relying on StringView(char const*) 2022-07-12 23:11:35 +02:00
ImportDialog.h Spreadsheet: Use FileSystemAccessClient for the reading of files 2022-01-15 22:20:15 +03:30
JSIntegration.cpp LibJS: Use NaN boxing to decrease the memory size of Values 2022-08-15 17:11:25 +02:00
JSIntegration.h LibJS: Let Shape store a Realm instead of a GlobalObject 2022-08-05 12:42:46 +02:00
main.cpp Base: Launch WebContent at session start-up 2022-08-14 21:52:35 +01:00
Position.h Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
select_format_page.gml Userland: Run gml-format 2022-02-13 02:36:35 +02:00
Spreadsheet.cpp Everywhere: Add sv suffix to strings relying on StringView(char const*) 2022-07-12 23:11:35 +02:00
Spreadsheet.h Spreadsheet: Implement undo functionality where missing 2022-04-13 09:26:44 +04:30
SpreadsheetModel.cpp Everywhere: Add sv suffix to strings relying on StringView(char const*) 2022-07-12 23:11:35 +02:00
SpreadsheetModel.h Everywhere: Add sv suffix to strings relying on StringView(char const*) 2022-07-12 23:11:35 +02:00
SpreadsheetView.cpp Spreadsheet: Display a detailed view of a cell error on hover 2022-06-26 22:21:17 +01:00
SpreadsheetView.h Spreadsheet: Display a detailed view of a cell error on hover 2022-06-26 22:21:17 +01:00
SpreadsheetWidget.cpp Everywhere: Add sv suffix to strings relying on StringView(char const*) 2022-07-12 23:11:35 +02:00
SpreadsheetWidget.h Spreadsheet: Allow importing sheets into an existing workbook 2022-06-26 22:21:17 +01:00
Workbook.cpp Spreadsheet: Allow importing sheets into an existing workbook 2022-06-26 22:21:17 +01:00
Workbook.h Spreadsheet: Allow importing sheets into an existing workbook 2022-06-26 22:21:17 +01:00