mirror of
https://github.com/kennethreitz-archive/gitx.git
synced 2026-06-05 23:40:18 +00:00
061eb7de48
This creates a new directory speed_test with different implementations that we can use to power the grapher. The current implementation is somewhat lacking in that we build up the graph completely at the end. If we can do it while traversing the tree, we can build and display it earlier. Similarly, if we can leave out the line calculation but just work with the columns, we save computation at load time, and can defer the lines to the drawing process. That will also clear up the problem of not being able to draw some lines.
33 lines
722 B
Objective-C
33 lines
722 B
Objective-C
#include <stdlib.h>
|
|
#include <stdio.h>
|
|
#include <xlocale.h>
|
|
#include <stdarg.h>
|
|
#include <unistd.h>
|
|
#include <string.h>
|
|
#include <Cocoa/Cocoa.h>
|
|
|
|
int main() {
|
|
srandomdev();
|
|
|
|
int i = 0; struct list* last;
|
|
int num = atoi("8000000");
|
|
|
|
int size = 1000;
|
|
int totColumns = 10000;
|
|
int currentColumn = 0;
|
|
|
|
NSMutableArray* array = [NSMutableArray arrayWithCapacity: 100*size];
|
|
|
|
for (i = 0; i < num; i++) {
|
|
int numColumns = i % 5;
|
|
|
|
NSMutableArray* arr = [NSMutableArray arrayWithCapacity: numColumns];
|
|
int j;
|
|
for (j = 0; j < numColumns; j++)
|
|
[arr addObject: @"Ha"];
|
|
[array addObject: arr];
|
|
}
|
|
|
|
[array release];
|
|
return 0;
|
|
} |