Add ColorSync performance test
diff --git a/util/Makefile b/util/Makefile
new file mode 100644
index 0000000..5adee94
--- /dev/null
+++ b/util/Makefile
@@ -0,0 +1,3 @@
+LDFLAGS= -Wl,-framework,ApplicationServices
+CFLAGS=-g
+all: colorsync-perf
diff --git a/util/colorsync-perf.c b/util/colorsync-perf.c
new file mode 100644
index 0000000..2878c0e
--- /dev/null
+++ b/util/colorsync-perf.c
@@ -0,0 +1,47 @@
+#include <ApplicationServices/ApplicationServices.h>
+#include <dlfcn.h>
+#include <stdio.h>
+
+#define BITMAP_INFO (kCGBitmapByteOrder32Big | kCGImageAlphaNoneSkipLast)
+
+
+int main() {
+	int width = 256;
+	int height = 256*256;
+
+	CGDataProviderRef input_file = CGDataProviderCreateWithFilename("input.icc");
+	CGDataProviderRef output_file = CGDataProviderCreateWithFilename("output.icc");
+	float range[] = {0, 1., 0, 1., 0, 1.};
+	CGColorSpaceRef output_profile = CGColorSpaceCreateICCBased(3, range, output_file, NULL);
+	CGColorSpaceRef input_profile = CGColorSpaceCreateICCBased(3, range, input_file, NULL);
+	CGColorSpaceRef cs = CGColorSpaceCreateDeviceRGB();
+
+	CGContextRef cin = CGBitmapContextCreate(NULL, width, height,
+			8, 4*width, input_profile, BITMAP_INFO);
+	CGContextRef cout = CGBitmapContextCreate(NULL, width, height,
+			8, 4*width, output_profile, BITMAP_INFO);
+
+	CGRect rect = {{0,0},{width, height}};
+	CGImageRef copy = CGBitmapContextCreateImage(cin);
+#define LENGTH 256*256*256
+	static unsigned char src[LENGTH*3];
+	static unsigned char qoutput[LENGTH*3];
+	static unsigned char loutput[LENGTH*3];
+	int i,j,k,l=0;
+	for (i=0; i<256; i++) {
+		for (j=0; j<256; j++) {
+			for (k=0; k<256; k++) {
+				src[l++] = i;
+				src[l++] = j;
+				src[l++] = k;
+			}
+		}
+	}
+
+	CGDataProviderRef dp = CGDataProviderCreateWithData(NULL, src, height * width * 3, NULL);
+	CGImageRef ref = CGImageCreate(width, height, 8, 24, width * 3, input_profile, BITMAP_INFO, dp, NULL, 1, kCGRenderingIntentDefault);
+	clock_t qcms_start = clock();
+	CGContextDrawImage(cout, rect, ref);
+	clock_t qcms_time = clock() - qcms_start;
+	printf("ColorSync: %ld\n", qcms_time);
+}