Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #81956
| 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 | <jcasale@activenetwerx.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.002 |
| X-Spam-Evidence | '*H*': 1.00; '*S*': 0.00; 'interpreter': 0.05; 'say,': 0.05; 'result,': 0.07; 'socket': 0.07; 'rewrite': 0.09; 'separately': 0.09; 'thrown': 0.09; 'wrapper': 0.09; 'yeah,': 0.09; 'api': 0.11; 'python': 0.11; 'changes': 0.15; 'windows': 0.15; 'feeding': 0.16; 'imports': 0.16; 'invoking': 0.16; 'layers.': 0.16; 'operation.': 0.16; 'received:172.18.0': 0.16; 'repeatedly.': 0.16; 'specifying': 0.16; 'sqlalchemy,': 0.16; 'sqlite': 0.16; 'subject:ORM': 0.16; 'thanks,': 0.17; 'server,': 0.19; '(the': 0.22; 'import': 0.22; 'to:name:python- list@python.org': 0.22; 'certainly': 0.24; 'driver': 0.24; 'module,': 0.24; 'propose': 0.24; 'fine': 0.24; 'regardless': 0.24; 'script': 0.25; 'changes,': 0.26; 'switch': 0.26; 'certain': 0.27; 'gets': 0.27; 'header:In-Reply-To:1': 0.27; 'idea': 0.28; '(this': 0.29; 'code': 0.31; 'feeds': 0.31; 'overhead': 0.31; 'probably': 0.32; 'minimal': 0.33; 'could': 0.34; "can't": 0.35; 'tool': 0.35; 'done.': 0.35; 'but': 0.35; 'opposed': 0.36; 'done': 0.36; 'doing': 0.36; 'next': 0.36; 'should': 0.36; 'effort': 0.37; 'tasks': 0.38; 'to:addr:python-list': 0.38; 'little': 0.38; 'extremely': 0.39; 'to:addr:python.org': 0.39; 'life,': 0.60; 'received:unknown': 0.61; 'information,': 0.61; "you're": 0.61; 'first': 0.61; 'back': 0.62; 'real': 0.63; 'such': 0.63; 'more': 0.64; 'benefit': 0.68; 'jobs': 0.68; 'to,': 0.72; 'truth': 0.81; 'around,': 0.84; 'enduring': 0.84; 'subject:opinion': 0.84; 'directly.': 0.95 |
| X-Cloudmark-SP-Filtered | true |
| X-Cloudmark-SP-Result | v=1.1 cv=Ur78AkMj4ME0q/xQKDu+fQsLaK/oG8/QJxPJp7yvMIc= c=1 sm=1 a=P90J6pEA2ccA:10 a=BLceEmwcHowA:10 a=8nJEP1OIZ-IA:10 a=xqWC_Br6kY4A:10 a=g3mLq75WYuDrh3Lt0JSDww==:17 a=QtQ-iUhKpF7puzWWFg8A:9 a=wPNLvfGTeEIA:10 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117 |
| X-Spam-Checker-Version | SpamAssassin 3.3.2 (2011-06-06) on mail.activenetwerx.com |
| X-Spam-Level | |
| X-Spam-Status | No, score=-1.0 required=5.0 tests=ALL_TRUSTED, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 |
| From | "Joseph L. Casale" <jcasale@activenetwerx.com> |
| To | "python-list@python.org" <python-list@python.org> |
| Subject | RE: ORM opinion |
| Thread-Topic | ORM opinion |
| Thread-Index | AQHQD+24ce+haI0a+EKWMfsepzvTA5yAOAAA///YjjM= |
| Date | Thu, 4 Dec 2014 23:20:08 +0000 |
| References | <CAPTjJmrix4KtLwf4S6kDHYsNLGT5KdYxhrju-0rS8GOyJGa9CQ@mail.gmail.com> |
| In-Reply-To | <CAPTjJmrix4KtLwf4S6kDHYsNLGT5KdYxhrju-0rS8GOyJGa9CQ@mail.gmail.com> |
| Accept-Language | en-US |
| Content-Language | en-US |
| X-MS-Has-Attach | |
| X-MS-TNEF-Correlator | |
| x-originating-ip | [172.18.0.4] |
| Content-Type | text/plain; charset="iso-8859-1" |
| Content-Transfer-Encoding | quoted-printable |
| MIME-Version | 1.0 |
| 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.16593.1417735282.18130.python-list@python.org> (permalink) |
| Lines | 33 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1417735282 news.xs4all.nl 2894 [2001:888:2000:d::a6]:52545 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:81956 |
Show key headers only | View raw
> First recommendation: Less layers. Instead of SQLAlchemy, just import > sqlite3 and use it directly. You should be able to switch out "import > sqlite as db" for "import psycopg2 as db" or any other Python DB API > module, and still have most/all of the benefit of the extra layer, > without any extra imports. Yeah, I am a fan of apsw but this is what I have now done. While I am fine with writing my own abstractions, its certainly less overhead using an orm. > Secondly, see if you can keep the Python process running, instead of > separately invoking it for every operation. This will mean some > structural changes, but if you're specifying Python as the plugin > interpreter (as opposed to, say, "execute this program with these > args", which is far more general), you can probably set up a wrapper > script that calls on the user code repeatedly. Perhaps you could have > a multiprocessing.Queue feeding tasks to the subprocess, via a little > parent Python process. If you can't make those kinds of changes to the > application, the next best would be a stubby driver process that feeds > jobs to your real subprocess; the real work might be done by a > Unix/TCP socket server, and the stub connects, feeds it some > information, gets back a result, and disconnects. The stub will have > an extremely minimal set of imports (the bear necessities of life, if > you like), and the real process can import as much as it likes, > because it won't be doing it for every operation. I am stuck with the current architecture, but the idea you propose has been thrown around, truth is I am not certain if we are enduring the effort of such a large rewrite that Python is the tool to use (this is a Windows application) but regardless your idea is one that is proposed. Thanks, jlc
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
RE: ORM opinion "Joseph L. Casale" <jcasale@activenetwerx.com> - 2014-12-04 23:20 +0000
csiph-web