git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 4/3] gitweb: Fix fallback mode of to_utf8 subroutine

From
Jakub Narebski <jnareb@gmail.com>
Date
Dec 19, 2011, 12:11 UTC
Message-ID
<201112191311.58787.jnareb@gmail.com>
In-Reply-To
<201112190154.19107.jnareb@gmail.com>
Jakub Narebski wrote:
Show 11 quoted lines
> e5d3de5 (gitweb: use Perl built-in utf8 function for UTF-8 decoding.,
> 2007-12-04) was meant to make gitweb faster by using Perl's internals
> (see subsection "Messing with Perl's Internals" in Encode(3pm) manpage)
> 
> Simple benchmark confirms that (old = 00f429a, new = this version);
> note that it is synthetic benchmark of standalone subroutines, not
> of gitweb itself
> 
>         old  new
>   old    -- -65%
>   new  189%   --
Nb. that was about operations / second (higher is better):
           Rate  old  new
    old  2067/s   -- -65%
    new  5863/s 184%   --
Or in slightly different benchmark (more smaller lines):
          Rate  old  new
    old  277/s   -- -73%
    new 1021/s 268%   --
 old$ time ./t9500-gitweb-standalone-no-errors.sh >/dev/null
   real       1m16.788s
   user       1m0.908s
   sys        0m14.033s
   user+sys   1m14.941s
 new$ time ./t9500-gitweb-standalone-no-errors.sh >/dev/null
    real      1m12.216s
    user      0m57.300s
    sys       0m13.329s
    user+sys  1m10.639s
Though such benchmarks should have been a part of e5d3de5.
P.S. I started to get strange errors
 XML Parsing Error: xml processing instruction not at start of external entity
 Location: http://localhost/cgi-bin/gitweb/gitweb.cgi
 Line Number 37, Column 1:
 <?xml version="1.0" encoding="utf-8"?>
 ^

while "show source" shows that '<?xml version="1.0" encoding="utf-8"?>' is the first line. WTF?!?

P.P.S. Now I am getting errors when running gitweb, but only in some cases (via mod_cgi not as standalone script, only when using lynx), namely it looks like it falls back to 'latin1' when doing content which is valid UTF-8.

Will investigate.
-- 
Jakub Narebski
Poland
Previous: Jakub NarebskiNext: Jakub Narebski
Message 7 of 8 in “gitweb: Various to_utf8 / esc_html fixes”
  1. 0/3 gitweb: Various to_utf8 / esc_html fixesJakub Narebski, Dec 17, 2011
  2. 1/3 gitweb: Call to_utf8() on input string in chop_and_escape_str()Jakub Narebski, Dec 17, 2011
  3. 2/3 gitweb: esc_html() site name for title in OPMLJakub Narebski, Dec 17, 2011
  4. 3/3 gitweb: Output valid utf8 in git_blame_common('data')Jakub Narebski, Dec 17, 2011
  5. Junio C HamanoDec 17, 2011
  6. 4/3 gitweb: Fix fallback mode of to_utf8 subroutineJakub Narebski, Dec 19, 2011
  7. Jakub NarebskiDec 19, 2011
  8. 4/3 gitweb: Fix fallback mode of to_utf8 subroutineJakub Narebski, Dec 19, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.