Search This Blog

Monday, February 12, 2007

Burn those virtual calories



"Please change MOV AX,0 to XOR AX,AX. You save bytes. Also, please use shift operators instead of divisions. You save on cycles"


Common speak during the days of DOS and protected mode coding – when C and ASM worked hand in hand.

Then came the ‘abstract high level programmers’ who never really cared about declaring an int where only a byte is needed, or use multiple structs where a union would suffice.
Then came the ‘Object Oriented’ programmers who never really cared for understanding how virtual functions really worked or how they affected performance and/or size and used it pretty much everywhere without blinking an eye.
Then came the visual programmers who would love to drag and drop ‘graphic objects’ that would increase productivity by 150% and reduce time to market by 300% ! Woo haa. It’s another matter that each ‘visual object’ generated 300-500 lines of gob.
Then there was XML & buddies – the whoopie-doo do it all markup language for representing anything.
And DHTML and Javascript to add funky effects and client side programming to increase ‘web interface coolness’.
Then came the idea of using the Internet for communications !
Then came SIP, a great text based protocol, which generates anything between 500-1000 bytes for each message that passes to and fro, with the capacity of ‘adding more as it goes along the network’
Then came ambitious vendors who stuffed ‘SIP’ with a gazillion features like X-Vendor-Header:my.state=park.activate or X-Vendor-Header: (actual JPEG thumbnail here!) which generated anything between 1000-8000 bytes per message !
Then came the world of AJAX with a gazillion websites blindly embedding large JS ‘libraries’ to provide fancy effects.
Then came the first level of convergence – chat & email together ! see this
Then came RIA – combining funky web stuff with cool VoIP stuff- all on the internet – IPTV, VoD, and all the fun things.
Then came an abundance of soft-phones like Skype. Eat up as much memory as you can give it. Infact, I even talked to another vendor in a similar business and he said "Who cares! add more memory!"

Whoopie-Do. Who cares about size, right ? Broadband Rocks. CPU power is king.

Then came the problem of deploying all of the above en-masse.

XML led to Binary-XML. It was felt that for many applications, the XML schema definition itself far exceeded the content it was carrying.
Then came JSON, the ‘fat-free’ alternative to XML
Then came SIGCOMP, a mechanism to ZIP SIP, so to speak, so that it could be used effectively for mobile networks.
Also came the call by the SIP authors to stop using it as a protocol to carry anything under the sun.
Then came the call by AJAXers to have browsers ‘do more stuff’ so they don’t have to pass large libraries around with each page.
Then came reports for first IPTV deployment. Performance mostly sucks.
Then people started complaining about soft-phones eating up every inch of their precious memory and network bandwidth. (Gee, so people really care for memory, it seems)
Then a few months ago, I was taking to a friend who plans to revolutionize the IP-video market by doing things no one is concentrating on today.
“How?” I asked naively.
“We are writing optimized device drivers in assembly and C to ensure that we get the most out of CPU performance, reducing our client size by half to ensure better processing time, (amongst other things)”.

“But.. But.. Broadband! Visual Programming ! I sputtered in rage”

The network speed and CPU power are no excuse for optimization. Burn those virtual calories.

1 comment:

  1. Valery Hronusov aka Valery35April 22, 2007 at 3:01 PM

    Programmer not write "begin". He write "asm"...

    ReplyDelete