Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9cfe7a2

Browse files
committed
some small tweaks, no performance impact really
1 parent 201df83 commit 9cfe7a2

File tree

6 files changed

+4
-2
lines changed

6 files changed

+4
-2
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,3 +82,4 @@ add_executable(sphere_importance src/TheRestOfYourLife/sphere_importance.cc ${CO
8282
add_executable(sphere_plot src/TheRestOfYourLife/sphere_plot.cc ${COMMON_ALL})
8383

8484
include_directories(src/common)
85+
add_compile_options(-O3 -pthread -Wall -g)

benchmark.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ pre-optimization
22
1200w 10pp 6m23s
33

44
after multithreading + png lib
5-
1200w 10pp 1m36s
5+
1200w 10pp 1m36s
6+
1200w 100pp 20m48s

image.png

-1.49 MB
Loading

image_100pp.png

1.34 MB
Loading

image_10pp.png

1.68 MB
Loading

src/InOneWeekend/main.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ int main() {
125125
std::vector<std::future<void>> results;
126126
static std::atomic_int remaining(image_height);
127127
for (int j = image_height-1; j >= 0; --j) {
128-
results.push_back(pool.push([&pixels, image_width, j, image_height, samples_per_pixel, cam, world, max_depth](int id) {
128+
results.push_back(pool.push([&pixels, image_width, j, image_height, samples_per_pixel, &cam, &world, max_depth](int id) {
129129
for (int i = 0; i < image_width; ++i) {
130130
color pixel_color(0,0,0);
131131
for (int s = 0; s < samples_per_pixel; ++s) {

0 commit comments

Comments
 (0)