Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:52268 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 26082 invoked from network); 11 May 2011 04:33:50 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 May 2011 04:33:50 -0000 Authentication-Results: pb1.pair.com header.from=rasmus@lerdorf.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=rasmus@lerdorf.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain lerdorf.com from 209.85.160.42 cause and error) X-PHP-List-Original-Sender: rasmus@lerdorf.com X-Host-Fingerprint: 209.85.160.42 mail-pw0-f42.google.com Received: from [209.85.160.42] ([209.85.160.42:46681] helo=mail-pw0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D0/E9-04851-DA11ACD4 for ; Wed, 11 May 2011 00:33:50 -0400 Received: by pwj3 with SMTP id 3so88347pwj.29 for ; Tue, 10 May 2011 21:33:46 -0700 (PDT) Received: by 10.68.62.3 with SMTP id u3mr3726892pbr.321.1305088426172; Tue, 10 May 2011 21:33:46 -0700 (PDT) Received: from [192.168.200.53] (c-76-126-236-132.hsd1.ca.comcast.net [76.126.236.132]) by mx.google.com with ESMTPS id m4sm5255037pbb.78.2011.05.10.21.33.44 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 10 May 2011 21:33:45 -0700 (PDT) References: <4DCA0845.1020506@lerdorf.com> In-Reply-To: Mime-Version: 1.0 (iPad Mail 8H7) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Message-ID: Cc: "internals@lists.php.net" X-Mailer: iPad Mail (8H7) Date: Tue, 10 May 2011 21:33:41 -0700 To: Gabriel Sosa Subject: Re: [PHP-DEV] making system calls from a php extension From: rasmus@lerdorf.com (Rasmus Lerdorf) On May 10, 2011, at 21:01, Gabriel Sosa wrote: > I'm basically using lynx to convert some html into plain text >=20 > basically replicating the following command: >=20 > *lynx -pseudo_inlines=3Doff -hiddenlinks=3Dmerge -reload -cache=3D0 -notit= le > -force_html -dump -nocolor -stdin* >=20 > I've been looking but I didn't find any other library capable to do > the same with "almost" the same quality. >=20 >>=20 >>=20 You may be right that it does it better than other mechanisms and it may be t= he way to go. But it sounds like you need it to be faster. You are still not= going to gain much simply by calling lynx from C. The only way to speed thi= s up is to not have to fork and exec a new process on every request. One way= to do that would be to figure out how to talk to an already running instanc= e of lynx. Then write a little Gearman wrapper for them and launch a bunch o= f Gearman workers. Another benefit of this approach is that you will be able= call lynx asynchronously. -Rasmus=