mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-31 22:56:04 +00:00
LibWasm: Replace a hashtable with an RBTree to make instantiation faster
...by about 40%.
This commit is contained in:
parent
f1abc36689
commit
8cf0f36f7d
Notes:
sideshowbarker
2024-07-18 23:45:29 +09:00
Author: https://github.com/alimpfard
Commit: 8cf0f36f7d
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/671
2 changed files with 13 additions and 6 deletions
|
@ -8,7 +8,7 @@
|
|||
|
||||
#include <AK/COWVector.h>
|
||||
#include <AK/Debug.h>
|
||||
#include <AK/HashTable.h>
|
||||
#include <AK/RedBlackTree.h>
|
||||
#include <AK/SourceLocation.h>
|
||||
#include <AK/Tuple.h>
|
||||
#include <AK/Vector.h>
|
||||
|
@ -18,6 +18,10 @@
|
|||
namespace Wasm {
|
||||
|
||||
struct Context {
|
||||
struct RefRBTree : RefCounted<RefRBTree> {
|
||||
RedBlackTree<size_t, FunctionIndex> tree;
|
||||
};
|
||||
|
||||
COWVector<FunctionType> types;
|
||||
COWVector<FunctionType> functions;
|
||||
COWVector<TableType> tables;
|
||||
|
@ -27,7 +31,7 @@ struct Context {
|
|||
COWVector<bool> datas;
|
||||
COWVector<ValueType> locals;
|
||||
Optional<u32> data_count;
|
||||
AK::HashTable<FunctionIndex> references;
|
||||
RefPtr<RefRBTree> references { make_ref_counted<RefRBTree>() };
|
||||
size_t imported_function_count { 0 };
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue