diff options
| author | dam <dam@gudinoff> | 2023-08-19 02:44:17 +0100 |
|---|---|---|
| committer | dam <dam@gudinoff> | 2023-08-19 02:44:17 +0100 |
| commit | f8080876d29be1241a59ef96c3ddb00bef84b60a (patch) | |
| tree | 67a67138d218af85071154a212e37d525d221be3 /ttt.jai | |
| parent | 1c6b84fb34a0dd18020f153b2d6cbd5e4f741319 (diff) | |
| download | task-time-tracker-f8080876d29be1241a59ef96c3ddb00bef84b60a.tar.zst task-time-tracker-f8080876d29be1241a59ef96c3ddb00bef84b60a.zip | |
Performance analysis on loop unrolling.
Diffstat (limited to 'ttt.jai')
| -rw-r--r-- | ttt.jai | 77 |
1 files changed, 30 insertions, 47 deletions
@@ -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(); |
