texinfo-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[no subject]


From: Gavin D. Smith
Date: Fri, 3 Jun 2022 20:08:13 -0400 (EDT)

branch: master
commit f4865d2d6bf1363e38dad08938e4b1cd3a085fad
Author: Gavin Smith <gavinsmith0123@gmail.com>
AuthorDate: Sat Jun 4 00:27:02 2022 +0100

    texi2any --html performance improvement
    
    * tp/Texinfo/Convert/HTML.pm (_convert_text):
    Hard-code access to 'conf' array rather than calling
    get_conf method.  This is a heavily used function.
    Profiled with Devel::NYTProf.
---
 ChangeLog                  |  9 +++++++++
 tp/Texinfo/Convert/HTML.pm | 11 ++++++-----
 2 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 70c0c57e5f..8e9e20b053 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2022-06-04  Gavin Smith  <gavinsmith0123@gmail.com>
+
+       texi2any --html performance improvement
+
+       * tp/Texinfo/Convert/HTML.pm (_convert_text):
+       Hard-code access to 'conf' array rather than calling
+       get_conf method.  This is a heavily used function.
+       Profiled with Devel::NYTProf.
+
 2022-06-03  Gavin Smith  <gavinsmith0123@gmail.com>
 
        texi2any --html performance improvement
diff --git a/tp/Texinfo/Convert/HTML.pm b/tp/Texinfo/Convert/HTML.pm
index e6b7269c4f..dee72e1723 100644
--- a/tp/Texinfo/Convert/HTML.pm
+++ b/tp/Texinfo/Convert/HTML.pm
@@ -5428,15 +5428,16 @@ sub _convert_text($$$)
   return $text if ($self->in_raw());
   $text = uc($text) if ($self->in_upper_case());
   $text = &{$self->formatting_function('format_protect_text')}($self, $text);
-  if ($self->get_conf('ENABLE_ENCODING')
-      and $self->get_conf('OUTPUT_ENCODING_NAME')
-      and $self->get_conf('OUTPUT_ENCODING_NAME') eq 'utf-8') {
+
+  if ($self->{'conf'}->{'ENABLE_ENCODING'}
+      and $self->{'conf'}->{'OUTPUT_ENCODING_NAME'}
+      and $self->{'conf'}->{'OUTPUT_ENCODING_NAME'} eq 'utf-8') {
     $text = Texinfo::Convert::Unicode::unicode_text($text,
                                         ($self->in_code() or 
$self->in_math()));
   } elsif (!$self->in_code() and !$self->in_math()) {
-    if ($self->get_conf('USE_NUMERIC_ENTITY')) {
+    if ($self->{'conf'}->{'USE_NUMERIC_ENTITY'}) {
       $text = $self->xml_format_text_with_numeric_entities($text);
-    } elsif ($self->get_conf('USE_ISO')) {
+    } elsif ($self->{'conf'}->{'USE_ISO'}) {
       $text =~ s/---/\&mdash\;/g;
       $text =~ s/--/\&ndash\;/g;
       $text =~ s/``/\&ldquo\;/g;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]