<commit_before>var transform3d = require('transform3d'),
    transform = require('./transform')

module.exports = function applyTransforms(){
  var properties = [
      'rotate',
      'rotateX',
      'rotateY',
      'rotateZ',
      'perspective',
      'skew',
      'skewX',
      'skewY',
      'translateX',
      'translateY',
      'translateZ',
      'scale',
      'scaleX',
      'scaleY',
      'scaleZ'],
    transformation = new transform3d,
    i,
    max,
    property;

  for(i = 0, max = properties.length; i < max; i++){
    property = properties[i]
    if(this.hasAttribute(property))
      transformation[property](this.getAttribute(property) -0);
  }

  transform(this, transformation.compose());
}<commit_msg>reuse the single instance of transform3d<commit_after>var transform3d = require('transform3d'),
    transform = require('./transform'),
    operations = require('transform3d/lib/operations');

module.exports = function applyTransforms(){
  var properties = [
      'rotate',
      'rotateX',
      'rotateY',
      'rotateZ',
      'perspective',
      'skew',
      'skewX',
      'skewY',
      'translateX',
      'translateY',
      'translateZ',
      'scale',
      'scaleX',
      'scaleY',
      'scaleZ'],
    transformation,
    i,
    max,
    property;

  if(!this._transform3d){
     this._transform3d = new transform3d;
     this._identity = this._transform3d.compose();
  }
  transformation = this._transform3d;
  transformation.operations = [new operations.Matrix(this._identity)]
  for(i = 0, max = properties.length; i < max; i++){
    property = properties[i]
    if(this.hasAttribute(property))
      transformation[property](this.getAttribute(property) -0);
  }

  transform(this, transformation.compose());
}
{'fraction_non_alphanumeric': 0.14690867838910948, 'fraction_numerical': 0.009075439591605219, 'mean_word_length': 2.8940397350993377, 'pattern_counts': {'":': 0, '<': 5, '<?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': '4479116', 'n_tokens_mistral': 541, 'n_tokens_neox': 547, 'n_words': 106}