* perf: Reduce penalty for lack of redis connection
If redis isn't running than this client cache is slower than default
implementation because of the extra locking overhead.
* test: update perf redis counts
* perf: cache table columns in client-cache
* fix: race condition on cache-client_cache init
Rare but apparant in synthetic benchmarks.
Cache is set but client cache is still being initialized then request
will fail.
* perf: Don't run notifications when loading document
WHAT?
* fix: use cached doc to repopulate
* perf: reduce get_meta calls
Picking 1024 keys assuming 4kb avg size. In practice most things are
smaller so 1024 should be good enough!
This will likely only affect multitenant deploy with many sites.
This is middle ground between caching it completely and requiring a
restart/signal to reload vs always reloading it.
I don't know any use cases that can break from this, nowhere in code
configs should be expected to reload instantly.
This change is only applied to requests for now
This makes maxsize deterministic while estimating memory costs of
using this function.
E.g. If I want to cache site config and I'd prefer to keep 16 recent
site configs in memory, there's no way to handle this. Site specific
maxsize means if I have 1000 sites on bench I'll have 1000 keys in
cache.
This change makes behaviour similar to lru_cache which is how I thought
it workerd TBH.
RESP3 has PUSH support which is useful for implementing client side
caching. Enabling this before I work on that to test if anything breaks
with this.
No need to do this for background jobs instance just yet, infrequent
accesses and performance doesn't matter as much.
* upstream/develop: (1373 commits)
perf: cache dynamic links map in Redis (#28878)
fix: Never query `flag_print_sql` in `developer_mode=0` (#28884)
fix(restore): remove MariaDB view security definers
fix: sanitize user input during setup wizard
feat(sanitize_column): improve check
refactor: make optimizations.py private entirely (#28872)
fix(site_cache): site cache thread safety (#28870)
chore(printview): change error message
perf: speedup `frappe.call` by ~8x (#28866)
test: reduce noise in test output (#28862)
chore: spelling_invalid_values (#28858)
fix: Remove misleading os.O_NONBLOCK flag (#28859)
fix: string replacement in error logger
perf(gthread): Pin web workers to a single core (#28854)
fix: MariaDBDatabase.get_tables() should not query the entire database schema (#28846)
fix: add strings and fields to translation
fix: typo in test controller boilerplate
perf: faster add_to_date (#28843)
perf(version): Make get_versions fast for autoincrement doctypes (#28847)
refactor: log in monitor as well
...
Identified two cases where site cache can break:
1. Other thread clears cache using clear_cache because of TTL or manual
eviction.
2. Other thread pops the eliment we are about to read because of
`maxsize` limit.
This change should fix both and even make it lil bit faster.
* perf: resolve rounding method once
When rounding method is explcitly specified it's 1.4x faster.
* perf: reorder checks
Bankers rounding is default and most common now
* perf: speedup get_system_settings
* fix: fallback for always printing tracebacks
I don't recall ever hitting "no" to this prompt. It's of no use for me.
Also, this makes automated scripts not really automated.
* revert: prompting for exceptions
Always print full exception
* perf: Use latest pickle protocol
* perf: pop flags from cached documents
This is also the right thing to do, things like `doc.flags.for_update`
shouldn't be "cached".