Recently, I was working on a customer complaint that our application was slow when churning out reports. The worst case occurs when the user selects to generate a report for the time-span of 18 months, and the application will take about 3 minutes plus to generate the reports. Not being very familiar with Javascript and DOM, I googled and found the following resources which were extremely helpful.

Nicholas C. Zakas

Speed up your JavaScript, Part 1
Speed up your JavaScript, Part 2
Speed up your JavaScript, Part 3
Speed up your JavaScript, Part 4

Yahoo! Developer Network
Exceptional Performance

Dev Opera
Efficient JavaScript

IE Blog
IE + JavaScript Performance Recommendations - Part 1
IE+JavaScript Performance Recommendations Part 2: JavaScript Code Inefficiencies
IE+JScript Performance Recommendations Part 3: JavaScript Code Inefficiencies

In our app, I found that main bottleneck was that that there was simply too much DOM interaction when creating the report’s table. Creating the report involved  creating TD and TR DOM elements and adding them to a table, and deciding when to break the page. After the report is created, some of the TD cells will be merged based on some criteria.

To tune the app, I cloned the TBODY node of the table, added all the child nodes into this cloned node, and replaced the original node. Then, I has to clone the node again for doing the breaking the pages and merging the cells. Basically, it involved multiple calls to cloning the nodes, creating new doc fragments, and replacing the original nodes. Basically, it seems like the code is doing a lot more work than the original. However, it is more than 60% percent faster after tuning!

As a side-note, it really is hell trying to work on a JSP that mixes scriptlets and badly-written Javascript. First, visually it’s so messy it’s disorientating. Second, sometimes you can’t do profiling until you’ve refactored the Javascript, which is sometimes hopelessly entangled with the JSP scriptlets.  And some people always wonder why I’m rewriting so much code :/

Related posts:

  1. Maven2 - installing 3rd party JARs Have a little time these few days, trying to get familiarised with Maven2. Not for...

Comments No Comments »

It’s the first day of IT Show 2009, and there was a huge turnout of eager shoppers looking for good deals. Being a Thursday afternoon, you’ll expect the crowd to be a bit thinner. I expected to be in and out within an hour as I’m a focussed shopper, but the snaking queues almost began the moment I stepped out of City Hall MRT. After about an hour and a half I finally completed my re-contract and purchase of Nokia’s XpressMusic 5800. There was a minor hiccup when a staff did not give me free earphones worth 139 bucks, but thankfully it was resolved promptly. Finally, I’m back to owning a camera-phone after more than 3 years!

There’s many interesting IT products in the show, like ACRyan’s Playon! DVR. I own an older version of ACRyan HD recorder, but the new version is on steroids! Expanded connectivity options (wired and wireless), video-stream playback capability and the ability to record analog and digital TV certainly makes it very attractive.

UOB credit card owners looking for a new camera can check out Harvey Norman for the Fujifilm Finepix F60FD. It’s 349 (originally 499) after trade-in with ANY camera (including those using film) and you get a whole lot of freebies (mini-tripod, 8GB SD card, etc) just by swiping your card.

Overall it’s a pretty nice shopping experience. With lots of stuff at discounted prices and with cute show girls manning some of the booths, even the congestion can be forgiven :)

Tags:

Related posts:

  1. Japanese drama - Shiroi Kyoto (The Great White Tower) This is a highly addictive drama about 2 outstanding doctors who pursue their distinctly different...

Comments No Comments »

最近在追“未来不是梦”,觉得题材相当有趣,更有趣的是拍摄的动机。主题曲相当特别,是我近期来最喜欢的歌曲。

歌词 by 小寒

http://blog.omy.sg/xiaohan/2009/02/02/我用悲觀去樂觀著。/

Tags: , , , ,

No related posts.

Comments No Comments »

