В 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
*FRACTION OF SECONDS*
Woke up. I knew I was late. Coz that was my routine. And coz of a simple logic, why be excited to wake up early and go to a place you hate and do something that you hate!
I sighed when my mouth tasted coffee before colgate...Ahh! how I love normal days, It was a normal day. At least that's what I thought. Papa was there looking up from the newspaper at me with a sense of pity.
I sort of ignored that and walked out through the front door, but the next sight, a brand new beautiful ladybird and an even more beautiful rider, with short black hair waving in the wind, in a skirt that knew well not to cover her beautiful legs... Well I couldn't ignore that! Just a fraction of seconds and I had already captured her. Made her mine. Is this what they call...
Oops!! She looked at me. Damn it! She caught me staring at her! I looked away whistling. I looked again, did I see a smile?
I heard Mom shouting my name out aloud. I knew I had to rush. As I was rushing inside I heard a loud thud. I turned back and saw the beautiful ladybird lying on the road. It was only a fraction of second, yet my mind talked to me in infinite speed...Somethings...what did he say I don't remember anymore. I remember rushing back to the house.
One year I didn't talk to our new neighbour who was an year older than me.Days went by. Mom had started packing things up one evening I came back from school. Papa received his transfer letter.
Now whenever I see a cycle I think. What would've happened? Why hadn't I stopped my mind talking to me? Why hadn't I I rushed 'out'side than 'in'side? All in a fraction of second!
#JOHN PAUL BENOY
#Review
*FRACTION OF SECONDS*
Woke up. I knew I was late. Coz that was my routine. And coz of a simple logic, why be excited to wake up early and go to a place you hate and do something that you hate!
I sighed when my mouth tasted coffee before colgate...Ahh! how I love normal days, It was a normal day. At least that's what I thought. Papa was there looking up from the newspaper at me with a sense of pity.
I sort of ignored that and walked out through the front door, but the next sight, a brand new beautiful ladybird and an even more beautiful rider, with short black hair waving in the wind, in a skirt that knew well not to cover her beautiful legs... Well I couldn't ignore that! Just a fraction of seconds and I had already captured her. Made her mine. Is this what they call...
Oops!! She looked at me. Damn it! She caught me staring at her! I looked away whistling. I looked again, did I see a smile?
I heard Mom shouting my name out aloud. I knew I had to rush. As I was rushing inside I heard a loud thud. I turned back and saw the beautiful ladybird lying on the road. It was only a fraction of second, yet my mind talked to me in infinite speed...Somethings...what did he say I don't remember anymore. I remember rushing back to the house.
One year I didn't talk to our new neighbour who was an year older than me.Days went by. Mom had started packing things up one evening I came back from school. Papa received his transfer letter.
Now whenever I see a cycle I think. What would've happened? Why hadn't I stopped my mind talking to me? Why hadn't I I rushed 'out'side than 'in'side? All in a fraction of second!
#JOHN PAUL BENOY
#Review
#short story
Former US National Security Advisor John Bolton:
“Although you could potentially remove the ayatollah, that would leave the IRGC in place, and the government in Iran is the IRGC, while the ayatollahs act as a religious cover or an ideological cover for them.
I think Trump is just hoping that this show of American power will intimidate the ayatollahs. If I were still his adviser, I would be happy to tell him that it won’t work.
They won’t be intimidated. But Trump really thinks minute by minute; he doesn’t think strategically.”
#john#bolton#trump#ayatollah
📱American Оbserver - Stay up to date on all important events
🇺🇸
L-l恋l爱a刺c客k- 恋爱刺客 John Tucker Must Die (2006)
直达链接:https://pan.quark.cn/s/4ea1760bcdae
#恋爱刺客#John Tucker Must Die #约翰·塔克必死
链接:https://link3.cc/sf_com
#电影#喜剧#美国#00年代