Interesting Memory Optimization

James Miller james at aatch.net
Mon Mar 19 18:20:59 PDT 2012


On 20 March 2012 13:17, H. S. Teoh <hsteoh at quickfur.ath.cx> wrote:
>> Sites should be blazingly fast with today's computing power, but a
>> ridiculous focus on "Developer productivity" has meant that no change
>> has happened.
>
> Exactly! In spite of the fact that CPU speed has increased on the order
> of a millionfold since the old days, and in spite of the fact that
> memory capacity has increased by several orders of magnitude, today's
> software is STILL taking forever and two days just to load, and we STILL
> run out of memory and thrash to swap on almost exactly the same tasks
> that we did 10 years ago.
>
> Where has all the performance boost drained into? Into bloated code with
> over-complex designs that suck resources like a sponge due to lack of
> concern with resource usage, that's what.

And whats more, developer productivity is not a function of the tools
they use, its a function of how they use them. Sure, some tools make
you more productive than others, but I swear by (g)vim for everything
and it hasn't let me down. I use the command line, ssh where I need to
go, all tasks that should make me "less productive" but I'm good at
what i do, so there's no difference. I still spend my time in PHP
dealing with platform differences between my local environment and the
server environment, I still have to write checks for things that are
local-only and things that are server-only. Difference is that these
checks exist in production code, compiled code can cut them out.
Ideally, 99% of web-apps out there would be CGI/FastCGI processes
running behind light webservers like nginx. They would be compiled,
native code (maybe byte-code like .NET or Java if you need something
special that needs it) and run at the speed of fucking light. But they
aren't. You have servers running a virtual machine, running a
framework, running a web app that isn't optimized because "hey, RAM is
cheap". You have scripting languages running applications that have
the scope of massive enterprise software, and they aren't designed for
it.

I hate working with PHP, not because the language sucks (though it
does) but because I know that every time someone loads a page, a ton
of redundant work is done, work that could be done once, on startup,
then never done again. Silverstripe has to scan the directory tree to
build a manifest file to get decent performance out of what they do.
But they still have to check that the files exist every time the file
loads. They still have to read the file and parse it. It makes me feel
ill thinking about it.

Anyway, I should probably stop ranting about this.

--
James Miller


More information about the Digitalmars-d mailing list