4,901 karma · joined Sep 13, 2020 (6y ago) · 1,641 submissions
comment 3y ago · link · parent
comment 3y ago · link · parent
comment 3y ago · link · parent
The presented transformation of code away from “clean” code had nothing to do with optimisation. In fact, it made the code more readable IMO. Then it demonstrated that most of those “clean” code commandments are detrimental to performance. So obviously when people saw the word “performance”, they immediately jumped “omg, you’re optimising, stop immediately!”
Another irritating reaction here is the straw man of optimising every last instruction: the course so far has been about demonstrating how much performance there even is on the table with reasonable code, to build up an intuition about what orders of magnitude are even possible. Casey repeated several times that what level of performance is right for your situation will depend on you and your situation. But you should be aware of what’s possible, about the multipliers you get from all those decisions.
And of course people bring up profilers: no profiler will tell you whether a function is optimal or not — only what portion of runtime is spent where. And if all your life you’ve been programming in Python, then your intuition about performance often is on the level of “well I guess in C it could be 5-10 times faster; I’ll focus on something else”, which always comes up in response to complaints about Python. Not even close.
comment 3y ago · link · parent
Sublime Merge is pretty laggy, but in a different way, that's more acceptable to me: it is asynchronous, so when I order Sublime Merge to perform an action on the git repo, I can still interact with the GUI, browsing the list of commits etc.
With Emacs and Magit the problem is that everything you do in Magit blocks the whole Emacs until Magit completes its work. Running magit-status means I can't type anothing in any Emacs buffer, issue Emacs commands, scroll, read through any Emacs buffer etc. for 28 seconds.
Even though GUIs often do more than CLI tools, they actually have more potential to be faster than CLI tools, because they can be asynchronous, whereas CLIs are completely blocking, running in a one-command-at-a-time mode. One example where GUIs are more efficient than CLIs are debuggers. Which demonstrates it can be done.
I see two main issues with Magit when it comes to performance:
1. It's blocking, not asynchronous.
2. It's written in ELisp, which is a fractal of bad decisions performance-wise.
> Is it still 5 times as laggy, once the initial magit-status is calculated?
It is.
comment 3y ago · link · parent
> You probably do not want to check out everything at once.
I do, if I want to compile the project, browse its history and push commits, which is what I'm paid for.
comment 3y ago · link · parent
comment 3y ago · link · parent
1. Clone <https://chromium.googlesource.com/chromium/src>.
2. Navigate to this directory in Emacs dired.
3. Run magit-status.
4. Observe how long it takes for Emacs to become responsive again. For me it's 28 seconds, while running git status in the terminal takes 6 seconds.
comment 3y ago · link · parent
“Janky” is an understatement. Recently I’ve rediscovered that in JavaScript comparing two arrays with == and === returns false, unless they’re the same object. At the same time there is no built-in function to correctly compare arrays for equality. This is a C-level foot gun. Not the only one I might add.
comment 3y ago · link · parent
Jails: Confining the omnipotent root (2000): <https://people.freebsd.org/~bapt/pdfdocs/papers/jail.pdf>
Solaris Zones: Operating System Support for Consolidating Commercial Workloads (2004): <https://www.usenix.org/legacy/event/lisa04/tech/full_papers/...>
Originally, jails didn't virtualise the network stack. That was added later, in FreeBSD 8.0 with VNETs, which were buggy for a long time, but went through extensive testing and are enabled by default since FreeBSD 12.0 (quite recently). Solaris Zones went a step further than the original design, and run a separate network stack for each zone from the start, years before FreeBSD did.
BTW, recommended talk about those topics:
Papers We Love: Jails and Zones: <https://www.youtube.com/watch?v=hgN8pCMLI2U>