<commit_before>var Window          = require('pex-sys/Window');
var PerspCamera     = require('pex-cam/PerspCamera');
var Arcball         = require('pex-cam/Arcball');
var createCube      = require('primitive-cube');
var glslify         = require('glslify-promise');
var isBrowser       = require('is-browser');
var Cubes           = require('./scenes/cubes');
var GUI             = require('pex-gui');

Window.create({
    settings: {
        width:  1280,
        height: 720,
        fullScreen: isBrowser ? true : true
    },
    resources: {
    },
    init: function() {
        var ctx = this.getContext();
        var width = this.getWidth();
        var height = this.getHeight();
        this.initScenes(ctx, width, height);
        this.startScene(0);
        this.initGUI(ctx);
    },
    initGUI: function(ctx) {
        this.gui = new GUI(ctx, this.getWidth(), this.getHeight());
        this.fpsLabel = this.gui.addLabel('FPS:');

        this.gui.addHeader('Scenes');
        this.sceneLabels = this.scenes.map(function(scene) {
            return this.gui.addLabel(scene.name);
        }.bind(this))
    },
    initScenes: function(ctx, width, height) {
        this.currentScene = -1;
        this.scenes = [];
        this.scenes.push(new Cubes(width, height, 50));
        this.scenes.push(new Cubes(width, height, 500));
        this.scenes.push(new Cubes(width, height, 1000));
        this.scenes.push(new Cubes(width, height, 2500));
        this.scenes.push(new Cubes(width, height, 5000));
        this.scenes.push(new Cubes(width, height, 10000));
    },
    stopScene: function() {
        if (this.currentScene != -1) {
            var ctx = this.getContext();

            this.scenes[this.currentScene].dispose(ctx);
            this.currentScene = -1;
        }
    },
    startScene: function(idx) {
        this.stopScene();

        var ctx = this.getContext();

        this.currentScene = idx;
        this.sceneStartTime = this.getTime().getElapsedSeconds() * 1000;
        this.sceneRAFs = 0;
        this.sceneRects = 0;
        this.scenes[this.currentScene].init(ctx);

        console.time('run');
    },
    draw: function() {
        var ctx = this.getContext();<commit_msg>benchmark added 20k cubes test<commit_after>var Window          = require('pex-sys/Window');
var PerspCamera     = require('pex-cam/PerspCamera');
var Arcball         = require('pex-cam/Arcball');
var createCube      = require('primitive-cube');
var glslify         = require('glslify-promise');
var isBrowser       = require('is-browser');
var Cubes           = require('./scenes/cubes');
var GUI             = require('pex-gui');

Window.create({
    settings: {
        width:  1280,
        height: 720,
        fullScreen: isBrowser ? true : true
    },
    resources: {
    },
    init: function() {
        var ctx = this.getContext();
        var width = this.getWidth();
        var height = this.getHeight();
        this.initScenes(ctx, width, height);
        this.startScene(0);
        this.initGUI(ctx);
    },
    initGUI: function(ctx) {
        this.gui = new GUI(ctx, this.getWidth(), this.getHeight());
        this.fpsLabel = this.gui.addLabel('FPS:');

        this.gui.addHeader('Scenes');
        this.sceneLabels = this.scenes.map(function(scene) {
            return this.gui.addLabel(scene.name);
        }.bind(this))
    },
    initScenes: function(ctx, width, height) {
        this.currentScene = -1;
        this.scenes = [];
        this.scenes.push(new Cubes(width, height, 50));
        this.scenes.push(new Cubes(width, height, 500));
        this.scenes.push(new Cubes(width, height, 1000));
        this.scenes.push(new Cubes(width, height, 2500));
        this.scenes.push(new Cubes(width, height, 5000));
        this.scenes.push(new Cubes(width, height, 10000));
        this.scenes.push(new Cubes(width, height, 20000));
    },
    stopScene: function() {
        if (this.currentScene != -1) {
            var ctx = this.getContext();

            this.scenes[this.currentScene].dispose(ctx);
            this.currentScene = -1;
        }
    },
    startScene: function(idx) {
        this.stopScene();

        var ctx = this.getContext();

        this.currentScene = idx;
        this.sceneStartTime = this.getTime().getElapsedSeconds() * 1000;
        this.sceneRAFs = 0;
        this.sceneRects = 0;
        this.scenes[this.currentScene].init(ctx);

        console.time('run');
    },
    draw: function() {
        var ctx = this.getContext();
{'fraction_non_alphanumeric': 0.14864864864864866, 'fraction_numerical': 0.018830305715551617, 'mean_word_length': 2.236559139784946, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4179813', 'n_tokens_mistral': 1478, 'n_tokens_neox': 1384, 'n_words': 267}