Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #29138

Re: apply classes to table rows after table is rendered, how

From Aleksandro <aleksandro@gmx.com>
Newsgroups comp.lang.javascript
Subject Re: apply classes to table rows after table is rendered, how
Date 2016-01-04 13:31 -0300
Organization A noiseless patient Spider
Message-ID <n6e6l2$rqc$1@dont-email.me> (permalink)
References (1 earlier) <CSS-20160102040520@ram.dialup.fu-berlin.de> <color-table-20160102042948@ram.dialup.fu-berlin.de> <animation-20160102180722@ram.dialup.fu-berlin.de> <j-20160102190250@ram.dialup.fu-berlin.de> <closure-access-20160104170652@ram.dialup.fu-berlin.de>

Show all headers | View raw


On 04/01/16 13:08, Stefan Ram wrote:
> ram@zedat.fu-berlin.de (Stefan Ram) writes:
>> It possibly would be even better to define
>> »animate« to be a closure around »j«. Then
>> »j« would be totally private to »animate«.
>> (I don't know whether this will also make
>> accesses to »j« faster.)
> 
>   In the meantime, by pure coincidence, I read in a book that
>   today property accesses usually are faster than accesses to
>   enclosed variables. The same author also wrote that names of
>   »private« properties sometimes begin with an underscore.
> 

Not totally related but I wanted to mention...

I think that if the interpreter can predict what property will be
accessed permanently, so that the enclosed symbol's value will remain
unchanged for example, these accesses will be as fast.

For example:

	var name   = "length"
	var length = someArray[name]

if the interpreter predicts that name will never change in the runtime,
the following access will be as fast as simply saying someArray.length.

If between the brackets there is an expression thing can be different
though but I bet some interpreters can optimize even that.

Why I mention this: because I think that interpreters can optimize other
things the same way.

Back to comp.lang.javascript | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

apply classes to table rows after table is rendered, how Mike S <mscir@yahoo.com> - 2016-01-01 18:44 -0800
  Re: apply classes to table rows after table is rendered, how Joao Rodrigues <groups_jr-1@yahoo.com.br> - 2016-01-02 11:21 -0200
    Re: apply classes to table rows after table is rendered, how Mike S <mscir@yahoo.com> - 2016-01-02 18:30 -0800
  Re: apply classes to table rows after table is rendered, how Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-01-02 22:19 +0100
  Re: apply classes to table rows after table is rendered, how Mike S <mscir@yahoo.com> - 2016-01-02 18:29 -0800
  Re: apply classes to table rows after table is rendered, how Aleksandro <aleksandro@gmx.com> - 2016-01-04 13:31 -0300
  Re: apply classes to table rows after table is rendered, how Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-01-04 17:39 +0100

csiph-web