Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:111139 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 94237 invoked from network); 22 Jul 2020 22:39:50 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 22 Jul 2020 22:39:50 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 75019180088 for ; Wed, 22 Jul 2020 14:34:20 -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,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11olkn2022.outbound.protection.outlook.com [40.92.18.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Wed, 22 Jul 2020 14:34:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MB3wRsh0bXMITiA8/rQwBCNk2qgCeIJZUXzf7hGWeaK/eLUoxsEVSquNxh2bgjyjKkxXrPI0PPa5qitEsbZPW+8j8MX+F0AiNaSCewZzElqfhM4T4YJn6KxTnkGF+hvk3NsEpni6CjWG2uyaxozex0nuyUHrnxMwpQq6B3ph/BbQmVWH455EqOS2w5Q3f+HeplOe4u5MBFLDFzcReMo9Nw3oBZY0T3voLFbZQBxbIKrXbCLk3JImMGSOxdu8gO1bozqsBB4WTf6rBmE6dB7gJcQVSyZISVT0KIX8a6OANhycL/cbtE9JNL3oeleyvLJr3Etz20Qpskg0PDJwEQfXFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=xDf7Jm6jURsPS/LS/rq5pNPiDE7vdk5HNG1/y2ef7hY=; b=GdjN7mrGcpC4Ij8a0HDn8vxJfw1+xyXuUCe/5NmEor9DcAUaWl/r3DxdY7roy/BZXIGjpPhgl4P9VUcWNE9ZHCdaXnkRo2f63DK23M2EmeJu+VyMTAoM4XRUdmiCTJQUwr8JpYVsUQhkGCjVM+EC0yPCs2/yLXrxmSVdZ8ypJI4JMfIqXAfB627mhlpSlxbXl8j27FjPehdZBTeSpUGlWLs9r+X5x5fOKMtfBMueekmad3JvU6EfytsYdvdMJgk+aOibWwIaJpJk+AfMsK35idCyvFWLLZ4oEwPaZoA9N3GXK4bp1Olw5x709Q81r0GsNq9ebj6dd0R99C470bcX0A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=xDf7Jm6jURsPS/LS/rq5pNPiDE7vdk5HNG1/y2ef7hY=; b=CYSu/rmViFzWPfLvmBDpi0g/bi9ylOJvJdCo7cQaTmV3FZ8SYdgYShQaGqoiYMlrTM9M3/jBcg9VMnJQNRoqZOLPkwy7GhJmhIkZW1AUCYhAKRtt/QSvwBOpY+n5W/EJNKfbmm9aY0rPd2NjvkwA/c2PCLRcvUQTGj6luuayOyMgjq1fhOfQxVVhZHV1UZG0Kicm0+VpWvPIW1vH7oaegKXVtbNxJY+yCdOff8Z1rzXs10grUFwWVU4HZvrAOPFhPHztmwjgj1EKx1eRyHLLl0TfWEUt+oVf0ZB3v0LuxWHAJF1c6QdEJBDLrhPudIJeMrPLm0yBB0gKmWNKDfuZBw== Received: from CO1NAM11FT049.eop-nam11.prod.protection.outlook.com (2a01:111:e400:3861::4a) by CO1NAM11HT217.eop-nam11.prod.protection.outlook.com (2a01:111:e400:3861::137) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3216.10; Wed, 22 Jul 2020 21:34:17 +0000 Received: from DM6PR07MB6618.namprd07.prod.outlook.com (2a01:111:e400:3861::4e) by CO1NAM11FT049.mail.protection.outlook.com (2a01:111:e400:3861::306) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3216.10 via Frontend Transport; Wed, 22 Jul 2020 21:34:17 +0000 Received: from DM6PR07MB6618.namprd07.prod.outlook.com ([fe80::cc10:a3e2:1dcf:adc1]) by DM6PR07MB6618.namprd07.prod.outlook.com ([fe80::cc10:a3e2:1dcf:adc1%6]) with mapi id 15.20.3216.023; Wed, 22 Jul 2020 21:34:17 +0000 To: Bob Weinand , =?iso-8859-1?Q?C=F4me_Chilliet?= CC: PHP internals Thread-Topic: [PHP-DEV] [RFC][VOTE] debug_backtrace alternative as an array of StackFrame objects Thread-Index: AQHWX1WA0f/lcaGde0O0eVROWwDblqkTL5oAgAB/koCAAGBjaA== Date: Wed, 22 Jul 2020 21:34:17 +0000 Message-ID: References: <20200722091010.52208a2b@mcmic-probook.opensides.be>, In-Reply-To: Accept-Language: en-CA, en-US Content-Language: en-CA X-MS-Has-Attach: X-MS-TNEF-Correlator: x-incomingtopheadermarker: OriginalChecksum:9D88859743ECD314FF874646CD3EFAD2582259A3607B91AC895EC3CA4AFBAFAF;UpperCasedChecksum:2F2E9A663F9404BFCD23611C5D1383323DFBE62B357FC10E60B9A8029384AC9E;SizeAsReceived:7387;Count:45 x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [tpkpsVHlg1G+nqIYO8fqO1LaFfOcHZ9F/Rh63vi/LOEW6YxpS2nmYTULkVnRESkD] x-ms-publictraffictype: Email x-incomingheadercount: 45 x-eopattributedmessage: 0 x-ms-office365-filtering-correlation-id: 8806ce0c-e33f-457a-eb0d-08d82e86fcf4 x-ms-exchange-slblob-mailprops: =?iso-8859-1?Q?EshqxzMeuoQ5cZLULBxOgYOoqRlazzkUiZz7cQK59Hwt0rxbjA6EGI54Hl?= =?iso-8859-1?Q?3lLJLCBsoEJkU0uUFdc9c7kicyeZxs84mJ/CmZQT8CloEWMzt+pvhnV2zT?= =?iso-8859-1?Q?sceXHv6PtuOGEz5noaJCwp9bSGIrwYvijWdMyC5xRXieBk+fupC7VMQEVh?= =?iso-8859-1?Q?pOXIlaZwpl7s+WEpDiaJv6MmjW0ULQ/vD01ix89r9tyaGGfaAVShSK8AIe?= =?iso-8859-1?Q?Q2vr/n7gLqbch+cXcF309v5NzdsIZaqmGMznKXi6TVfDyufQO6n6ewXvZD?= =?iso-8859-1?Q?Rur1W4qkeb/uyUivVtVqZPI5YUj3d5Nd4ic0GnQ6gy2/EEX98vJg959Hp9?= =?iso-8859-1?Q?HoXRsAiAmewvJQQFFSPDBca9X5DdcPrM60ijgwF6wpS3tePatieBkIga4M?= =?iso-8859-1?Q?MRHjNx2area4KZ30T1VX21df3bC02CIPP7RETn7BB/tq/u1IsGd/+5uxJ7?= =?iso-8859-1?Q?D4PIwaDbpSkyJgQ7lN1OKsRPOgnVkwDFKbL95ItQ1PjkcTPXho9lYZpDCs?= =?iso-8859-1?Q?5GBOWGw3mVUc/0FXpxrXgyrJCHYwNoQqrTO8bntSy3qX/pbdKpQo23XTbW?= =?iso-8859-1?Q?to+BJVHIojj1D1hBRhmQKsyTixjPjhZ9fZzFOnySPN//+UKJ7iJv4f2kNd?= =?iso-8859-1?Q?2/z0ghZSiQ8iHxND08C+oqf3UtYuIv5IIBFEE3iiFtNVztF1yTLrqaHLBT?= =?iso-8859-1?Q?8yCc80SuRZO51Z/j/H1cP7f2nkyrAs+3TAtyODOwgVi5Psdlj0SNz9Y494?= =?iso-8859-1?Q?sQCRrxm/kr8WgJJVNMSjTgP+8pUqQD+FOI1kecHz0pMPVRByDdZyCWlnc+?= =?iso-8859-1?Q?K7DGSX/TLuysolwLSqCWzjej3MP0gjVNt5RAv7583PVIMfHg5+5fNwZPqb?= =?iso-8859-1?Q?7NpFxwKHwu4JQG6RBLXqU2J7K7TWeTcYr+4DeLgLHENQJh28HpwIDCFONx?= =?iso-8859-1?Q?B3mxJyPY35PGvSe1OhY3dkPKGmlq6npMDUlzy7EwptmLM1BUODrHKhBZm4?= =?iso-8859-1?Q?53Hv9ogKp/R7uM7n2wlVaG0XRgxRtKe9BvCzrLLrdgLiAB7o2xqo8m4Eaf?= =?iso-8859-1?Q?XZV2f8U7znRq92XQ8Oh4ZIcrXTcKAFxu6A=3D=3D?= x-ms-traffictypediagnostic: CO1NAM11HT217: x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Kalh7d587UqKk8d4JndnqrGF+MJcx0FKF3JgdjTDSjIb6A+eQeg/KEHEohfeubwea+VWg1PD61PbAG39+HBse+J1yWeFKY0tVT9EWD3yMagDWcMVXchFFiPf0trcogrP2lmCMmGqLF13DFDQsdciRBdDUqrW/UAJZd6EDxXphbKQxvKsbVzcETW8y7r3wD9xCjK9M7dxjtYmpkm8m+ZSJc4EEyAHD2yHePyYUqyg/lIszpLl8unt1UN0R5RgVhno x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:0;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR07MB6618.namprd07.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:;DIR:OUT;SFP:1901; x-ms-exchange-antispam-messagedata: +hmox41wIKtcGq8uyQs206VD+EBs5urzQZePLsYbbfDVNoeVZq7QiRZBlbK6txHj5m9j66FE7A3N3LOl87f2RKtqeYmOpPZQisitPFRc1/7gMJ1/JsDNcGgN0HOnwcQlGYxIqCqcskzloxPcHjYlLA6Dmo6izKOkOHAFi12XMXmrQavq/wVUIQMl0Tm28OP7PuiruX4NNteS2Z+h13rcYg== x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: hotmail.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT049.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: 8806ce0c-e33f-457a-eb0d-08d82e86fcf4 X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Jul 2020 21:34:17.6520 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1NAM11HT217 Subject: Re: [PHP-DEV] [RFC][VOTE] debug_backtrace alternative as an array of StackFrame objects From: tysonandre775@hotmail.com (tyson andre) Hi internals,=0A= =0A= To answer the question of why I've voted no on this RFC,=0A= it's largely based on a uncertainty on what performance impact I'd expect= =0A= and bc breaks.=0A= =0A= 1. There are memory leaks in the implementation PR, **so this can't be accu= rately benchmarked at the moment.**=0A= Improving performance seems to be a major reason for this proposal, so i= f it doesn't improve performance in typical use cases,=0A= it'd be counterproductive, and end users may make the switch but get wor= se or only slightly better performance=0A= (depending on how the traces are processed)=0A= 2. https://wiki.php.net/rfc/stack-frame-class#performance was an impressive= benchmark result, but not representative.=0A= "On a test script with 1M recursions to produce huge result results were= as above:" would be more realistic=0A= with actually processing the data, and accounting for the time needed fo= r freeing arrays/objects.=0A= 1 million recursions is not a typical stack depth - For example, xdebug.= max_nesting_level =3D 256 in https://xdebug.org/docs/all_settings=0A= =0A= I could not reproduce the results because the test script used wasn't pr= ovided in the RFC.=0A= (e.g. unsetting the object_class property on all frames then calling jso= n_encode, to get the same stack trace as debug_backtrace)=0A= =0A= My experience is that typical applications don't keep around the stack f= rame array after logging/processing them,=0A= so the processing time would be a larger consideration for me than memor= y usage.=0A= 3. The change to the default for getTrace() for the secondary vote (which I= assume requires the default 50% majority)=0A= would only make sense if there is a significant performance benefit for= a majority of applications,=0A= and I didn't realize it was part of the secondary vote.=0A= =0A= E.g. `function normalizeFrame(array $frame): array {...}` or `$frame['a= rgs'] =3D json_encode($frame['args'])` =0A= would start throwing TypeErrors if it was called - this may affect lega= cy scripts/applications/libraries/crons.=0A= =0A= Another API alternative without the B.C. break I thought of while writi= ng this response might be `StackFrame::traceFromObject(Throwable|Reflection= Generator $t): StackFrame[]`=0A= 4. Adding multiple ways to do the same thing makes it somewhat harder to le= arn/remember a language.=0A= While adding another way to do something has been accepted/rejected in o= ther RFCs,=0A= that depends on the pros and cons of individual RFCs and preferences of = voters=0A= (e.g. how often that functionality is/would be in code people read/write= , overall performance, etc.).=0A= 5. I forgot about this when looking at this earlier, but my experience is t= hat a minority of PHP applications spend significant amounts of time in exc= eption handling or backtrace generation.=0A= =0A= Those applications may still be able to benefit from StackTrace as a PEC= L if they frequently generate trace arrays and/or keep around stack traces = for a long time.=0A= =0A= If opcache gets significantly better at optimizing php code that works with= internal typed properties,=0A= or if there was a better evaluation of the performance improvement a larger= variety of uses of debug_backtrace() would see,=0A= and if my intuition about typical applications was inaccurate,=0A= I might reconsider this.=0A= =0A= Regards,=0A= - Tyson=0A=