Random Link : vanilla.js

62 views
Skip to first unread message

Andrew Chilton

unread,
Nov 25, 2012, 7:09:22 PM11/25/12
to node...@googlegroups.com
Hey everyone,

I know this is a Node.js list, but just had to share the following
link - browser stuff:

* http://vanilla-js.com/

Just look at the SPEEEEEEED. ;)

cheers,
Andy

--
contact: Andrew Chilton
website: http://www.chilts.org/blog/

Sean Soong

unread,
Nov 25, 2012, 7:27:09 PM11/25/12
to node...@googlegroups.com
Interesting:) But I don't understand: any js toolkit is just a thin layer over browser's native interface. How can vanilla js be so much faster than its counterparts?


--
You received this message because you are subscribed to the Google Groups "Node.js NZ" group.
To post to this group, send an email to node...@googlegroups.com.
To unsubscribe from this group, send email to nodejs-nz+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.





--
http://songjinshan.com/akabook/

Andrew Chilton

unread,
Nov 25, 2012, 7:29:59 PM11/25/12
to node...@googlegroups.com
Hi Sean,

On 26 November 2012 13:27, Sean Soong <songj...@gmail.com> wrote:
> Interesting:) But I don't understand: any js toolkit is just a thin layer
> over browser's native interface. How can vanilla js be so much faster than
> its counterparts?

Ah, not sure if the joke would translate if English isn't your native
language. :)

'vanilla' being equivalent to 'plain' here. The code being shown as
vanilla.js is just standard JS that can run in the browser (i.e.
native browser code with no library wrapping it up.)

:)

Sean Soong

unread,
Nov 25, 2012, 7:46:30 PM11/25/12
to node...@googlegroups.com
Oh I see. The whole web site is a joke!

I was wondering why the vanilla js code is like 'document.getElementById('test-table');' -- did they replace window.document with another object? How blunt am I!

Put aside the idea of being a joke, I don't think toolkits like jQuery can be so much slower than native interface:)




--
You received this message because you are subscribed to the Google Groups "Node.js NZ" group.
To post to this group, send an email to node...@googlegroups.com.
To unsubscribe from this group, send email to nodejs-nz+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Andrew Chilton

unread,
Nov 25, 2012, 7:49:31 PM11/25/12
to node...@googlegroups.com
Hi Sean,

On 26 November 2012 13:46, Sean Soong <songj...@gmail.com> wrote:
> I was wondering why the vanilla js code is like
> 'document.getElementById('test-table');' -- did they replace window.document
> with another object? How blunt am I!

Heh, no, they didn't. :)

> Put aside the idea of being a joke, I don't think toolkits like jQuery can
> be so much slower than native interface:)

It depends what jQuery does inside $(selector). If it's doing even
just one regex and then calling document.getElementByID() then it'll
be a huge amount slower than document.getElementByID() itself.

I keep meaning to try Zepto too. I'm tending towards small libraries
which do one thing and do it well. This is kinda the Node.js way and
I'm slowly moving that way for the browser too.

* http://zeptojs.com/

Cheers,

Nox

unread,
Nov 25, 2012, 7:49:25 PM11/25/12
to node...@googlegroups.com

Don't tell me you want back to the "good old times"...
Browser wars and different DOM methods ;-)

I like the gzipped version best :-D

Andrew Chilton

unread,
Nov 25, 2012, 7:54:16 PM11/25/12
to node...@googlegroups.com
On 26 November 2012 13:49, Nox <n...@oreigon.de> wrote:
> Don't tell me you want back to the "good old times"...
> Browser wars and different DOM methods ;-)

Yeah, the "good old times". However I think these things just make you
sit back and say to yourself "Why do I need 100Kb of JavaScript when
I'm using about 5Kb of it". It's just a reminder about how bloated
some libraries are these days.

On a different note, even jQuery knows this and will be breaking it
apart in v1.9 and v2.0. Once it's modularised a bit more then they're
going to start deprecating old functionality for old browsers and
making a more lean newer library which doesn't contain all the hacks
for the old IEs. Good times ahead!

> I like the gzipped version best :-D

Heh, I missed that one. :)

Alexey Petrushin

unread,
Nov 26, 2012, 4:23:33 AM11/26/12
to node...@googlegroups.com
He-he, I'm not sure that speed is so important (I meant speed of dom - related stuff), it may be important in some specific cases - old browsers or very complicated UI or HTML5 games.

But in most applications - modern browsers are so fast that it's very hard to slow it down, unless You did something very strange or intentionally write slow code.

So, vanilla js miss the point, DOM speed is so fast that almost nobody cares about it anymore :)

Andrew Chilton

unread,
Nov 26, 2012, 4:34:46 AM11/26/12
to node...@googlegroups.com
Hi Alexey,

On 26 November 2012 22:23, Alexey Petrushin <alexey.p...@gmail.com> wrote:
> So, vanilla js miss the point, DOM speed is so fast that almost nobody cares
> about it anymore :)

Ah, that was just my twist on it ... and yes, I should use more
exclamation marks. SPEEEEED!!111!!!1!! I should go back to the drawing
board with my humour. :(

You're right, for most problems speed isn't an issue. As I said
earlier I think it's just to remind us that large frameworks aren't
always the silver bullet and going back to basics isn't always a bad
thing.

Cheers,
Reply all
Reply to author
Forward
0 new messages