[PATCH] refactor pp_list #13856
[PATCH] refactor pp_list #13856
Comments
From @bulk88Created by @bulk88See attached patch. Main point of the patch is to move read and writes that happened I tried to do some profiling with a script that calls pp_list ~70000 how to read, float is time in us, 2nd number is CPU ticks for calling before after Perl Info
|
From @bulk880001-refactor-pp_list.patchFrom 5b1fb5914dd2ffb35ae3286bcf8e8ee236940710 Mon Sep 17 00:00:00 2001
From: Daniel Dragan <bulk88@hotmail.com>
Date: Sat, 17 May 2014 22:10:01 -0400
Subject: [PATCH] refactor pp_list
-move PL_stack_sp and PL_stack_base reads into the branch in which they
are used, this also removes 1 var from being saved across the function
call in GIMME, which removes saving and restoring 1 non-vol register
-write SP to PL_stack_sp (PUTBACK) only if it was changed
-POPMARK is mutable, it must execute on all branches
this reduced pp_list's machine code size of the function from 0x58 to
0x53 bytes on VC 2003 -01 32 bits
---
pp.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/pp.c b/pp.c
index 4ec6887..662756e 100644
--- a/pp.c
+++ b/pp.c
@@ -4847,15 +4847,19 @@ PP(pp_kvhslice)
PP(pp_list)
{
- dVAR; dSP; dMARK;
+ dVAR;
+ I32 markidx = POPMARK;
if (GIMME != G_ARRAY) {
+ SV **mark = PL_stack_base + markidx;
+ dSP;
if (++MARK <= SP)
*MARK = *SP; /* unwanted list, return last item */
else
*MARK = &PL_sv_undef;
SP = MARK;
+ PUTBACK;
}
- RETURN;
+ return NORMAL;
}
PP(pp_lslice)
--
1.7.9.msysgit.0
|
From @tonycozOn Sat May 17 19:44:14 2014, bulk88 wrote:
Added to 5.21.1 blockers. Tony |
The RT System itself - Status changed from 'new' to 'open' |
From @tseeThanks, applied locally, tests running. Will push to blead shortly. |
@tsee - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#121906 (status was 'resolved')
Searchable as RT121906$
The text was updated successfully, but these errors were encountered: