How many instructions to print Hello World (#100DaysToOffload Day7)
So this was supposed to go up yesterday but i passed out so here it is late.
About a week ago i saw a post talking about the (over)complexity of technology that keeps getting more and more complex in some ways seemingly to justify it's own complexity. In the process the fact that it took over 600k instructions to print the word “test” on a terminal window was pointed out. Since this was from 4 years ago i wondered how much that had changed since.
So here is the answer on my system.
First a little system info:
➤ cat /proc/cpuinfo | grep "model name"
model name : AMD Ryzen 5 2600X Six-Core Processor
➤ uname -a
Linux thebeach 5.6.8-artix1-1 #1 SMP PREEMPT Wed, 29 Apr 2020 18:45:03 +0000 x86_64 GNU/Linux
Now the test
➤ sudo perf stat echo "Hello World"
Hello World
Performance counter stats for 'echo Hello World':
0.54 msec task-clock # 0.478 CPUs utilized
0 context-switches # 0.000 K/sec
0 cpu-migrations # 0.000 K/sec
62 page-faults # 0.115 M/sec
2,157,767 cycles # 3.999 GHz
275,729 stalled-cycles-frontend # 12.78% frontend cycles idle
169,688 stalled-cycles-backend # 7.86% backend cycles idle
877,604 instructions # 0.41 insn per cycle
# 0.31 stalled cycles per insn
187,115 branches # 346.745 M/sec
<not counted> branch-misses (0.00%)
0.001129028 seconds time elapsed
0.000000000 seconds user
0.001178000 seconds sys
So there you have it 877,604 instructions to echo “Hello World”. I wont pretend to understand computer at that low level but that's an increase of 200k in 4 years to print a simple string. Part of this increase probably relates to mitigations for things like Spectre and Meltdown and some other “optimizations” over the years.
Well that is all for today.
Until tomorrow stay safe!
@mgrondin@youdabomb.social
#Tech #Random
Until next time. Stay safe!
G
@mgrondin@youdabomb.social
Today's post will be another quick one. Did some Spring Cleaning today. Was feeling a little down so i decided to cut my hair and clean out my PC.
This kept me distracted long enough to take me out of the down i was in say YAY!! for that.
To see the before and after of what i did have a look here:
https://pixelfed.social/p/mgrondin/161248275503124480
Feel free to follow me on Pixelfed. I don't post often but that might change soon.
This week is feeling really long and i just want it to be Saturday.
That's pretty much all for today.
Until tomorrow be safe!
@mgrondin@youdabomb.social
Until next time. Stay safe!
G
@mgrondin@youdabomb.social
So today's post will be a bit of a repeat of something i posted on pleroma earlier today.
Up until now i have been using Apache as a webserver. Over the years it has served me(and my pages) well. I've known about Nginx and that it was another option for a while. But since it was a late comer Apache was what i started with and kept with it as most guides where talking Apache at the time.
Recently (like the last few years) that has changed at a fast pace but i have not. Now i'm thinking it's time i do. Or at least seriously consider it. I read a few comparisons today and all placed Nginx ahead of Apache in terms of speed and scalability. Mind you what i run/host right now is mostly single user/little traffic but who knows what the future holds. Also most of the Apache configs i use now where either found online after many searches or are very bastardized conversions of Nginx configs that the project provides.
So now the task of learning how Nginx is configured so i can understand what i'm looking at and best practices when crafting configs. Also the task of deciding when i'm making the switch.
I'm thinking maybe that will happen this weekend since i have regular scheduled maintenance anyways. If not then maybe mid may or with the june maintenance we shall see how much i can learn between now and Saturday. And if i feel up to it in general. I just want to be comfortable with the layout of config files and make sure i understand how to include them and where they live.
I'll update here when i do it. I'll probably make a post out of the transition.
Anyways that is all for today.
Until tomorrow be safe.
@mgrondin@youdabomb.social
#Tech #WebServer #Apache #Nginx
Until next time. Stay safe!
G
@mgrondin@youdabomb.social
Oh Mondays how i loathe thee (#100DaysToOffload Day4)
So today started out messy. In true Monday fashion.
The company i work for brought back some of the employees that got layoffs. Which is great in general but how did i find out about it? When i started getting emails and call about this person and that person not being able to connect to the systems. Of course they can't connect because i disabled their accounts when they got layoffs...
So the morning was spent scrambling to get everyone's access restored and working from their new desktops (To maintain social distancing) so that was fun.
I wont turn all these into journal type ranting posts i swear but today's just had to be. I mean overall a good day trying to stay positive. In a way i suppose that's the point of doing this. Getting things out and not letting them bottle up right?
Anyways that's all for today.
Until tomorrow stay safe
@mgrondin@youdabomb.social
#Mondays
Until next time. Stay safe!
G
@mgrondin@youdabomb.social
What?!? Emoji's in the terminal you say? (#100DaysToOffload Day 3)
So up until the other day it had never occurred to me that Emoji in a terminal window could be a thing. But after installing/setting up #Tootstream i was surprised by what i saw.
There you have it emoji in a terminal window. This might not be a surprise to some of you but to me this seemed like something that could not be. So i needed to come up with a way to insert my own emoji's in my posts. Sure i could memorize the short codes from my instance but who's got time for that.
So my first venture was to find a website where i could copy and past emoji's into my terminal window. That started with this site. https://getemoji.com/ where i could find, copy and paste any emoji just like this 😀 😁 💩 😺 😸 . That was fine and dandy but it meant i had to have a browser window open and also an extra tab added to my collection of already too many. So i started looking for a different solution.
Enter Emoj
Emoj is a small little app that runs right in your terminal
That's right just type in a word and emoj will show you some emoji's that go with that word. Then you can select them with the left/right arrows and press the enter key to copy it to you clipboard. Or you can highlight with your mouse and copy/paste like any other text.
😺 😸 😹
And just like that i now have a quick way to insert emoji's into all my console based applications. I should note that this must be supported by your terminal emulator. I use mate-terminal. I think most recent emulators should support this. But for example xterm does not
That's all for today's post
Until tomorrow stay safe
@mgrondin@youdabomb.social
#Emoji #Terminal #Tech
Until next time. Stay safe!
G
@mgrondin@youdabomb.social
Space Pictures from your Birthday (#100DaysToOffload Day2)
In today's post i will share a site i found from another site i follow. They posted the other day about a website nasa has put up that will show you what picture was taken by the Hubble Space Telescope on your birthday. I thought it was pretty cool so I'm sharing it here.
I will also just mention that these daily posts will not always come at the same time of the day since some days are busier than others.
That's all for today's post
@mgrondin@youdabomb.social
#Tech
Until next time. Stay safe!
G
@mgrondin@youdabomb.social
So the main write freely account (@write_as@writing.exchange) boosted a post on mastodon and i decided to join in.
So for the next 100 days i will find something to post about. I'll also try to come up with better titles as time goes on but for today that's all you get.
I suppose just the above counts as a post but lets try to do something a little more.
I will share 2 things that i have been up to during this pandemic.
First i decided to try and write a short story as a way to put my typewriter to use. So far it's going ok. I only have 3 pages(written twice) but i have an idea where to go with it. Just need to figure out how to get there. Once it's done i'll post it here for sure.
Second i took up learning C++ as i stated in another post and that's been slow going as you can see if you look at the repo where i'm documenting the progress. I plan on sticking to it but i gotta stop just laying around during my off time.
I also recently made the switch to a different DE. I'm giving Qtile a shot. It's a tiling Window manager all in Python. So far i'm loving it. Next post might be about my current setup with it. I'm sure i will never quite use it to it's full potential but time will tell.
Anyways i suppose that's all for this post. Until tomorrow be safe and take care.
G
@mgrondin@youdabomb.social
#Tech
Until next time. Stay safe!
G
@mgrondin@youdabomb.social
COVID-19 Update 1 Apr 06 2020
I'm thinking of doing these once a week from now on. Both as a way to document the progress and to share how things are in my part of the world. I debated if i should post these public or not. If you would rather not see these let me know and i'll post them just for me.
I'll be honest that i'm not keeping a very close eye on things as to not get overwhelmed by the grand scale that this has become but i do keep up with it from day to day.
So as of today:
- Gas prices are at an all time low of 0.70CAD/liter 1.88US/Gallon
- Social distancing is being recommended but not really enforced. This is starting to change and be more enforced. It's also mostly left to individual provinces to enforce.
- Seems many people don't get how bad this really is. Still going out to get BBQ's,pools and other non-necessities
- 15,000 cases in Canada
- 101 in my province
- Schools have been closed for 3 weeks and will remain closed for the rest of the school year.
- Only Grocery Stores, Pharmacies, Most gas stations, Most hardware stores, (probably other places i'm forgeting deemed to provide necessities) remain open
- All Restaurants are take-out(Drive-through) or delivery only.
Lets see where things stand next week. Let me know if i should include other stats in my posts.
@mgrondin@youdabomb.social
#Covid19
Until next time. Stay safe!
G
@mgrondin@youdabomb.social
PenPals and Writefreely update
Today's post will be a quick one. Firstly i have decided to find one(or multiple) penpal(s). To the end i have joined Global PenFriends. I hope to be able to make some new friends and put my recently acquired type writer to use. So far i have already sent 1 letter. If anyone is interested in communicating with me via good 'ole fashion snail mail please reach out to me on pleroma @mgrondin@youdabomb.social or mastodon @mgrondin@social.linux.pizza and we can start from there.
Second thing is that i have updated my blog to the latest RC for writefreely. It brings some interesting changes. One of which is that because i have mentioned myself above if you reply to this post on mastodon(or anywhere in the fediverse) i should also see the reply. So it's almost like comments. I'm excited for that since it was one thing i felt was missing from here.
Anyways that's all for now
G
#Penpals #Meta #Tech
Until next time. Stay safe!
G
@mgrondin@youdabomb.social
Learning C++
I have decided to embark on a journey to learn C++. It's something i've wanted to do for a while and in fact started doing a few years ago but then things got crazy at work and time was not something i had so it got left behind.
Lately i've once again gotten the urge to learn this language. I'm not a programmer by any means. I've dabbled with python in the past and have used it for a few things but always just by learning specific things as i needed them. My want for learning C++ is purely that a want not a need. The choice of C++ is not based on any real reason other than it's popular. I might end up moving to Python if C++ proves too challenging. I'm assuming Python is easier to learn here but that might prove wrong as well.
Anyways for now i will be using the tutorials found here to start my journey. I will also do my best to document the journey here. Both for me to have quick reference to look back on without having to re-read chapters and for anyone who wants to follow my progress.
I don't have any specific need to learn to program (like i wont make it my career) but i do have some random ideas that i might turn into actual things if this pans out.
Anyways that's all for now. Feel free to follow along at the git repo above. I will also blog about any bigger milestones in my journey.
G
#tech #c++ #programing
Until next time. Stay safe!
G
@mgrondin@youdabomb.social