В Linux стандартными средствами можно использовать часть оперативной памяти как диск. Для этого требуется указать тип монтирования tmpfs в команде mount
mount -t tmpfs -o size=5G tmpfs /mnt/ram
Теперь путь /mnt/ram можно использовать как обычный каталог. Для чего это может быть нужно?
▫️ Скорость работы с таким каталогом выше чем многие SSD и тем более HDD.
▫️ Если у вас очень быстрый SSD на NVMe M.2 то такой способ особо не прибавит вам скорости, но поможет сохранить ресурс SSD когда требуется обрабатывать очень много мелких файлов и оперативка позволяет выделить нужный объем.
▫️ Оперативка это энергозависимая память, поэтому выключении питания все файлы безвозвратно теряются. Такой "non persistent" каталог гарантирует удаление временных файлов.
Я написал небольшой скрипт для условного теста и сравнения скорости копирования файлов между SSD и RAM.
Вот мои результаты:
Single File Size: 30.0Gb
ssd > ssd: 0:00:12.850 / 2.3Gb/s
sdd > ram: 0:00:06.453 / 4.6Gb/s
ram > ram: 0:00:06.995 / 4.3Gb/s
ram > sdd: 0:00:06.217 / 4.8Gb/s
Dir size: 32.7Gb, File count: 11127
ssd > ssd: 0:00:15.063 / 2.2Gb/s
sdd > ram: 0:00:08.486 / 3.9Gb/s
ram > ram: 0:00:08.032 / 4.1Gb/s
ram > sdd: 0:00:07.026 / 4.7Gb/s
Скрипт для теста ↗️
На моём железе прирост скорости ~2x. Плюс экономия ресурса SSD.
В Windows такой фишки по умолчанию нет, но обязательно найдутся аналогичные решения
#linux#triks
https://pypi.python.org/pypi/pytz?
#pytz brings the Olson tz database into Python. This library allows
accurate and cross platform #timezone calculations using Python 2.4
or higher. It also solves the issue of ambiguous times at the end
of daylight saving time, which you can read more about in the Python
Library Reference (`datetime.tzinfo`).
🌍 Some countries adjust their time zones by just a single minute. Venezuela, for example, once set its clocks to UTC−4:30, then shifted to UTC−4:00 for efficiency, creating rare minute-level changes. ✨
#timezone⚡#clocks⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
🌍 China uses a single official time zone—Beijing Time—across its vast territory, even though natural time differs by up to four hours from east to west within the country. ✨
#timezone⚡#china⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
🌍 Samoa and American Samoa are just 160 kilometers apart but are 24 hours apart on the calendar due to the International Date Line, making them neighbors living in different days. ✨
#timezone⚡#Pacific⚡#islands⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
🌍 The Chatham Islands, east of New Zealand, use a unique time zone: Chatham Standard Time is 45 minutes ahead of New Zealand, making it one of the few zones offset by less than a full hour. ✨
#timezone⚡#islands⚡#Pacific⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography🌍
🌍 Spain's Canary Islands, though just west of Africa, use the same time zone as mainland Spain. Their clocks are always one hour behind the rest of the country, bridging continents by time. ✨
#timezone⚡#islands⚡#clocks⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
🌍 Samoa’s 2011 time zone shift moved it west of the International Date Line, so travelers flying there from the U.S. now skip a day entirely, making for a calendar jump like nowhere else. ✨
#timezone⚡#dateline⚡#pacific⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography🌍
🌍 The South Pole uses Coordinated Universal Time (UTC) for convenience, even though all lines of longitude—and thus every time zone—meet at this single icy point on Earth. ✨
#timezone⚡#Antarctica⚡#poles⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography🌍
🌍 Chile’s unique Easter Island uses UTC–6 time zone, two hours behind mainland Chile. This rare split lets sunrise and sunset times align better with local daylight on the remote Pacific island. ✨
#timezone⚡#Pacific⚡#island⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
🌍 Central Australia uses a rare time zone offset of UTC+9:30. This half-hour difference was chosen to better match daylight with daily activities across vast, sparsely populated regions. ✨
#timezone⚡#Australia⚡#daylight⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
China uses one official time zone: China Standard Time (CST), 8 hours ahead of UTC, called Beijing Time. In Xinjiang, many Uyghurs use Xinjiang Time, 2 hours behind CST. China does not change clocks for Daylight Saving Time.
To see the current time check [here]
@googlefactss⏰🇨🇳
#China#TimeZone#CST#Xinjiang#BeijingTime#funfact