* [PATCH 3/4] view: do not modify array during iteration
2016-12-24 11:52 5% [PATCH 0/4] HTML micro-optimizations Eric Wong
@ 2016-12-24 11:52 7% ` Eric Wong
0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2016-12-24 11:52 UTC (permalink / raw)
To: meta
This results in a half percent speedup or so doing
$MESSAGE_ID/T/ HTML generation for a 368 message thread.
---
lib/PublicInbox/View.pm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm
index 97a8bcb..39ca959 100644
--- a/lib/PublicInbox/View.pm
+++ b/lib/PublicInbox/View.pm
@@ -476,7 +476,7 @@ sub add_text_body {
}
my @quot;
my $l = PublicInbox::Linkify->new;
- while (defined(my $cur = shift @lines)) {
+ foreach my $cur (@lines) {
if ($cur !~ /^>/) {
# show the previously buffered quote inline
flush_quote(\$s, $l, \@quot) if @quot;
--
EW
^ permalink raw reply related [relevance 7%]
* [PATCH 0/4] HTML micro-optimizations
@ 2016-12-24 11:52 5% Eric Wong
2016-12-24 11:52 7% ` [PATCH 3/4] view: do not modify array during iteration Eric Wong
0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2016-12-24 11:52 UTC (permalink / raw)
To: meta
Testing with a horriblely long 368-message thread on git@vger,
I've found some minor tweaks which give us some tiny speedups.
Unfortunately, these are minor and new features may end up
costing us more in the future. Further optimizations are
needed.
Eric Wong (4):
view: remove unused parameter
view: stop chomping off whitespace at ends of messages
view: do not modify array during iteration
linkify: modify argument in place
lib/PublicInbox/Linkify.pm | 17 +++++++----------
lib/PublicInbox/View.pm | 21 +++++++++------------
2 files changed, 16 insertions(+), 22 deletions(-)
^ permalink raw reply [relevance 5%]
Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2016-12-24 11:52 5% [PATCH 0/4] HTML micro-optimizations Eric Wong
2016-12-24 11:52 7% ` [PATCH 3/4] view: do not modify array during iteration Eric Wong
Code repositories for project(s) associated with this public inbox
https://80x24.org/public-inbox.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).