mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-06 22:40:14 -05:00
Optimized Resources constructor
- this code has shown to be chronically slow, due to the `Object.assign` - we don't really need this, as we can just use a normal assign in this case - this cuts 15% CPU from boot time for sites with a lot of resources (posts)
This commit is contained in:
parent
90fbbe135f
commit
b376585c64
1 changed files with 1 additions and 2 deletions
|
@ -13,13 +13,12 @@ class Resource extends EventEmitter {
|
|||
constructor(type, obj) {
|
||||
super();
|
||||
|
||||
this.data = {};
|
||||
this.config = {
|
||||
type: type,
|
||||
reserved: false
|
||||
};
|
||||
|
||||
Object.assign(this.data, obj);
|
||||
this.data = obj;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue