develooper Front page | perl.perl5.porters | Postings from March 2021

Re: RFC / POC - more than 32 features

Thread Previous | Thread Next
From:
Nicholas Clark
Date:
March 24, 2021 20:27
Subject:
Re: RFC / POC - more than 32 features
Message ID:
20210324194620.GQ16703@etla.org
On Wed, Mar 24, 2021 at 06:34:35PM +0000, Philip R Brenan wrote:
> Please provide a feature bit for every feature of Perl so that users can
> remove all the features they do not want to obtain a custom language that
> reflects their exact requirements with maximal performance unburdened by
> features that other people "might" want.

I think that if one actually did that, the sheer number of C code branches
that it created would would flood the CPU's branch prediction cache, even if
each of those branches (in a particular program run) were taken the same
way. The cache just wouldn't have space to record all of this.

The result would be that the interpreter would actually run more slowly than
the case *without* the super-granular feature options.

The other problem (and I'd not considered it until LeoNerd mentioned it) is
that number of combinations of features grows exponentially with the number
of feature options. Meaning that it becomes hard to test all combinations
(or even reason about them), making it likely that there would be bugs and
inconsistencies lurking that burn more time than seeming performance or
flexibility gains.

Nicholas Clark

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About