4 ms·
Reducing the size of anything: websites, apps, you name it: just think about it, pay attention to shrinking easily-shrunk things, and avoid including unnecessar
by chrismorgan 9y ago
Reducing the size of anything: websites, apps, you name it: just think about it, pay attention to shrinking easily-shrunk things, and avoid including unnecessary stuff.
Improving the performance of anything: much the same. (Caveats apply, of course. Sometimes using such-and-such a library can genuinely make things faster than hand-rolling an equivalent.)
Improving anything: actually think about things. Care about them.
(There are trade-offs with everything, of course. And time is often a major one. When you see something you want to do but don’t have time for it—“Alas for the wailing of the gulls!”)
- adrianN 9y ago"Actually think about it" is not a very actionable recommendation though. If I have a big application and I want to make it smaller, it'd be more helpful if you gave me tips how to find spots where I should focus my attention and some hints about how to avoid "unnecessary" stuff. Developers don't include things just because it looks nice in the makefile. Everything solved some problem when it was included.
- deleted 9y ago[deleted]
- dfinlay 9y agoMy advice is to follow these steps: 1. Wrote to disk the entire payload actually required/retrieved for the user to be both authenticated and invoke meaningful business logic. 2. Compress each component in a manner representative of the transfer medium. Save them in a separate directory tree as the uncompressed data. 2a. If you aren't using any compression in your payload, apologize to your users and start using it. Return to Step 1. 3. From here you can use standard filesystem tools to view payload composition by media type, compressibility, etc. 4. Identify the largest consumers of space in the payload and research how to reduce their size. 5. Implement reductions identified in research. These steps should really be all you need in most scenarios.
- deleted 9y ago[deleted]
- wingerlang 9y agoDownload a VISUAL file manager, seeing your project in chunks letting you focus on the big areas makes it easy to see where to start. Also see if there are any tools for your environment specifically made to find issues, unused assets and so on. This allowed me to easily remove 200+ unused images yesterday. All in all I removed and compressed 18mb of unused images and files and counting. If anyone is wondering, since it is related to iOS as well, I used Slender. Highly recommended but use with care, since it has false positives and false negatives. I double checked almost all files it found.
- stestagg 9y ago“ Developers don't include things just because it looks nice in the makefile” This is actually surprisingly common, much more so these days with cookie cutter repositories. There are large communities of developers who feel better with a large toolkit of functionality in a build environment, where a typical project may only benefit from a fraction of the included libraries My limited experience of iOS dev suggests this is less of a problem Here, but I’m sure still is a factor
- userbinator 9y agoThere are large communities of developers who feel better with a large toolkit of functionality in a build environment, where a typical project may only benefit from a fraction of the included libraries In my experience, these tend to be the same type of developers who tend to copy-paste code extensively and not really understand what they're doing. They may be really good at finding these "cookie cutter" solutions and following instructions, but when asked to actually explain, they're unable to. This is particularly problematic for debugging, when you ask one of these developers about the reason for the way something is written and he doesn't know beyond the fact that he saw and copied it from somewhere.
- catdog 9y agoCaring about bloat is a huge first step. I think developers very often include things because they look nice or more often simply because it's the easy way to go. It takes effort to shrink an image, looking for a smaller library instead of using just a tiny part of that huge go to thing, stripping unneeded code or simply thinking twice about the benefit of including something at all. Also they often don't feel the pain points like their users feel because they tend to develop and test on higher end devices with a fast, unmetered network connection. If you take a closer look and think about it you often easily spot some no brainers like simply applying compression or reduce the quality of media assets to something that actually makes sense.
- jonathanstrange 9y agoPro tip: Just Do The Right Thing(tm)! Helps with any situation in life!
- jstanley 9y agoMore important than thinking about it is profiling it. You won't know what to optimise if you don't know what needs optimising. Thinking hard is a necessary second step, of course.