Cache metadata globally

Description

While it will always be the case that QB or queryExecute will be faster than Quick (or any ORM), there seems to be some low hanging fruit remaining that would cut down on Wirebox instantiation time. We recently tested one scenario where this is likely true:

Since Quick metadata caching is done on a per-request basis, it seems prudent to try caching it in Wirebox (or an internal Cachebox), maybe after the module is loaded in a parallel thread. Since you've already got code to handle per-request metadata caching, this way we can have our cake and eat it:

1) Re-inspect metadata on fwreinit, but don't wait for it to finish before being 'done'
2) If a request comes in after Coldbox is ready but before Quick has cached metadata globally (or if the option to cache metadata is off), fall back to the per-request introspection
3) Otherwise, use the global cache and shave some milliseconds off of instantiating Quick components

Activity

Show:
Eric Peterson
February 28, 2020, 9:20 AM

In development now. Test suite time cut from 58463 ms to 44591 ms for a savings of about 14 seconds.

Fixed

Assignee

Unassigned

Reporter

Samuel W. Knowlton

Labels

None

Priority

Major
Configure