stack-performance
Version:
A comprehensive application stack analyzer that evaluates MEAN, MERN, and other Node.js-based applications across 15 performance criteria
32 lines (26 loc) • 1.02 kB
JavaScript
const BaseAnalyzer = require('./BaseAnalyzer');
class MemoryCpuEfficiencyAnalyzer extends BaseAnalyzer {
constructor(stackInfo, projectPath) {
super(stackInfo, projectPath, 'M E M O R Y C P U E F F I C I E N C Y');
}
async analyze() {
const baseScore = this.performBaseAnalysis();
const details = { stackType: this.stackInfo.type, analysisMethod: 'algorithmic' };
return this.createResult(baseScore, details, this.generateRecommendations(baseScore));
}
performBaseAnalysis() {
const { type, technologies } = this.stackInfo;
let score = 65;
if (type.includes('MEAN') || type.includes('MERN')) score += 15;
if (technologies.includes('Node.js')) score += 10;
return Math.min(100, score);
}
generateRecommendations(score) {
const recommendations = [];
if (score < 70) {
recommendations.push('Consider optimizations for better m e m o r y c p u e f f i c i e n c y');
}
return recommendations;
}
}
module.exports = MemoryCpuEfficiencyAnalyzer;