refactor(ivy): double size of DI bloom filter (#22775)

PR Close #22775
This commit is contained in:
Kara Erickson
2018-03-14 13:29:48 -07:00
committed by Miško Hevery
parent e55bf8fa79
commit 4e6ac185e5
3 changed files with 86 additions and 31 deletions

View File

@ -35,9 +35,13 @@ export interface LInjector {
* array at this level unless it's probable the directive is in it.
*
* - bf0: Check directive IDs 0-31 (IDs are % 128)
* - bf1: Check directive IDs 33-63
* - bf1: Check directive IDs 32-63
* - bf2: Check directive IDs 64-95
* - bf3: Check directive IDs 96-127
* - bf4: Check directive IDs 128-159
* - bf5: Check directive IDs 160 - 191
* - bf6: Check directive IDs 192 - 223
* - bf7: Check directive IDs 224 - 255
*
* See: https://en.wikipedia.org/wiki/Bloom_filter for more about bloom filters.
*/
@ -45,9 +49,13 @@ export interface LInjector {
bf1: number;
bf2: number;
bf3: number;
bf4: number;
bf5: number;
bf6: number;
bf7: number;
/**
* cbf0 - cbf3 properties determine whether a directive is available through a
* cbf0 - cbf7 properties determine whether a directive is available through a
* parent injector. They refer to the merged values of parent bloom filters. This
* allows us to skip looking up the chain unless it's probable that directive exists
* up the chain.
@ -56,6 +64,11 @@ export interface LInjector {
cbf1: number;
cbf2: number;
cbf3: number;
cbf4: number;
cbf5: number;
cbf6: number;
cbf7: number;
injector: Injector|null;
/** Stores the TemplateRef so subsequent injections of the TemplateRef get the same instance. */