Nov
08
2008
15

Peppy, closures and patterns

Hi Folks,

I have been traveling so sorry it’s been a while since the last post.

JavaScript is a really cool language. One of my favorite aspects of JavaScript is closures. When designing a reusable piece of work, using closures is a great way to restrict pollution of the global scope.

You may have noticed that Peppy is wrapped in an anonymous function that executes immediately. Inside of this anonymous function I set only two global variables: “peppy” and “$” (”$” is only set if it doesn’t already exist). Everything else is wrapped up inside of a closure.

There are many useful patterns involving closures and one of them that you may have heard of is the Module pattern. If I were to write peppy using this pattern it would look something like this:

peppy = function() {
// private data
return { query: function…
}
}();

I chose not to use this pattern though because Peppy handles some follow up initialization stuff that needs to occur after the definition of Peppy and it just didn’t quite fit as cleanly within the module pattern.

Well that’s it for this post, I just wanted to write a quick one as I have been hard at work on putting together some documentation for Peppy as well as working on the next release.

Written by jdonaghue in: JavaScript, Peppy |
Oct
26
2008
26

Peppy 0.1.2 beta is now available

Today, I am releasing the latest maintenance version of Peppy - 0.1.2. This includes fixes for the 9 test failures in Safari as well as the 3 test failures in Opera. Peppy now passes 131 unit tests in all of these browsers (and fails none!). Also, included in this release is the disabling of caching in IE.

To download Peppy please go here.

I am already working on the next release of Peppy (will include even more performance optimization). This should be available within a few weeks.

Thanks.

Written by jdonaghue in: CSS3, JavaScript, Peppy, Selectors |
Oct
18
2008
74

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

Written by jdonaghue in: CSS3, JavaScript, Peppy, Selectors | Tags: , , ,
Oct
13
2008
1

First Post, CSS 3 Compliant Selector Engine…

I have decided to enter the blogging world with (this) my very first blog post.

I plan to write about topics in software that interest me. I have also been working on several projects and as they near their release points I will reveal them here.

Coming soon is a lightning fast CSS 3 Compliant Selector Engine that will be released under an Open Source license. It is currently in the final stages for its first beta release.

I plan to release it within a week or so, so please stop by again to check it out!

Written by jdonaghue in: CSS3, JavaScript, Selectors | Tags: , ,

Powered by WordPress | Aeros Theme | TheBuckmaker.com WordPress Themes