mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-20 22:42:53 -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) {
|
constructor(type, obj) {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
this.data = {};
|
|
||||||
this.config = {
|
this.config = {
|
||||||
type: type,
|
type: type,
|
||||||
reserved: false
|
reserved: false
|
||||||
};
|
};
|
||||||
|
|
||||||
Object.assign(this.data, obj);
|
this.data = obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue