Heureka - Blog
The small success stories are the ones that count.
Stable Diffusion is a AI image generator that runs on your own machine.
For Windows there are plenty of easily executable builds but we want to run it on Linux.
My attention was caught with this video and then I tried to figure out how to run it on Linux.
As far as I understand, it only works with pretty strong NVIDIA cards. I have a GeForce 3080 Ti with 12GB VRAM and can generate images of 256x512 Pixels in size within a few seconds but not much bigger.
I was concatenating translation file contents to one string and observed rather long runtimes.
Turns out Python is not very efficient in this regard. So I reworked it to use a list.
import time start = time.time() str1 = "" for i in range(1,10000000): str1 += "A"*1000 print("Concat took: " + str(time.time() - start)) start = time.time() str1 = "" str2 =  for i in range(1,10000000): str2.append("B"*1000) print("List collection took: " + str(time.time() - start)) start = time.time() str1 = "\n".join(str2) print("Final join took: " + str(time.time() - start))
Concat took: 4.820241689682007 List collection took: 0.9731082916259766 Final join took: 2.7453043460845947