mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-28 07:18:30 +00:00
Make sorted serialization faster
Redbean Lua and JSON serialization now goes faster because we're now inserting object entries into tree data structure rather than making an array and sorting it at the end. For example, when serializing an object with 10,000 entries this goes twice as fast. However it still goes slower than saying EncodeJson(x, {sorted=false}).
This commit is contained in:
parent
9de3d8f1e6
commit
84caee23ba
12 changed files with 122 additions and 224 deletions
|
@ -13,14 +13,14 @@ struct critbit0 {
|
|||
|
||||
bool critbit0_contains(struct critbit0 *, const char *) dontthrow nosideeffect
|
||||
paramsnonnull();
|
||||
bool critbit0_insert(struct critbit0 *, const char *) paramsnonnull();
|
||||
int critbit0_insert(struct critbit0 *, const char *) paramsnonnull();
|
||||
bool critbit0_delete(struct critbit0 *, const char *) dontthrow paramsnonnull();
|
||||
void critbit0_clear(struct critbit0 *) dontthrow paramsnonnull();
|
||||
char *critbit0_get(struct critbit0 *, const char *);
|
||||
intptr_t critbit0_allprefixed(struct critbit0 *, const char *,
|
||||
intptr_t (*)(const char *, void *), void *)
|
||||
paramsnonnull((1, 2, 3)) dontthrow;
|
||||
bool critbit0_emplace(struct critbit0 *, char *, size_t) paramsnonnull();
|
||||
int critbit0_emplace(struct critbit0 *, char *, size_t) paramsnonnull();
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue