core: improve performance through negative command caching
commitcdfa4637afe510fad7140d03b154bf30b16f8f9c
authorSteve Bennett <steveb@workware.net.au>
Fri, 5 Jun 2020 10:41:41 +0000 (5 20:41 +1000)
committerSteve Bennett <steveb@workware.net.au>
Fri, 5 Jun 2020 11:48:01 +0000 (5 21:48 +1000)
treee0d3c57e587d74ef9703b529809ddbfae5729f86
parent5d44077dc5e785c490707f57a420fb92ff99015f
core: improve performance through negative command caching

Instead of incrementing the proc epoch on every command removal
and some command creation, cache previous deleted commands
(empty structure only). Periodically increment the proc epoch
and invalide all cached commands.

This is especially a win when creating short lived commands.
e.g.

proc a {} {
local proc b {} {
# do something
}
# now b is removed
}

Signed-off-by: Steve Bennett <steveb@workware.net.au>
jim.c
jim.h