mirror of
https://github.com/postgres/postgres.git
synced 2025-08-21 10:42:50 +03:00
Reduce the memory requirement for large ispell dictionaries.
This patch eliminates per-chunk palloc overhead for most small allocations needed in the representation of an ispell dictionary. This saves close to a factor of 2 on the current Czech ispell data. While it doesn't cover every last small allocation in the ispell code, we are at the point of diminishing returns, because about 95% of the allocations are covered already. Pavel Stehule, rather heavily revised by Tom
This commit is contained in:
@@ -161,6 +161,10 @@ typedef struct
|
||||
SPELL **Spell;
|
||||
int nspell; /* number of valid entries in Spell array */
|
||||
int mspell; /* allocated length of Spell array */
|
||||
|
||||
/* These are used to allocate "compact" data without palloc overhead */
|
||||
char *firstfree; /* first free address (always maxaligned) */
|
||||
size_t avail; /* free space remaining at firstfree */
|
||||
} IspellDict;
|
||||
|
||||
extern TSLexeme *NINormalizeWord(IspellDict *Conf, char *word);
|
||||
|
Reference in New Issue
Block a user