Peppy 0.1 beta release!
Today, I am releasing Peppy 0.1 beta! Download it here.
Peppy is a lightning fast CSS 3 compliant selector engine with no external library dependencies. Peppy can be used along side other libraries seamlessly.
As it stands now Peppy is faster1 than all other major JavaScript libraries with DOM querying capabilities (Prototype 1.6.0.3, JQuery 1.2.6, MooTools 1.2.1, EXT 2.2, DoJo 1.2.0, YUI 2.6.0). It is faster2 than Sizzle by John Resig and it also is cross browser (IE included). Take a look for yourselves, I have a profiling page set up here.
At 10k it is an ideal replacement for other excellent but bulkier libraries (whose feature sets span beyond DOM querying) when features additional to DOM querying are not needed in your web application. If you are designing your own JavaScript library or want to replace your existing libraries selector engine then Peppy is an ideal candidate.
Comments, both positive and negative, are most welcomed and desired. I want to improve this thing! Please take a look here.
Thanks.
1 (MajorLibraries - excluding Sizzle) : 4x faster in FF3, 6x faster in FF2,
8x faster in IE7, 3x faster in IE6, 3x faster in Opera 9, 4x faster in Safari 3
2 (results compared to Sizzle): 1.2x faster in FF3, 1.3x faster in FF2,
11.1x faster in IE7, 4.5x faster in IE6, 1x faster in Opera 9, 4x faster in Safari 3
Note : I have noticed that sometimes these results vary using Slickspeed, these result were all obtained running several times in each browser taking the avg for all runs. Also, tests were only run in windows Vista and XP.
Browsers used for testing: FireFox 3.0.3, FireFox 2.0.0.17, IE 7.0.6, IE 6.0.29, Opera 9.5.2, Safari 3.1.2
74 Comments
RSS feed for comments on this post.
Sorry, the comment form is closed at this time.
[...] Donaghue has released Peppy, the first release of his CSS 3 compliant selector engine that runs independent of one particular [...]
Big fan of CSS selectors in prototype although knowing its not the best performer in the world - looking forward to giving this a test - keep it light and solid on your way to release 1.0
Cheers!
Impressive.
Its around 3.5k minified & gzipped.
I’m not quite sur i understand, i just plug this baby in and it will replace my selector engine from jquery? Is there a doc somewhere?
Fantastic work
I noticed you enabled caching for IE, AFAIK there is no DOM event triggered to clear that cache (that IE supports).
[...] Peppy! New CSS3 Selector Engine [...]
[...] Donaghue has released Peppy, the first release of his CSS 3 compliant selector engine that runs independent of one particular [...]
> Comments, both positive and negative, are most
> welcomed and desired. I want to improve this thing!
How _can_ you improve it? On Windows using Chrome, I got a score of 37ms (that’s across 40 tests!). Nearest competitor was Prototype 1.6.0.3 with a time of 112ms.
Great work.
Holy shit… Thats really fast.
Great work, keep it up.
I propose to test yet DomAssistant.
Have you done any testing related to caching and ajaxy DOM updates? (see John Resig’s comments here: http://ajaxian.com/archives/peppy-css3-selector-engine)
Great job, dudes.
Peppy also does his job in IE 5.5 (Found everything, Final time: 156 ms vs. Ext 2.2: 526 ms)
really great!
So, is it released under MIT license? I am interested in becoming part of the team to contribute into peppy as a open source contributor. Do email me to let me know if there is any way that I can contribute to it.
Do you have a license? MIT or compatible would be nice if I were to integrate it into Chiron (modulesjs.com), my module system project.
James “Peppy” selectors…
I have just finished reading through peppy.js , a “lightning fast CSS 3 compliant selector engine with no external library dependencies”. Created by James Donaghue.
What i, really, like about this, is that other people competes with the nin…
What is the license of Peppy?
Nice work james, do you have some usage examples?
Also, what license will Peppy be under?
[...] 사이트에서 PEPPY라는 CSS3 SELECTOR ENGINE 라이브러리가 나왔다는 글을 보았습니다. Peppy: New CSS 3 [...]
Very impressive!!! Loved it
but you can alway mention selector engine it in a single line 
it is only missing documentation
[...] Donaghue has released Peppy, the first release of his CSS 3 compliant selector engine that runs independent of one particular [...]
[...] Так что на данный момент остается только, с замиранием дыхания, ждать. Пост о первом бета-релизе peppy [...]
Just did my own profiling and I’m impressed! Also, Sizzle is at least 55% faster in Opera, but it throws 4 exceptions in IE so I say Peppy wins, hands down. At this point some documentation or a guide would be nice.
[...] Demo | More info…. [...]
A short user guide would be nice to have!
There are tests without caching:
http://lusever.ru/css-selectors/?Sizzle_21-10-08/Peppy_0-1
Not so promising. Keep moving
[...] Donaghue has released Peppy, the first release of his CSS 3 compliant selector engine that runs independent of one particular [...]
Hi! Cool, nice effort. On my machine however ’sizzle’ came in first at 50ms, peppy at 54ms.
Not that it matters not much to me. Haven’t heard of sizzle before, but I’ve been so in to coding lately I haven’t even kept up with the news.
Oh, sorry, forgot: Ran it in FF 3.01 in Vista (compat-testing browsers, keeping me from dev’ing in ubuntu the last days, boohoo).
WOW! Speedy
Impressive work. Congratulations! But I’d be even more interested if I could use Peppy inside other libraries, like say, dojo, as the selector engine. Are you working in something like that?
[...] Donaghue has just released Peppy, a very fast CSS3 compliant JavaScript selector engine. The author claims that it is … [...]
Nice time,
When get peoples some dokumentation about library?
[...] Donaghue has just released Peppy, a very fast CSS3 compliant JavaScript selector engine. The author claims that it is … [...]
How do I use this with Prototype?
Do I just drop the file in after?
Have you changed the code from when you first posted it? Is it still 0.1?
Keep us posted as you improve it.
[...] lieblings Blogs, ajaxian.com, ein Beitrag über eine neue Selector Engine geschrieben worden. Peppy ist ihr name. Und sie sollte schneller sein als Sizzle von John [...]
Hi James! As im always eager to learn more, would you mind taking the time to make a richly commented version of the script? I asked that on my blog, i think you missed that.
Passing on some knowledge to the learning generation is a great thing.
Thanks.
I just added a new post. I hope that answers all of the questions that came up here in the comments. If not please let me know.
[...] so much work going in to selector engines right now (has been for a few years now, but the bar keeps on [...]
[...] James Donaghue » Peppy 0.1 beta release! Peppy is a lightning fast CSS 3 compliant selector engine with no external library dependencies. Peppy can be used along side other libraries seamlessly. (tags: jamesdonaghue.com 2008 mes9 dia27 CSS selectors CSS3 JavaScript) [...]
Sizzle was the fastest for me on your slicktest.
With the following html pattern:
[div class=test][div class=test2][/div][/div]
Times 200.
I get 200 results found in FF (goes ok in IE) on the following cssQuery pattern: div[class=test]
[...] - выборка элементов DOM по CSS3 селекторамJames Donaghue создал библиотеку Peppy для выборки элементов DOM, использую селекторы CSS3. [...]
[...] Peppy 0.1 beta release! A CSS3 compliant selector engine [...]
[...] arreglar esto James Donaghue ha publicado, en versión Beta, un motor para hacer estas selecciones que se caracteríza por dedicarse solamente a eso y hacerlo muy rápidamente y a través de un JS [...]
A port of Peppy is now the default selector engine for Chiron. It looks something like this:
include(’select.js’);
include(’browser.js’);
select(’#buffer’).forEach(setOpacity(.5));
You can try it out with the console:
http://modulesjs.com/nightly/build/run.html
Here’s the source and the object code, built every evening:
http://modulesjs.com/nightly/src/select.js
http://modulesjs.com/nightly/build/select.js
https://cixar.com/tracs/javascript/browser/trunk/src/select.js
This is great new Kris! Thanks very much for choosing Peppy.
Hi James,
Have you tested peppy with DomQuery (http://ajaxian.com/archives/domquery-a-lightweight-css-selector-basic-xpath-implementation) to find which one is quicker?
Nice work man and I am interested in comparing peppy with DomQuery as I’ve mentioned.
It would be nice if you post your views about this.
Thanks
JP
Can be made faster with using direct document.getElementById or document.getElementsByTagName in proper cases.
Also it doesn’t return sets of elements — only the first occurence.
Hi, it’s me again. I’ve created version (with CSS1 support only) that is 2-10 times faster. Main ideas are (dirty) implemented here:
http://webo.in/tests/yet-another-css-selector/
feel free to use any of them (pre-check of popular selectors, caching, fast cycles, fast replaces, limited calls, etc).
Note, that “0x faster in Opera 9” means “It doesn’t work in Opera”. The correct variant is “1x faster in Opera 9”, than means “It works with the same speed in Opera”.
@maggg: good catch - thanks
Огромное спасибо за потрясающие идеи!!! Буду следить за блогом, много всего интересного. А мой блог о науке, надеюсь, тоже понравится
напишу и у себя в блоге
òåìà î÷åíü àêòóàëüíà ñåé÷àñ, íå òàêë ëè?
óäèâèëî, ÷òî ïðî÷èòàë îá ýòîì èìåííî ñåé÷àñ
Add to my Bookmarks
кто хочет меняться ссылками, пишите
я люблю все ваши слова..
èíòåðåñíî)) ÿ êàê ðàç ïîñìîòðåë ñåé÷àñ 3+2, òàê íàñìåÿëñÿ)) âñåì ðåêîìåíäóþ âñïîìíèòü
÷òî æå òàì ñìåøíîãî?
sympathetic location! fount done!
Интересно! По-настоящему супер написано.
Take a look at http://yass.webo.in. It is the fastest JS CSS selector I’v seen
Любопытно написано, но как говорится, для точного представления нужно минимум три источника
У меня скоро в закладках место закончится, но я рад добавлять с вашего блога и далее ссылочки на интересные темы!
За статью благодарю, все по делу, достаточно много кто это применяет на практике
[...] Donaghue has just released Peppy, a very fast CSS3 compliant JavaScript selector engine. The author claims that it is … [...]
hello…
super!…
greatings…
thanks…
Thanks for all you ideas! I sure will be back to visit your site again so i can learn more.
Hi! A Great Post. I was just playing with blogs. i was really excited.
Keep on blogging!
Да, такой блог однозначно надо раскручивать как только можно - что б как можно больше читателей о нем узнали!