mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-27 06:48:31 +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
|
@ -1,18 +0,0 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_STDIO_STRLIST_H_
|
||||
#define COSMOPOLITAN_LIBC_STDIO_STRLIST_H_
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
struct StrList {
|
||||
int i, n;
|
||||
char **p;
|
||||
};
|
||||
|
||||
void FreeStrList(struct StrList *) hidden;
|
||||
int AppendStrList(struct StrList *) hidden;
|
||||
void SortStrList(struct StrList *) hidden;
|
||||
int JoinStrList(struct StrList *, char **, uint64_t) hidden;
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_STDIO_STRLIST_H_ */
|
Loading…
Add table
Add a link
Reference in a new issue