http://qs321.pair.com?node_id=11111152


in reply to Why not perl have raw/native type

Assigning strings to a PV slot in a SV is a task with the least impact on performance, of all other tasks which the interpreter carries out: walking the optree, setting up PAD regions for lexicals, housekeeping, maintaining symbol tables and whatnot.

Even if all your variables were set up as globals, which means the SVs holding the PVs stay in place through the entirely life of a program and (re-)assigning only takes a few steps of deallocating/allocating memory and (de)referencing, there will be no significant improvement for any non-trivial program.

perl -le'print map{pack c,($-++?1:13)+ord}split//,ESEL'