Wednesday, April 9, 2008

Work on GQuery progresses, Comment on Slickspeed

GQuery is progressing nicely. I implemented all of CSS3 selectors by following ExtJS's DomQuery implementation, only I added the ability to parse at runtime as well as via a generator at compile time. The compile time generator turns a CSS selector into 100% inlined code. That is, a selector like "#foo", will turn into "return document.getElementById("foo");", no parsing step involved. I've still got a bunch of optimizations to make, add support for XPath and native getElementsByClassName, but even now working with the library in GWT is very cool. I just started looking at DomAssistant as well, to incorporate (i.e. steal) the best algorithms from each.

I've been using SlickSpeed to evaluate compliance of my implementation, as well as check performance, but I noticed an issue with SlickSpeed's benchmarking which is endemic to a lot of microbenchmarks: failure to account for timer resolution.

When you run SlickSpeed on some browsers/operating systems, alot of the results will be 0ms, 4ms, 8ms, or some other multiple, because the Javascript Date.getTime() function has a fixed update resolution on some system, for example, on some systems it seems to be around 16ms or roughly 1 screen update (60Hz = 1/60th second). SlickSpeed runs each selector 4 times, and then divides by 4, which is why you see results like 4ms, 8ms, and the like.

The problem is, there is always the issue of timer jitter and aliasing. For example, if you happen to sample the timer twice before the next update happens, you end up with a 0ms result, even if it took 15ms, whereas if you get unlucky and start the benchmark half way into an update interval, you may record a result rounded up to the next. I need to hack SlickSpeed anyway to allow it to bench GWT, and in the process I'm going to run each selector such that the time exceeds 500ms, plus toss out the min/max values to evaluate the effectiveness of caching on some of those APIs. This will disadvantage my compile time selectors, which avoid a parsing step, but be more fair to comparing the actual implementation of the selector routines. I might make a separate benchmark to time 'setup' speed that these libraries use for parsing the selector, since that is obviously a factor in many end user apps that don't neccessarily run the same query more than once.

-Ray

9 comments:

Ivan said...

You have an unfair advantage; since your selectors are compiled you can do any number of optimizations to them, and basically beat any other selector engine out there. :) I'm liking GWT more and more and I've only been reading about for a few days now...

Brad Neuberg said...

I tried to post this on timepedia but the contact form doesn't work:

"This is really exciting! I've long wanted a way to zoom into historical data, especially across different civilizations. For example, I've wanted to know what's going on in Western Europe when China invented writing, or what's happening in the America's when Luther posted his theses on the church. Kind of like an interactive version of the Connections TV series by James Burke."

Cameron said...

Hey, I'm pretty excited to start playing with gQuery.. any estimate of when you will release some code ?

Regards

Cameron.

yogurtearl said...

Is GWTQuery .1 alpha still based on ExtJS? If so how can it be MIT licensed, when ExtJS is LGPL ( I thought they were incompatible )?

Unknown said...

Thank you very much. This was a great help. -

Unknown said...

高知 不動産
徳島 不動産
高松 不動産
野生動物
自動車保険
出会いサイト
出会い
アメリカンホームダイレクト
募金
芳療
精油
不動産
アスクル
自動車保険 比較
自動車 保険 見積

Unknown said...

情趣用品,情趣用品,情趣用品,情趣用品,情趣用品,情趣用品,情趣,情趣,情趣,情趣,情趣,情趣,情趣用品,情趣用品,情趣,情趣,A片,A片,A片,A片,A片,A片,情趣用品,A片,情趣用品,A片,情趣用品,a片,情趣用品,視訊聊天室,聊天室,視訊,ut聊天室,聊天室,視訊聊天室,成人電影,

A片,A片,AV女優,色情,成人,做愛,情色,AIO,視訊聊天室,SEX,聊天室,自拍,AV,情色,成人,情色,aio,sex,成人,情色,色情,情色電影,色情網站,av女優,av,自拍,成人,視訊聊天室,視訊交友網,AV女優,成人,聊天室,ut聊天室,av女優

免費A片,美女視訊,情色交友,免費AV,色情網站,辣妹視訊,美女交友,色情影片,成人影片,成人網站,H漫,18成人,成人圖片,成人漫畫,情色網,日本A片,免費A片下載,性愛

色情A片,A片下載,色情遊戲,色情影片,色情聊天室,情色電影,免費視訊,免費視訊聊天,免費視訊聊天室,一葉情貼圖片區,情色視訊,免費成人影片,視訊交友,視訊聊天,言情小說,愛情小說,AV片,A漫,av dvd,情色論壇,視訊美女,AV成人網,情色文學,成人交友,成人電影,成人貼圖,成人小說,成人文章,成人圖片區,成人遊戲,愛情公寓,情色貼圖,成人論壇,色情

av片,aio交友愛情館,豆豆聊天室,色情聊天室,尋夢園聊天室,080聊天室,080苗栗人聊天室,上班族聊天室,成人聊天室,中部人聊天室,一夜情聊天室,情色聊天室,情色視訊,美女視訊,辣妹視訊,視訊交友網,免費視訊聊天,視訊,免費視訊,美女交友,成人交友,聊天室交友,微風論壇,微風成人,情色貼圖,色情,微風,聊天室尋夢園,交友,視訊交友,視訊聊天,視訊辣妹,一夜情

Anonymous said...

アメリカンホームダイレクト: Estimates easily auto insurance risk-segmentation. Support for compensating the content on the website. Benefits are also available with special rates for hotel and leisure facilities, offering various services.

Anonymous said...

アメリカンホームダイレクト: Estimates easily auto insurance risk-segmentation. Support for compensating the content on the website. Benefits are also available with special rates for hotel and leisure facilities, offering various services.