Aleksandar • Vacić

iOS bits and pieces

Season closure

Shit, shit, shit, shit, fuck, fuck, fuck, fuck!

As typical race as any this season. Fernando getting most of it all, Kimi good but with not the perfect car, Montoya very unfortunate, McLaren fast but not very stable and certainly “charmed” with bad luck, Fisico promising but in the end nothing worth mentioning, Ferrari horrible as in the days before Schumacher.

Interesting season nonetheless, much more exciting then previous ones.

Season 2006

What to expect?

Before this season, McLaren was huge favourite (after winter testing) to win all and now has nothing. Hence I expect nothing and everything. I’m looking forward to new proposed way of qualification, which looks to be more interesting than the actual race. I’m gonna jump on any chance to visit any F1 track again. I’m hoping that Mercedes will develop V8 engine that will not have 40% failure rate.

Wild guesses: Ferrari will not be back in the title race next season. Last season of Michael Schumacher. Renault will fall back behind. Williams should be back in the title race, maybe being the best - only if they finally make a good chassis. Red Bull will stay in the middle, Honda will be on par with Renault and McLaren.

Best race of the season

Hell with that - probably the best race of the millennium so far. It shows again that of all the stupidities that Mosley and FIA tries to make races more exciting, the best thing they should do is to bring the rain in the middle of qualification. :)

Phenomenal racing from Kimi, Fernando, M.S. all through the race. Schumacher did really great, defending his position for several laps in front of obviously quicker Renault and McLaren. Fernando, finally not driving painfully boring (except for Imola), shows off all of his talent. The most aggressive racer on the track. And Kimi…amazing as usual with fantastic move at the end - I don’t think that there was more than 2cm between his right front and Fisico’s rear left. I think I woke up half the building screaming from joy there. ;)

Brilliant, really brilliant race, a pleasure to wake at 6:30am for such a race. Renault is 2 points ahead now but if both McLarens stay on track in China, McLaren should win the Championship. But…it will be a very close thing.

RS.GetRows() considered harmful

Most of my professional work is done in ASP. And with ASP I built or helped build lots of different sites, including enterprise-level ones, where web server is constantly hit - like always has 300+ requests waiting with max possible number of requests executing. Over time, I followed what was being considered best practice and implemented these things.

One of those practices, probably the most outspoken is: use [GetRows()]( method of ADODB.Recordset and then work with created 2D array. It is quicker, faster, consumes less memory - more efficient in any way. I could not find a single trace of warning, no side-effects mentioned, nothing.

Thus in the latest project I do, I went all-GetRows. I eliminated all traces of RS.EOF and RS.MoveNext, and built huge amount of code using this technique. Initial testing showed greatly increased performances (3x and more) and it went live.

Soon after, the hellish weeks started.

What no one told you is that using GetRows heavily (and I mean heavily) fragments heap memory. So much, that after some time Oracle OLEDb provider or ADO (have no idea which) starts throwing cannot allocate memory messages with several garbage characters after it. When it will happen depends on how much users are attacking the web site. The more users - the very situation where you need high code speed - the quicker it spends the memory. I guess that after a while it gets into situation where there is no large enough memory block to read recordset into it and/or create an array out of it.

CPU is always close to 100% due to heavy load. Maybe there is no free CPU time at all for memory management…

I’m totally stumped with this and have no idea what to do with it. I spent weeks rearranging the code to minimize the array allocation and only managed to postpone the problem point.

Have anyone built ASP site that gets constantly hit and uses GetRows() or generally uses lots of large arrays? Have anyone encountered this at all?

Moving to .NET is not an option in anything that resembles near future. I’m stuck with this and must solve it somehow; the only option I see now is to return to Recordset processing.