Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Make dejavu usages faster
Latest commit a0fd3df @satazor satazor Update
Failed to load latest commit information.
bin Migrating optimizer to its own repository.
lib Merge pull request #5 from Congelli501/patch-2
tasks Update optimizer.grunt.js
.editorconfig Update .editorconfig
.gitignore Update ignore.
.jshintrc Update
LICENSE Migrating optimizer to its own repository. Update
index.js Migrating optimizer to its own repository.
package.json Bump version.

dejavu optimizer

The dejavu optimizer analyzes your code, making dejavu usages faster.
Benchmarks: jsperf

What it does?

  • Improves $super(), $self and $static usage
  • Removes the need for wrappers, improving performance by a great margin
  • Removes abstract functions from abstract classes
  • Removes functions from interfaces
  • Removes all $locked and $member() because they are not used in the loose version


Node script

There's a simple nodejs script located in the bin folder. If you are optimizing your code for nodejs then pass the --closure option. This will boost the performance when running code in v8. Please look at the jsperf results to see the difference in the different browsers.

Example usage:

node optimizer < file_in.js > file_out.js node optimizer --closure < file_in.js > file_out.closure.js


To use the optimizer programatically, please check bin/optimizer for an example.


dejavu comes with an automaton and grunt task.

Sample usage of automaton:

var dejavuOptimizer = require('dejavu/tasks/optimizer.autofile');

module.exports = function (task) {, {
        description: 'Optimize myfile',
        options: {
            closure: true, // defaults to false
            files: {
                'src/myfile.js': 'dst/myfile.opt.js'

Sample usage of grunt:


    dejavuopt: {
        sometarget: {
            closure: true, // defaults to false
            files: {
                'dst/myfile.opt.js': 'src/myfile.js'


Released under the MIT License.

Something went wrong with that request. Please try again.