With all the news about retrenchments  locally and abroad and how hard it is for people to land jobs, I’m seeing quite a lot of new faces in and around my workplace, quite a number of them fresh grads. And among my friends and colleagues, quite a few have switched jobs. My mailbox is full of alerts from job portals about new opportunities. So amidst all the doom and gloom, I’m just wondering, is the local IT sector more resilient against the current recession compared to the other industries?

Tags: , ,

Related posts:

  1. MOM’s Report on Wages in Singapore, 2006 The annual report on wages in Singapore has been released recently by Ministry of Manpower....
  2. Thoughts on Singapore becoming high-cost, low-tech Recently there’s been a glut of articles in the Straits Times on the subject of...
  3. MOM’s Report on Wages in Singapore, 2005 MOM’s Report on Wages in Singapore 2005 The above link is broken…….use this one instead…...
  4. Thoughts on The Life Science Conundrum The life sciences conundrum http://www.todayonline.com/articles/147445.asp After the hype, grads now realise that there’s no place...
  5. When higher education harms While we usually equate higher education with increased job opportunities, this is not the case...

Comments 1 Comment »

陈绮贞的新专辑发行了!那天听朋友说了之后我马上到唱片行去买。933强力推选,但我是他的粉丝,没人推荐也会照买无误。真的觉得这张专辑非常好听,“太阳”和“烟火”属于摇滚,令我情绪高昂也想跟着呐喊。“距离”和“下个星期去英国”则属于清新民谣,听了让我轻松许多。

原来新加坡有绮贞的后援会,太棒了!而且值得注意的是,她将在四月四号在室内体育馆举办演唱会!太棒了吧?

Tags: , , ,

Related posts:

  1. Cheer Chen 陈绮贞 - [ A Piece of Summer 2007 Singapore ] 好不容易等到了这一天,二零零七九月二十九,一个难忘的夜晚.音乐才女陈绮贞在新加坡Expo, Max Pavilion,举行的一场大型售票演唱会!我还记得,她曾经来过新加坡,和陈升一起.那时错过了,感觉很可惜,所以告诉自己不要浪费这一次的机会.我一向很欣赏她,总觉得她在音乐创作上很有自己的想法,而且嗓音很独特甜美.最大的加分点是她是个很棒的吉他手!所以我对她情有独钟. 倒数八点十五 约了朋友的朋友做伴,入席时是七点半.我们坐在右边前方,察看四周,人群相当稀疏.难道喜欢陈绮贞的新加坡朋友那么少吗?朋友说,她在台湾演唱会的票一小时就卖光了,我听了吓了一跳.在两地的人气有那么大的落差吗?我的担心是多余的,可能是国人的迟到习惯在作祟,仁然有人在演唱会指定开幕的时间从入口进来. 十五分钟后,现场几乎爆满,大荧幕上也计时倒数.五,四,三,二,一. A Piece of Summer, 引爆! 嫦娥绮贞 四周黑暗,台前的白幕后,一道光照出一个人影.这道光形成了圆形,像足了月亮,月里的人更像是月宫中的嫦娥.嫦娥正拿着一把吉他.尖叫声四起,只因今夜嫦娥就是绮贞.白幕落下,弦声响起,她头戴花圈,身穿白色长裙,唱起了一首我不熟悉的歌曲.这是”九份的咖啡店”吗?这是收录在已绝版的”Demo3″的歌,而”Demo”系列正是我收集中的缺憾.但能够听到这首歌在现场演唱,也算难得. 振奋人心的曲目 鼓手槌起了浑厚低沉的鼓,...
  2. Album - Chen Qizhen’s Hua Li De Mao Xian 陈绮贞 - 华丽的冒险 一直以来都是陈绮贞的歌迷,很高兴这张专辑上了蛮多2005的十大专辑排行榜。 但是看来延续了叫好不叫座的传统,在销量排行榜上名落孙山。到了三四家唱片行但始终找不到这张专辑,还有一些店员不知道这张专辑的存在,太叫人失望了。在此要称赞 Tower Records 的某个男店员,产品知识丰富及服务无微不至,让我在购物时感觉找到了知音,哈哈。。。 特别令我注意的是陈绮真继续在玩英式摇滚风,主打“华丽的冒险”及“Sentimental Kills”表现了她在音乐上的探索。“表面的和平”是首清新的歌曲,吉他伴奏增添了民谣味道,这算是她的拿手好戏。“腐朽”和“静静的生活”感觉很 laid-back,蛮适合在懒洋洋的下午听。当然还有“旅行的意义”,但不用多介绍了吧?这首歌在电视上打得相频繁。 令我遗憾的是没收录“After Seventeen”这首歌,听朋友说是首舞台剧的歌,这一下可难搞了。 旅行的意义 ...

