Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:110884 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 17586 invoked from network); 8 Jul 2020 21:29:23 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 8 Jul 2020 21:29:23 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id B78E9180510 for ; Wed, 8 Jul 2020 13:20:23 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-qk1-f178.google.com (mail-qk1-f178.google.com [209.85.222.178]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Wed, 8 Jul 2020 13:20:23 -0700 (PDT) Received: by mail-qk1-f178.google.com with SMTP id l6so42894442qkc.6 for ; Wed, 08 Jul 2020 13:20:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=newclarity-net.20150623.gappssmtp.com; s=20150623; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=jGCZ0t+lkgyMAQRH8OUprqaPJmoT8gKVNbBTBkZXF1g=; b=PyX8CdMYs8RxhMABT5uKpB3V22U6sMibEYP4wA8haTrCocDitW/kYENC5E4PPFQNrs PgGuZatlLS4Mwti94j4Zh8raPTPHU3LkdB8mgBUhbP80bgoVqxbraqcZ1FC2h9E59gIB lKYLmB1VVa0hrksvdo3v6265NPdeJN0782Iy3bpwfRQFj50gH68bCwLItabrCjySxgHZ URMThXiQShr6lpAZRS1+rt9tdsaiuSkZVyYaUezGiICo7p4j86PxCcxZL35KQHJN6VtB ORZLveVoznQkkSgIIPndtxHeDfLNHGR0c3VMJbRZ57dlfi8/AwT6nSEdAASjOu3YJ5IV 8uJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=jGCZ0t+lkgyMAQRH8OUprqaPJmoT8gKVNbBTBkZXF1g=; b=sLhBCchwXukDeSxMiVC5yycNaxgzLLS2Aew9FFeyvK9qxWS4IkaTc7rLYx6IRRaI9e zG2j4BPZlqn0bimpc+2Ak42XDjNOMBbCrHYEwtf1cc12gq+JJNCl9O9cYveFpvRHT2b0 1vHhVjfYb9FLKrTs5uCKheMzSHw8aQiHT56LLfARm+BooQFfzTXdoxagHwQVUb8KDsNO yXGLryjTbLBzMETyBfy2b6zoFDRURpbzCLUEBELFI5iqorBI6SIdVTurpCU24pfc2jpq W+8sAh8zqGtzaZ3AktbQMbRnwaEVOgrRNNSyo+QXIPUm59ffkZwKlP2HegbgWyFkPlog WGxw== X-Gm-Message-State: AOAM5301+YB9KLtsNmATHkc9rA18xrozLpxgDgmVcAUqIoQ4lWf4lw92 Y6gv9vkO320KNGH+26b7hqitCHVqUCJA2A== X-Google-Smtp-Source: ABdhPJwEkpeuyICmglMWKe/EMqaLi8nCPxXfJpaWLhq/7HHaiD2sQ/Mu/HYcS+aL1PcrWw6pq/m9rA== X-Received: by 2002:a37:a185:: with SMTP id k127mr54021638qke.221.1594239621651; Wed, 08 Jul 2020 13:20:21 -0700 (PDT) Received: from ?IPv6:2601:c0:c680:5cc0:98b4:1148:900a:c60f? ([2601:c0:c680:5cc0:98b4:1148:900a:c60f]) by smtp.gmail.com with ESMTPSA id n143sm915667qkn.94.2020.07.08.13.20.20 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 08 Jul 2020 13:20:20 -0700 (PDT) Message-ID: <9BAF6883-A16F-44D2-964E-D4E7297E5296@newclarity.net> Content-Type: multipart/alternative; boundary="Apple-Mail=_8BDC01A0-740E-4FD4-BA2F-C51E8B99B168" Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.14\)) Date: Wed, 8 Jul 2020 16:20:19 -0400 In-Reply-To: Cc: PHP Internals List To: =?utf-8?Q?Micha=C5=82_Marcin_Brzuchalski?= References: X-Mailer: Apple Mail (2.3445.104.14) Subject: Re: [PHP-DEV] [RFC][DISCUSSION] debug_backtrace alternative as an array of StackFrame objects From: mike@newclarity.net (Mike Schinkel) --Apple-Mail=_8BDC01A0-740E-4FD4-BA2F-C51E8B99B168 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Jul 7, 2020, at 4:46 PM, Micha=C5=82 Marcin Brzuchalski = wrote: >=20 > Hi internals, >=20 > following recently added alternative to `token_get_all()` in form of a > dedicated class `PhpToken` > I've made a similar proposal for collecting stack traces by = introducing > `StackFrame::getTrace()` > and `StackFrame` which replaces array with keys and values known from > `debug_backtrace()`. >=20 > To compete with easier adoption `StackFrame` implements `ArrayAccess` > giving identical API > to `debug_backtrace()`. >=20 > A test script with deep recursion up to 1M frames uses 50% less memory = than > `debug_backtrace()`. >=20 > The RFC is described here https://wiki.php.net/rfc/stack-frame-class > It includes implementation of PoC and tests. >=20 > Cheers, > Micha=C5=82 Marcin Brzuchalski Yes, excited to see this. Would adding a method that allows getting a specific stack frame rather = than the entire trace if you know which on you want take up less memory = and/or perform better?=20 Something like StackFrame::getFrame(1) which would be functionally = equivalent to StackFrame::getTrace()[1]? -Mike --Apple-Mail=_8BDC01A0-740E-4FD4-BA2F-C51E8B99B168--