|
|
|
|
|
by naikrovek
1524 days ago
|
|
I cannot endorse this enough. some of it is hard and will have you wondering if you want to continue. if you do, and I highly recommend that every developer complete this course, you will find yourself thinking in new ways and understanding many problems very differently, which is a very good thing. and you will see huge performance problems in almost all software from them on, because none of this (I gesture vaguely at everything everywhere) should be as slow as it is. none of it. |
|
>and you will see huge performance problems in almost all software from them on, because none of this (I gesture vaguely at everything everywhere) should be as slow as it is. none of it.
Hah! Yes! After finishing, the first optimization I made was to add an "inc" command to the high-level (Java-like) language you implement. It annoyed me that any time you have "i = i + 1", it translates into VM code of "push 1 onto stack, push i's value onto stack, add, pop stack to i's location", each of which translates into several machine instructions. Especially given that the CPU has an increment instruction!
So I added the inc keyword that would ensure you bypass all of that, if you just want to increment a variable, and thus use significantly fewer cycles. It was really thrilling (well, as much as a technical project can be) to have the level of insight and control needed to make a change like that.