The Shared Buffer (Flyweight)
Minimizing memory usage by sharing common data strings via the hold space.
✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Flyweight
ARCANUM SCHOOL: Transmutation // Streamweaving
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// CODEX INCANTATION //
# Flyweight: Define a heavy string once
1 {
x
s/^$/<<<SUPER_HEAVY_COMMON_STRING_USED_EVERYWHERE>>>/
x
}
# Inject it when needed
/INJECT_FLYWEIGHT/ {
G
s/\n/ /
}
Runic Tags:
#sed
#structural
#flyweight