<commit_before>var computeMesh = require("../mesh.js")
var ndarray = require("ndarray")
var fill = require("ndarray-fill")
var voxel = require("voxel")

var ndseg = require("ndarray-segment")

var x = ndarray(new Int32Array(33*33*33), [33,33,33])

fill(x, function(i,j,k) {
  var a = i-16
  var b = i-16
  var c = i-16
  return (a*a + b*b + c*c) ? 1<<15 : 0
})

var r = computeMesh(x)

var start = Date.now()
for(var i=0; i<1000; ++i) {
  computeMesh(x)
  //voxel.meshers.greedy(x.data, x.shape)
}

console.log(Date.now() - start)<commit_msg>small speed up, not sure if worth it or not<commit_after>var computeMesh = require("../mesh.js")
var ndarray = require("ndarray")
var fill = require("ndarray-fill")
var voxel = require("voxel")

var ndseg = require("ndarray-segment")

var x = ndarray(new Int32Array(33*33*33), [33,33,33])

fill(x, function(i,j,k) {
  var a = i-16
  var b = i-16
  var c = i-16
  return (a*a + b*b + c*c) ? 1<<15 : 0
})

var r = computeMesh(x)

var start = Date.now()
for(var i=0; i<1000; ++i) {
  //computeMesh(x)
  voxel.meshers.greedy(x.data, x.shape)
}

console.log(Date.now() - start)
{'fraction_non_alphanumeric': 0.19299820466786355, 'fraction_numerical': 0.05206463195691203, 'mean_word_length': 3.933628318584071, 'pattern_counts': {'":': 0, '<': 9, '<?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': '1719584', 'n_tokens_mistral': 509, 'n_tokens_neox': 469, 'n_words': 112}