Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #83745
| Path | csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed1a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <rosuav@gmail.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.080 |
| X-Spam-Evidence | '*H*': 0.86; '*S*': 0.02; 'else:': 0.03; 'cc:addr :python-list': 0.11; 'python': 0.11; 'jan': 0.12; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'function?': 0.16; 'subject:skip:e 10': 0.16; 'xslt,': 0.16; 'wrote:': 0.18; 'wed,': 0.18; 'module': 0.19; 'trying': 0.19; 'code,': 0.22; 'import': 0.22; 'cc:addr:python.org': 0.22; 'looks': 0.24; 'cc:2**0': 0.24; 'header:In-Reply-To:1': 0.27; 'function': 0.29; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'markup': 0.31; 'anyone': 0.31; 'file': 0.32; 'actual': 0.34; 'could': 0.34; 'received:google.com': 0.35; '14,': 0.36; 'disk': 0.36; 'possible': 0.36; 'pm,': 0.38; 'read': 0.60; 'entire': 0.61; 'map': 0.64; 'here': 0.66; 'potentially': 0.81; '*and*': 0.84; '2015': 0.84; 'clearer': 0.84; 'quicker': 0.84; 'xslt': 0.84; 'gender': 0.91; 'to:none': 0.92; 'mrs': 0.96 |
| DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=zX/gkkuzwJ5yA5BE23fwT/pNT9uT6WBBgQvTsD7fBp8=; b=T1htEyY9I16EcwyJgn2rAKhVpWM1OEcrqiE4V3a02sU6Ke9YRI1Inq2qa0PRsBOtAt RE34KDw3nzQ14MdbCgsjVcZsiZYTWneWa3+ey4bGLfP0CECBSesIdij0WLmxlC8S7mPr PJGeCsXw1Sh3AGYPF5V0zf6sb5oP/T2EXfl2ZSwjdpIOYyWZaKxVHz7fPH4eQTXFJ1e5 lXymfK2tnxgD0xp0oKfVqKE0GrNkwL+H3HdTv1IkOmYLt2V3UefMq7L4F/M4KxEkqzca WAHo9Qda06mCokJR0zKQ1PpKodgHXNQvfbOcpTMUx/TcnvwQNn8ek50t/nfT/9M50ouR 58+A== |
| MIME-Version | 1.0 |
| X-Received | by 10.107.32.138 with SMTP id g132mr3353313iog.43.1421234096580; Wed, 14 Jan 2015 03:14:56 -0800 (PST) |
| In-Reply-To | <CABUUr0yYBM=EJpcZXX2mJ0pz13Tum8px3Z8y3EZcr0VEo6Bfpw@mail.gmail.com> |
| References | <mailman.17684.1421168544.18130.python-list@python.org> <54b592ac$0$12995$c3e8da3$5496439d@news.astraweb.com> <CABUUr0yYBM=EJpcZXX2mJ0pz13Tum8px3Z8y3EZcr0VEo6Bfpw@mail.gmail.com> |
| Date | Wed, 14 Jan 2015 22:14:56 +1100 |
| Subject | Re: Performance in exec environnements |
| From | Chris Angelico <rosuav@gmail.com> |
| Cc | "python-list@python.org" <python-list@python.org> |
| Content-Type | text/plain; charset=UTF-8 |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.15 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list/> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.17713.1421234104.18130.python-list@python.org> (permalink) |
| Lines | 35 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1421234104 news.xs4all.nl 2839 [2001:888:2000:d::a6]:57220 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:83745 |
Show key headers only | View raw
On Wed, Jan 14, 2015 at 8:02 PM, Jean-Baptiste Braun
<jbaptiste.braun@gmail.com> wrote:
> What I'm trying to do is to map a transformation description in a markup
> langage (XSLT) in python to improve execution time. Here is a simplification
> of what it looks like :
>
> XSLT :
> <title>
> <xsl:choose>
> <xsl:when test="gender='M'">
> Mr
> </xsl:when>
> <xsl:otherwise>
> Mrs
> </xsl:otherwise>
> </xsl:choose>
> </title>
>
> Generated python :
> print('<title>')
> if gender == 'M':
> print('Mr')
> else:
> print('Mrs')
> print('</title>')
Would it be possible to do a one-off transformation of the entire XSLT
file into a Python module with a single function in it, and then every
time you need that XSLT, you import that module and call the function?
That would potentially be a lot quicker than exec(), *and* would be
much clearer - there'd be an actual file on the disk with your
generated Python code, and anyone could read it and understand what
it's doing.
ChrisA
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Performance in exec environnements Jean-Baptiste Braun <jbaptiste.braun@gmail.com> - 2015-01-13 18:02 +0100
Re: Performance in exec environnements Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-01-14 08:48 +1100
Re: Performance in exec environnements Jean-Baptiste Braun <jbaptiste.braun@gmail.com> - 2015-01-14 10:02 +0100
Re: Performance in exec environnements Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-01-15 12:51 +1100
Re: Performance in exec environnements Chris Angelico <rosuav@gmail.com> - 2015-01-14 22:14 +1100
Re: Performance in exec environnements Jean-Baptiste Braun <jbaptiste.braun@gmail.com> - 2015-01-14 14:38 +0100
Re: Performance in exec environnements Chris Angelico <rosuav@gmail.com> - 2015-01-15 00:43 +1100
Re: Performance in exec environnements Ian Kelly <ian.g.kelly@gmail.com> - 2015-01-14 10:11 -0700
csiph-web