@EuropeanTribalism · Post #1862 · 05.11.2025 г., 18:12
Gauntlet from the parade armor of Henry III of France, made around 1560. #artifacts @EuropeanTribalism
Hashtags
TGINSIGHT SIMILAR POSTS
Изворен канал @pythonotes · Post #32 · 7 фев.
Скорее всего уже слышали, что складывать строки через + это плохая практика. Падение производительности, и всё такое. Без лишних слов, давайте измерять: from timeit import timeit def t1(): # складываем 10 строк через + из переменной t = 'text' for _ in range(1000): s = t + t + t + t + t + t + t + t + t def t2(): # склеиваем список строк через метод join arr = ['text'] * 10 for _ in range(1000): s = ''.join(arr) def t3(): # складываем через + но не из переменной а непосредственно инлайн объекты for _ in range(1000): s = 'text' + 'text' + 'text' + ... # всего 10 раз Теперь каждую строку склейки запустим по 10М раз >>> timeit(t1, number=10000) 0.21951690399964718 >>> timeit(t2, number=10000) 1.4978306379998685 >>> timeit(t3, number=10000) 0.2213820789993406 Хм, а нам говорили что через "+" это плохо и медленно ))) 😁 Тут стоит учитывать, что речь идёт о склейке множества длинных строк. Давайте изменим условия: def t4(): t = 'text'*100 for _ in range(1000): s = t + t + t + t + t + t + t + t + t def t5(): arr = ['text'*100] * 10 for _ in range(1000): s = ''.join(arr) def t6(): for _ in range(1000): s = 'text'*100 + 'text'*100 + ... # всего 10 раз >>> timeit(t4, number=10000) 12.795130728000004 >>> timeit(t5, number=10000) 2.642637542999182 >>> timeit(t6, number=10000) 0.2184546610005782 Вот, уже другой разговор, сразу видна разница, в среднем в 6 раз. Но погодите, почему последний тест t6() по скорости такой же как и t3()? Ведь строки теперь в 100 раз длиннее! Это вопросы оптимизации кода, какие простые изменения ускоряют или замедляют выполнение программы. Мы столкнулись с примером обхода обращения к переменной. Например, именно так работает директива #define в С++, во время компиляции подставляя значение переменной вместо ссылки на неё. В Python это тоже работает, но часто ли вы сможете встретить такой способ работы со строками? К сожалению, способ почти только теоретический. В целом, тесты показали то, что мы хотели. Делаем выводы самостоятельно. Полный листинг 🌍 #tricks
Пребарај: #artifacts
@EuropeanTribalism · Post #1862 · 05.11.2025 г., 18:12
Gauntlet from the parade armor of Henry III of France, made around 1560. #artifacts @EuropeanTribalism
Hashtags
@EuropeanTribalism · Post #1837 · 20.05.2025 г., 15:18
On the Schöningen Double-Pointed Sticks In Schöningen, Germany, archaeologists found double-pointed sticks, crafted 200,000 years ago by early Europeans, likely Neanderthals. These slender wooden tools, possibly throwing sticks, showcase precise craftsmanship. Sharpened at both ends, they reflect sophisticated woodwork and hunting skill. Their balanced design suggests aerodynamic mastery for small prey. Preserved in sediment, these artifacts highlight Europe’s ancient ingenuity. #artifacts @EuropeanTribalism
Hashtags
@EuropeanTribalism · Post #1592 · 30.04.2023 г., 16:14
Scythian Gold Goryt Overlay (4th century BC). It was found in Chertomlyk Barrow near Nikopol, Dnieper Area, Russia. #artifacts @EuropeanTribalism
Hashtags
@EuropeanTribalism · Post #1583 · 25.04.2023 г., 17:34
Altar dedicated to the divine twins Mars and Venus. Marble, Roman artwork of the end of the reign of Trajan (98-117 AD), later re-used under the Hadrianic era (117-132 AD) as a base for a statue of Silvan. From the portico of the Piazzale dei Corporazioni in Ostia Antica. Shown in museum of Palazzo Massimo alle Terme, Rome, Italy #artifacts @EuropeanTribalism
Hashtags
@EuropeanTribalism · Post #1582 · 25.04.2023 г., 05:33
A 5th Century BC; Scythian gold ritual vessel with relief images of griffins, lions, horses and deer, from the Bratolyubivka Burial Mound, Kherson Region, Ukraine. #artifacts @EuropeanTribalism
Hashtags
@EuropeanTribalism · Post #1567 · 02.04.2023 г., 07:51
Figure of Swastika on a Corinthian Silver Coin (550–500 BC) National Archaeological Museum, Athens #artifacts @EuropeanTribalism
Hashtags
@EuropeanTribalism · Post #1551 · 09.03.2023 г., 07:47
On swastikas (18) In 2020 scientists discovered a trove in Denmark, which contained around one kilogram of gold artifacts. Among these items there was a disc depicting the Norse god Odin. The interesting thing is, that this disc can be dated to the 5th century A.D., and is thus the oldest trace of Odin worship which was ever found. The runic inscription on the disc reads "He is Odin's man". Interestingly the swastika is clearly depicted next to Odins head in the center of the disc. #artifacts @EuropeanTribalism
Hashtags
@EuropeanTribalism · Post #1521 · 03.02.2023 г., 13:39
Parade armor and tack made for King Erik XIV. of Sweden, around 1562 A.D. #artifacts @EuropeanTribalism
Hashtags
@EuropeanTribalism · Post #1517 · 30.01.2023 г., 10:37
Mycenaean daggers, dating back to roughly 1600 B.C. #artifacts @EuropeanTribalism
Hashtags
@EuropeanTribalism · Post #1512 · 23.01.2023 г., 17:27
Venus of Laussel, c. 23-25,000 years old, found in Marquay, Dordogne, France. Low relief on limestone block, height 18⅛ " Museum of Aquitaine, Bordeaux, France. #artifacts @EuropeanTribalism
Hashtags
@EuropeanTribalism · Post #1502 · 10.01.2023 г., 07:53
The back of an ancient Greek mirror (2nd-1st Century BC) depicting the Goddess Aphrodite preparing to hit Eros with a sandal as punishment for breaking a vase. #artifacts @EuropeanTribalism
Hashtags
@EuropeanTribalism · Post #1450 · 03.11.2022 г., 16:10
These Roman drinking cups were found in Denmark and date back to the 2nd to 3rd century B.C. #artifacts @EuropeanTribalism
Hashtags