Optimizing Mundlejs: Cacheing the dependency parse

Posted at 22:37 on 1 Jul 2012 by meelash

Tags: Projects Mundlejs optimization cacheing benchmarks


Following , I took my first step at optimization. Previously, the contents of every javascript file requested were parsed for dependencies. This occurred on every request from a different client. As of this commit, the direct dependencies of each file are cached, so the next time that file is requested, it is not necessary to parse the file again. This is a precursor to being able to pre-parse all files prior to beginning to serve files, which will be one of the features of the "deploy mode." Because we don't have cluster support built in yet, in the benchmarks below all parses are done 8 times (or however many cores are on the testing machine), since the cache is not shared between worker processes yet.


We're still not on the same order of magnitude as Apache and Connect, but there was a significant improvement. The little dip at one data point is probably just an artifact of something else that was happening on my machine at the same time. I don't think I'll be exploring it further, preferring to spend my time on the next step in optomization.


No comments.