Improve performance of node-haste2 and react-packager

Reviewed By: davidaurelio

Differential Revision: D2911210

fb-gh-sync-id: 8ac2f213e8a9e089281bb065f9a7190d2e0f5b18
shipit-source-id: 8ac2f213e8a9e089281bb065f9a7190d2e0f5b18
This commit is contained in:
Christoph Pojer
2016-02-15 22:33:11 -08:00
committed by facebook-github-bot-8
parent 9856a97267
commit 9a918ef48f
24 changed files with 331 additions and 346 deletions

View File

@@ -3,7 +3,7 @@
const AssetModule = require('./AssetModule');
const Package = require('./Package');
const Module = require('./Module');
const path = require('path');
const path = require('fast-path');
class ModuleCache {
@@ -26,7 +26,6 @@ class ModuleCache {
}
getModule(filePath) {
filePath = path.resolve(filePath);
if (!this._moduleCache[filePath]) {
this._moduleCache[filePath] = new Module({
file: filePath,
@@ -46,7 +45,6 @@ class ModuleCache {
}
getAssetModule(filePath) {
filePath = path.resolve(filePath);
if (!this._moduleCache[filePath]) {
this._moduleCache[filePath] = new AssetModule({
file: filePath,
@@ -59,7 +57,6 @@ class ModuleCache {
}
getPackage(filePath) {
filePath = path.resolve(filePath);
if (!this._packageCache[filePath]) {
this._packageCache[filePath] = new Package({
file: filePath,