Monday, March 27, 2006

More side projects, and (small) Javascript grid rant.

I'm letting Compiled Page Templates settle for a little bit, I got some pretty quick feedback about some bugs, but, nothing for a little while, I'm sure there will be more. I'm hoping it gets a hammering by some people. I converted ZWiki to use it, but, the underlying framework is a little too obfuscated to really get a decent speed up out of it (I could only manage 10%).

Meanwhile I'm working on Javascript parser in python. I'm not sure where this will end up, but, I can see that it would be very useful to be able to run javascript inside python.

I've been trying to find a 'nice' looking template so I can actually build a 'proper' website. I've spent a few hours playing around building static pages, and I just can't be bothered. So I guess I'll being doing something in Zope for that too. Actually once I get that up and running, I think I might consolidate all of my various projects there. As always it's finding the time, and since we're being evicted, I don't think I'll make any headway on that until after we find a new place and move in.

I played a little with jsolait and Zope the other day. The jsolait xmlrpc lib is like python's so it's nice to use (even though I'm not a Javascript guy really), but, it's going to help out on my current paying gig, so it was worth investigating. I'm not really a front-end guy at all, but, it's irritating that even the 'nice' javascript grid widgets suck. I guess that's a byproduct of living inside a webpage. I really want to be able to create a grid that grows and shrinks dynamically. All of the ones I've seen so far, can grow, but, never get any smaller. That's great if you want to browse a fixed dataset, but, rotten if, for example, you want to display an active queue of items.

On the grid thing, the LiveGrid people suggested we no longer needed paging, and we could just use scrolling to navigate through datasets. Well that's great if your dataset is really small, but, it's sucks if you want to get to something in the middle of the dataset. Something that will stay in the middle of the dataset regardless of how you sort it. I often find myself binary searching results from various searches trying to find the set I want (I'm not talking google searches here). I don't want to go back to linear search.

Sunday, March 19, 2006

Speeding up ZPTs

I'm doing a bit of 'tinkering' again with some of my old Zope projects I have lying around.
I''ve written my own TAL engine, and I was testing it to see if it was any faster;
Using this template (thanks mcdonc d8), I ran a test using the venerable ab tool that comes with apache. Don't write in to tell me my hardware is crap, I know that, I don't performance test on high-performance hardware..

<html xmlns:tal="http://xml.zope.org/namespaces/tal">
<head>
<title>This is the title</title>
<div>This is the head slot</div>
</head>
<body tal:define="values python:[('bug', 'me'),]*20">
<div>
<span tal:replace="values" />
<form action="." method="POST">
<table border="0">
<tbody>
<tr tal:repeat="itemz values" class="foo">
<td tal:content="python: itemz[0]">Name</td>
<td tal:content="python: itemz[1]">Description</td>
</tr>
</tbody>
</table>
</form>
</div>
</body>
</html>

The following are directly to Zope, not via apache.
First standard Page Templates;

Server Software: Zope/(Zope
Server Hostname: xanadu
Server Port: 8080

Document Path: /tmp/testTemplate2
Document Length: 2444 bytes

Concurrency Level: 10
Time taken for tests: 9.467635 seconds
Complete requests: 1000
Failed requests: 0
Write errors: 0
Total transferred: 2651000 bytes
HTML transferred: 2444000 bytes
Requests per second: 105.62 [#/sec] (mean)
Time per request: 94.676 [ms] (mean)
Time per request: 9.468 [ms] (mean, across all concurrent requests)
Transfer rate: 273.35 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.8 0 9
Processing: 20 93 13.1 93 189
Waiting: 18 87 12.5 88 169
Total: 20 93 13.2 93 189

Percentage of the requests served within a certain time (ms)
50% 93
66% 94
75% 94
80% 94
90% 99
95% 105
98% 143
99% 150
100% 189 (longest request)
And now my Templates.

Server Software: Zope/(Zope
Server Hostname: xanadu
Server Port: 8080

Document Path: /tmp/testTemplate
Document Length: 2262 bytes

Concurrency Level: 10
Time taken for tests: 7.341181 seconds
Complete requests: 1000
Failed requests: 0
Write errors: 0
Total transferred: 2469000 bytes
HTML transferred: 2262000 bytes
Requests per second: 136.22 [#/sec] (mean)
Time per request: 73.412 [ms] (mean)
Time per request: 7.341 [ms] (mean, across all concurrent requests)
Transfer rate: 328.42 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.8 0 9
Processing: 23 72 13.6 72 170
Waiting: 21 66 12.7 67 130
Total: 23 72 13.6 72 170

Percentage of the requests served within a certain time (ms)
50% 72
66% 73
75% 73
80% 74
90% 87
95% 94
98% 107
99% 115
100% 170 (longest request)

30% faster, and that's a trivial page template. I need to find a less synthetic test, to do some 'real' testing and find out how much faster it really is, especially with METAL involved.
I can speed it up a little more too by sharing the 'cooking' between threads.

Anyhow stay tuned...