Removed performance logging from loading creatures
This commit is contained in:
@@ -44,7 +44,7 @@ function getProperties(creatureId) {
|
||||
const props = Array.from(creature.properties.values());
|
||||
return props;
|
||||
}
|
||||
console.time(`fetching from db: ${creatureId}`)
|
||||
console.time(`Cache miss fetching from db: ${creatureId}`)
|
||||
const props = CreatureProperties.find({
|
||||
'ancestors.id': creatureId,
|
||||
'removed': {$ne: true},
|
||||
@@ -52,7 +52,7 @@ function getProperties(creatureId) {
|
||||
sort: { order: 1 },
|
||||
fields: { icon: 0 },
|
||||
}).fetch();
|
||||
console.timeEnd(`fetching from db: ${creatureId}`);
|
||||
console.timeEnd(`Cache miss fetching from db: ${creatureId}`);
|
||||
return props;
|
||||
}
|
||||
|
||||
|
||||
@@ -6,10 +6,8 @@ import writeErrors from './computation/writeComputation/writeErrors.js';
|
||||
|
||||
export default function computeCreature(creatureId){
|
||||
if (Meteor.isClient) return;
|
||||
console.time('Compute');
|
||||
const computation = buildCreatureComputation(creatureId);
|
||||
computeComputation(computation, creatureId);
|
||||
console.timeEnd('Compute');
|
||||
}
|
||||
|
||||
function computeComputation(computation, creatureId) {
|
||||
|
||||
@@ -9,11 +9,8 @@ export function loadCreature(creatureId, subscription) {
|
||||
if (loadedCreatures.has(creatureId)) {
|
||||
creature.subs.add(subscription);
|
||||
} else {
|
||||
console.time(`loading to memory ${creatureId}`);
|
||||
creature = new LoadedCreature(subscription, creatureId);
|
||||
loadedCreatures.set(creatureId, creature);
|
||||
console.timeEnd(`loading to memory ${creatureId}`);
|
||||
console.log('Creatures in memory: ', loadedCreatures.size);
|
||||
}
|
||||
subscription.onStop(() => {
|
||||
unloadCreature(creatureId, subscription);
|
||||
@@ -29,7 +26,6 @@ function unloadCreature(creatureId, subscription) {
|
||||
creature.stop();
|
||||
loadedCreatures.delete(creatureId);
|
||||
}
|
||||
console.log('Creatures in memory: ', loadedCreatures.size);
|
||||
}
|
||||
|
||||
class LoadedCreature {
|
||||
|
||||
Reference in New Issue
Block a user