Browse files

even better speed doing 65536 inserts at a time

  • Loading branch information...
1 parent d0f8d24 commit 3ec4919293a01b5e88f35dc0fb772863468432d9 @grgrssll committed Jul 15, 2011
Showing with 3 additions and 3 deletions.
  1. +3 −3 allrgb.php
View
6 allrgb.php
@@ -350,22 +350,22 @@ private function generateColors(){
while($red < 256){
$green = 0;
$blue = 0;
+ $values = '';
while($green < 256){
$blue = 0;
- $values = '';
while($blue < 256){
$lum = $this->rgb2lum($red, $green, $blue);
- $values .= ($blue) ? ',' : '';
+ $values .= ($blue || $green) ? ',' : '';
$values .= "({$red}, {$green}, {$blue}, {$lum})";
$blue++;
$total++;
if($total > 1 && ($total % 1000000) == 0){
Log::msg("$total colors made.");
}
}
- $this->insert($values);
$green++;
}
+ $this->insert($values);
$red++;
}
# make index on lum column

0 comments on commit 3ec4919

Please sign in to comment.