Well, you'd need to profile it to see what the actual
bottleneck is,
but Genshi could be the problem. Genshi is quite flexible,
but not
very fast. There's been some work on optimizing it, but if
you need
to run on a slower embedded processor Genshi may not be the
best
choice right now. Try it with Mako and see how the speed
compares:
http://www.makotemplate
s.org/
-- Matt
On Aug 6, 11:52 pm, dolle <rdollin... gmail.com> wrote:
> Hi to everyone,
>
> I'm developing an application for a Pocket PC with
Windows Mobile 5.0.
> I choose python, cherrpy, genshi and sqlite. The goal
of the
> application is to work offline on the PocketPC and sync
the collected
> data to a server. For syncing the data to server I'm
using pyro
> (that's working fine).
> Naturally I develop the application on my Desktop PC
and there
> everything works great and quick. But when I run
cherrypy on the
> PocketPC the perfomance decrease drastically. For
generating one page
> it takes from 5 to 10 seconds. Obviously there are more
than one
> possibilty for the performance loss:
>
> cherrypy
> genshi
> sqlite3
>
> Because it is the first time I'm using cherrypy, genshi
and sqlite3 it
> is quite difficult for me to tweak in the best way the
single pieces.
> What tweaking possibility I have for genshy? Below how
I'm using
> genshy:
>
> import os
> import cherrypy
> from genshi.template import TemplateLoader
> import sqlite3
>
> loader =
TemplateLoader([os.path.dirname(os.path.abspath(__file__))])
>
> def test(self):
> con = sqlite3.connect(self.pfad, )
> cur = con.cursor()
> cur.execute("select col1, col2, col3 from
table where col4 is
> null group by 1")
> daten=cur.fetchall()
> con.commit()
> con.close()
>
> header = loader.load('header.html')
> header.generate().render('xhtml', 'utf-8')
> footer = loader.load('footer.html')
> footer.generate().render('xhtml', 'utf-8')
>
> tmpl = loader.load('nachkunde.html')
> tmpl.generate(daten=daten).render()
> return tmpl.generate(daten=daten,
> sync=self.last_sync()).render('xhtml', 'utf-8')
>
> And here are the specs of my desktop pc and the pcoket
pc:
>
> PC Specs:
> Processor: P4 3,00 GHz
> Memory: 1,00 GB
> Windows Professional SP2
> Python 2.5.1
> Cherrypy 3.0.1
> Genshi 0.4.3
> sqlite 3
>
> Pocket PC Specs:
> Processor: PXA270-624Mhz
> Memory: 55,90 MB
> Windows Mobile 5.0 (OS 5.1.195)
> PythonCE 2.5-20061219
> Cherrypy 3.0.1
> Genshi 0.4.3
> sqlite 3
>
> thanks in advanced for your help
>
> bye
> Robert
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Genshi" group.
To post to this group, send email to genshi googlegroups.com
To unsubscribe from this group, send email to
genshi-unsubscribe googlegroups.com
For more options, visit this group at http://gr
oups.google.com/group/genshi?hl=en
-~----------~----~----~----~------~----~------~--~---
|