aboutsummaryrefslogtreecommitdiff
path: root/ttt.jai
diff options
context:
space:
mode:
Diffstat (limited to 'ttt.jai')
-rw-r--r--ttt.jai77
1 files changed, 30 insertions, 47 deletions
diff --git a/ttt.jai b/ttt.jai
index 22a0f42..15b5a66 100644
--- a/ttt.jai
+++ b/ttt.jai
@@ -481,26 +481,26 @@ update_total_times :: (db: *Database) {
// LLVM 14.5 5.0
// X64 132.4 124.4
//
- totals: []s64 = db.total_times;
- for db.tasks {
- times : []s64 = it.times;
- totals[0] = add(totals[0], times[0]);
- totals[1] = add(totals[1], times[1]);
- totals[2] = add(totals[2], times[2]);
- totals[3] = add(totals[3], times[3]);
- totals[4] = add(totals[4], times[4]);
- totals[5] = add(totals[5], times[5]);
- totals[6] = add(totals[6], times[6]);
- }
+ // totals: []s64 = db.total_times;
+ // for db.tasks {
+ // times : []s64 = it.times;
+ // totals[0] = add(totals[0], times[0]);
+ // totals[1] = add(totals[1], times[1]);
+ // totals[2] = add(totals[2], times[2]);
+ // totals[3] = add(totals[3], times[3]);
+ // totals[4] = add(totals[4], times[4]);
+ // totals[5] = add(totals[5], times[5]);
+ // totals[6] = add(totals[6], times[6]);
+ // }
// I5-2550K R3550H (ns/entry)
// LLVM 11.2 11.7
- // X64 119.9 124.5
+ // X64 118.2 124.5
//
- for db.tasks {
- for *total: db.total_times {
- <<total = add(<<total, it.times[it_index]);
+ for task: db.tasks {
+ for *total, index: db.total_times {
+ <<total = add(<<total, task.times[index]);
}
}
@@ -509,54 +509,37 @@ update_total_times :: (db: *Database) {
// LLVM 11.5 12.1
// X64 126.6 132.8
//
- for db.tasks {
- times : []s64 = it.times;
- for *total: db.total_times {
- <<total = add(<<total, times[it_index]);
- }
- }
+ // for db.tasks {
+ // times : []s64 = it.times;
+ // for *total: db.total_times {
+ // <<total = add(<<total, times[it_index]);
+ // }
+ // }
// I5-2550K R3550H (ns/entry)
// LLVM 11.6 11.2
// X64 132.3 133.8
//
- for db.tasks {
- times : []s64 = it.times;
- for 0..db.total_times.count-1 {
- db.total_times[it] = add(db.total_times[it], times[it]);
- }
- }
+ // for db.tasks {
+ // times : []s64 = it.times;
+ // for 0..db.total_times.count-1 {
+ // db.total_times[it] = add(db.total_times[it], times[it]);
+ // }
+ // }
// I5-2550K R3550H (ns/entry)
// LLVM 11.8 10.2
// X64 134.4 132.5
//
- totals: []s64 = db.total_times;
- for db.tasks {
- times : []s64 = it.times;
- for 0..totals.count-1 {
- totals[it] = add(totals[it], times[it]);
- }
- }
-
-
- // unroll_week :: (code: string) -> string {
- // builder: String_Builder;
- // defer reset(*builder);
- // for 0..6 {
- // print_to_builder(*builder, code, it);
- // }
- // return builder_to_string(*builder);
- // }
-//
// totals: []s64 = db.total_times;
// for db.tasks {
// times : []s64 = it.times;
- // #insert #run unroll_week("totals[%1] = add(totals[%1], times[%1]);");
+ // for 0..totals.count-1 {
+ // totals[it] = add(totals[it], times[it]);
+ // }
// }
-
stop := current_time_monotonic();