Caching
Code generation is an expensive procedure. To speed up things, we used a caching mechanism for all regular expressions that are being compiled at least once. There are three implemented caching policies so far:NullCache
All caching mechanisms are disabled. You can enable this caching mechanism using the following statement:RegexCachePlugins.getInstance().load("org.firej.cache.NullCache");
LastInstanceCache
The cache size is set to one and can hold only the last regular expression that was compiled by the FIRE/J engine. This caching policy is extremely useful when resources are limited. You can enable this module by the following statement:RegexCachePlugins.getInstance().load("org.firej.cache.LastInstanceCache");
MemoryCache
The cache size is unlimited. This module uses internally a HashMap which stores the compiled regular expressions. It is by default enabled in the FIRE/J library. You can enable it though through the following statement (remember to set it off if you doing benchmarks though):RegexCachePlugins.getInstance().load("org.firej.cache.MemoryCache");