Comments No Comments »

A beautiful, melodic piece by Rynten Okzaki

Tags: , , , ,

Related posts:

  1. Beautiful rendition of Masaki Kishibe’s Scudding cloud(流れ行く雲) Masaaki Kishibe is famous for the beautiful, melodic guitar pieces he creates. This Youtube clip...

Comments No Comments »

I was reading the Straits Times the other day about the positive benefits about starting the school day later.  Basically, students would perform better academically. However, as bus operators who ferry students to schools also ferry worker to offices/factories, they pick up the students on the same schedule as before, Schools that have pushed back their start times find some students still arriving at the same time and these students have to endure a longer wait. The articles suggests pushing back the starting time even further back (to say 9am) so that bus operators have enough time to ferry workers and students. Parents would also have some time for breakfast with their kids. Anyway, I saw this letter to the ST forums:

Teachers and other staff will also benefit from later start to school day

MANY parents like me are in full agreement with the article, ‘Start school later and let children sleep longer’ (Jan 9).

Finally, after so many years, we have an article that puts this matter in perspective. How is it that our children’s well-being is determined by bus operators keen to make more money by operating two services instead of one? Since Singapore has no natural resources and depends on labour to sustain the economy, do the authorities not want to evaluate the ramifications of sleep deprivation on our children in their growing years?

 

Apart from that, will teachers and other school staff not also benefit from this positive change? I am certain that teachers and staff will welcome the change as this means aligning their working hours to those of their spouses and other family members. With positive changes like this, the Ministry of Education will see less attrition of good teachers too.

 

Furthermore, if school starts later at 8.30am or 9am, schoolchildren will also depend less on school buses as working parents can take them to school on the way to work. It is ridiculous to allow children’s and school staff’s well-being to be decided by bus operators. It is time the authorities looked into this and not continue this mindless trend.

 

With sufficient rest, children will not find school as tiring and tedious and will enjoy it more. Teachers will also be less sleep-deprived and able to deal with work stress better too.

 

Ginny Leow (Mdm)

Some thoughts.

First, can we fault the bus operators for wanting to make more money by operating two services instead of one? Of course not, these are private business entities and they provide a solution to the problem of getting kids to schools. How much of a rise in transportation fees are parents willing to bear so that bus operators can maintain their current profits by running one service instead of two? And since labour is indeed needed to sustain the economy, it is important as well to ferry workers to their workplaces as well and it should not be denigrated.

Second, what are the ramifications for other motorists, public commuters and transport operators? And not all students take school buses, quite a lot of them make use of public transport as well and starting school later would definitely add a significant amount of traffic during the morning rush hours. Feeder and intra-town bus services would be most severely affected as many primary and secondary schools are located near to student’s homes. They would be jam-packed with students at a time when hordes of people are rushing to work. Train passengers would be affected as well but would not be as much since student traffic is usually localised (at least for primary and secondary students).

To add on, if parents drive and need to drop their kids off, traffic around the school might slow down as well. If they don’t, they’ll need to take the public transport to send their kids to school. Either way we’re looking at a situation where almost everyone spends more time in their daily commute and a certain proportion of them needs to wake up earlier. And the reason for this is so that students can spend more time sleeping. How ironic is that?

