Skip to content

some optimizations#8

Open
alex-knyaz wants to merge 3 commits into
tsoding:mainfrom
alex-knyaz:main
Open

some optimizations#8
alex-knyaz wants to merge 3 commits into
tsoding:mainfrom
alex-knyaz:main

Conversation

@alex-knyaz

Copy link
Copy Markdown

removed markout_sobel_patches, faster on my computer

@alex-knyaz

Copy link
Copy Markdown
Author

50% is in grad_to_dp, 50% in memmove

@alex-knyaz

Copy link
Copy Markdown
Author

Wanted to try fixed-point type and hit bug in clang. Wild!

@sirynka

sirynka commented Apr 13, 2024

Copy link
Copy Markdown
./run.sh 
[INFO] directory `./build/` already exists
[INFO] ./build/stb_image.o is up to date
[INFO] ./build/stb_image_write.o is up to date
[INFO] CMD: cc -Wall -Wextra -ggdb -O3 -o ./build/main main.c ./build/stb_image.o ./build/stb_image_write.o -lm
[INFO] CMD: ./build/main ./images/Broadway_tower_edit.jpg ./images/Broadway_tower_squashed.jpg
OK: generated ./images/Broadway_tower_squashed.jpg
[INFO] Resizing took 3.995774secs

[INFO] directory `./build/` already exists
[INFO] ./build/stb_image.o is up to date
[INFO] ./build/stb_image_write.o is up to date
[INFO] CMD: cc -Wall -Wextra -ggdb -O3 -fopenmp-simd -fopenmp -o ./build/main main.c ./build/stb_image.o ./build/stb_image_write.o -lm
[INFO] CMD: ./build/main ./images/Broadway_tower_edit.jpg ./images/Broadway_tower_squashed.jpg
OK: generated ./images/Broadway_tower_squashed.jpg
[INFO] Resizing took 0.673004secs

Alex image is different

83.25% faster but produces slightly different image.
Does not produce any visible artifacts)

img

Broadway_tower_squashed

@alex-knyaz

Copy link
Copy Markdown
Author

Ye. It is also non-deterministic. You can fix this by commenting out second '#pragma omp parallel for' (the one before dp recomputation loop).

@alex-knyaz

Copy link
Copy Markdown
Author

It is deterministic, but images, are not the same. Interesting. Investigating.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants