W3C home > Mailing lists > Public > www-style@w3.org > February 2011

[css-variables] Hidden costs.

From: Andrew Fedoniouk <andrew.fedoniouk@live.com>
Date: Tue, 15 Feb 2011 20:25:39 -0800
Message-ID: <BLU159-ds114E15C40590BAC5B6EF5FF8D20@phx.gbl>
To: <www-style@w3.org>
Let's consider any simple CSS property.

For example 'text-align' that is an enumeration of 6 values (in CSS 2.1).
Therefore theoretical minimal storage for the 'text-align' is 3 bits.

CSS Variables if accepted will require any CSS property to occupy at least
33 bits on 32-bit system and at least 64 bits on 64-bit CPU. No matter will
they be used or not *all* Internet users will start paying the price next 
they will be introduced/implemented.

I understand that for some existing sub-optimal (in regard to memory 
UA implementations all above is probably not the case already but even for
them CSS Variables will cost some additional CPU cycles on each computation
of property value.  But not all UA/platforms have a luxury of unlimited 

I am not saying that we should stop adding any new features to CSS.
Just a reminder that we should think about hidden costs, etc.

The problem is that no one of Web designers actually asked about exactly CSS 
(run-time interpretable entities). Except of authors of this bright idea - 
Daniel Glazman et al.
of course. But there are a lot of requests for CSS Constants (parse time 
macro variables).
Just note various existing CSS macro/preprocessors and absence of anything
even close to CSS variables (they can be modeled in principle by JS means).

I think that 33bit versus 3bit is a bit high price for the spherical horse 
a vacuum[1], no?

Just for the record: CSS Constants do not introduce any new requirements
to memory storage and have zero cost in runtime and implementation is very
simple and unobtrusive.


Andrew Fedoniouk.

Received on Wednesday, 16 February 2011 04:26:34 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:07:56 UTC