@MyGovHindi · Post #6790 · 27.05.2023 г., 05:31
#NewParliamentBuilding के राज्यसभा चैंबर में बैठने की क्षमता 250 से बढ़कर 384 हो गई है। #MyParliamentMyPride #NewParliamentBuilding
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
Пребарај: #newparliamentbuilding
@MyGovHindi · Post #6790 · 27.05.2023 г., 05:31
#NewParliamentBuilding के राज्यसभा चैंबर में बैठने की क्षमता 250 से बढ़कर 384 हो गई है। #MyParliamentMyPride #NewParliamentBuilding
@MyGovHindi · Post #6811 · 02.06.2023 г., 15:28
#FridaysAtMyGov लाइव है! देश की #NewParliamentBuilding की दीवारों को लुभावनी कलाकृति से सजाने वाले प्रसिद्ध कलाकार पुनीत कौशिक को सुनें। 🎨🏛️ अभी देखें: http://youtu.be/3dWisnk5PQU
@MyGovCoronaNewsdesk · Post #12776 · 27.05.2023 г., 12:24
The new Parliament building dazzles with its modern infrastructure and cutting-edge amenities. Setting the stage for efficient decision-making and collaboration #MyParliamentMyPride #NewParliamentBuilding #NewParliament
@MyGovCoronaNewsdesk · Post #12775 · 27.05.2023 г., 11:24
The new Parliament of India has made room for expanded and more comfortable seating arrangements. With larger spaces, lawmakers can now engage in debates and discussions with greater ease and accessibility. #MyParliamentMyPride #NewParliamentBuilding #NewParliament
@MyGovCoronaNewsdesk · Post #12774 · 27.05.2023 г., 10:23
🇮🇳 The new Parliament building of India stands tall as an embodiment of Aatmanirbhar Bharat! The remarkable use of indigenous resources and Aatmanirbhar production showcases our nation's self-reliance & craftsmanship #MyParliamentMyPride #NewParliamentBuilding #NewParliament
@MyGovCoronaNewsdesk · Post #12773 · 27.05.2023 г., 09:22
The new Parliament of India: an architectural marvel and an economic catalyst! It generated 23 lakh man-days of employment, empowering countless individuals. #MyParliamentMyPride #NewParliamentBuilding #NewParliament
@MyGovCoronaNewsdesk · Post #12772 · 27.05.2023 г., 08:22
Safety first! The new Parliament of India sets a benchmark in infrastructure safety. With state-of-the-art measures and cutting-edge technology, it prioritizes the well-being of our lawmakers and visitors. #MyParliamentMyPride #NewParliamentBuilding #NewParliament
@MyGovCoronaNewsdesk · Post #12771 · 27.05.2023 г., 07:21
Catch a glimpse of the Lotus-themed interiors in the Upper House of the new Parliament building! The lotus, a symbol of purity and enlightenment, perfectly captures the essence of our legislative process. #MyParliamentMyPride #NewParliamentBuilding #NewParliament
@MyGovCoronaNewsdesk · Post #12770 · 27.05.2023 г., 06:21
The seating capacity in the Lok Sabha of the new Parliament building has been increased from 550 to 888. #MyParliamentMyPride #NewParliamentBuilding #NewParliament
@MyGovCoronaNewsdesk · Post #12769 · 27.05.2023 г., 05:19
The seating capacity in the Rajya Sabha of the stunning new Parliament building has increased from 250 to a whopping 384 #MyParliamentMyPride #NewParliamentBuilding #NewParliament
@MyGovCoronaNewsdesk · Post #12768 · 27.05.2023 г., 05:19
🏛️ Brace yourselves for a majestic architectural marvel! The new Parliament building stands tall, blending tradition & modernity flawlessly. Get ready to witness history in the making! #MyParliamentMyPride #NewParliamentBuilding #NewParliament
@MyGovHindi · Post #6797 · 27.05.2023 г., 11:36
#NewParliamentBuilding अपने आधुनिक इंफ्रास्ट्रक्चर और अत्याधुनिक सुविधाओं के साथ सभी का मन मोह लेेती है। #MyParliamentMyPride #NewParliament