leetcode: Okay, how would you solve this complicated problem with a large problem space but it is really easy to check if a solution is valid.
me: monte carlo!
leetcode: no....no... this is a pissing contest to save electrons.
me: I have never worked on a code base that needed to save electrons (this way). Google, who does need to count each electron will never hire me.
Ways to save electrons on a line of business app:
- switch from the pure python library to the native library
- add an index to the db table
- slap a memoize decorator on the slow, deterministic thing that gets called over and over
- measure it. The perf loss is in internationalization, not the big O. Or it is reading the file system over and over. Or it is initializing a module that you're not using, over and over.♡ 0 ↻ 0