If school is to start later…..make it a lot later

Starting school later is a good idea, but clashing with the peak hour traffic is not. 9.30 or 10am would be a better  time to start school as the crowd would have thinned out by then

Tags: ,

Related posts:

  1. Poly route shut for average students Recently, there was this letter to the Straits Times about average students being squeezed out...
  2. Granado Espada in Singapore’s education system Was surfing the web for Granado Espada related stuff, when I found out that the...
  3. Holistic approach to solving transport issues I’ve been following the news on falling public transport use , and I think of...
  4. Student couple suspended for hugging in MRT 偷拍风波又一起  地铁内亲热遭举报  小情侣被令暂停学 游润恬 上个月某天,一对穿着校服的中学情侣肩并肩乘坐地铁,女的累了,把头靠在男的肩上,男的搂着女的肩。刚好在同一列地铁上的校友见了,悄悄用手机拍下这一幕,把画面通过电邮发给校长。 Article dated 13 Aug 2006 Source: http://www.zaobao.com/sp/sp060813_512.html The full article is...
  5. Thoughts on Joseph Chia’s letter on “If There’re Seasons…” About 2 weeks ago, I read Chim Kang’s piece on Zao Bao ( a Chinese...

Comments No Comments »

I know that currently most people are addicted to The Little Nonya, but for me, Iljimae wins hands down. The plot is pretty confusing at times (just ask my mom, she’s still lost) because each of the two male leads has more than 1 father, and 2 of the fathers are common to both the leads, though they do not know it. The two half-brothers seem doomed to kill each other in some sort of a confrontation as one of them (Lee Geom) becomes the infamous thief Iljimae, while the other becomes a law-enforcer who’s in hot pursuit of him. The tragedy that befalls Lee Geom really draws me in and it’s really gratifying to see how he exacts revenge against the forces that slayed his family. I’m expecting lots of exciting fight scenes once he masters some thievery and martial arts skills.

Iljimae main cast

Iljimae main cast

Besides there’s also some eye candy to ogle at in the form of Han Hyo Joo, Lee Young Ah and Son Tae Young (too few of her appearances, really).

And to top it off, the music is really top-notch, I’ve got to say some of the tracks instill a sense of poignant melancholy. Like this, it seems to be called “Hwa Sin”, or “Flower Letter”

花信-朴孝信.mp3 -

This is the opening theme, which I really like for it’s pensive beginning and the subsequent kicking in of the percussion and strings to set the dramatic mood.

iljimae(Main Title) - Ryo Yoshimata

And this piece for a bit of soothing sentimentalism

iljimae - 03

I’m gonna get the OST :)

Tags: , ,

Related posts:

  1. Korean movie - Scent of Love I caught this show on either Channel 8 or Channel U. It seems that the...

Comments 1 Comment »

the one that sang for the NKF charity show? Given the questions raised regarding the minister’s involvment in NKF, you would have thought he would be more prudent and get his assistants to do background checks on organisations that he would become associated with. Totally agree with DK on the point that even though the minister would like to distance himself from the degree mill, the degree mill got him to make the speech exactly because they would appear to be on close relations with gvernment agencies. Few would expect the government would cheat them or be cheated by the degree mill.

 

 

Links to articles:

Worthless degrees

 

Trust private schools here?

Tags: ,

No related posts.

Comments 1 Comment »

Usually we tune a guitar before or after a song. Watch Antoine Dufour tune it in while playing!

Tags: , ,

Related posts:

  1. Beautiful rendition of Masaki Kishibe’s Scudding cloud(流れ行く雲) Masaaki Kishibe is famous for the beautiful, melodic guitar pieces he creates. This Youtube clip...
  2. Excellent 11 year-old guitarist Was looking for a specific song on Youtube when I came across this video clip....

Comments No Comments »