Changeset 317:81bfcb29ef3b

Show
Ignore:
Timestamp:
2007-09-02 16:37:54 (1 year ago)
Author:
Stefan Schwarzer <sschwarzer@sschwarzer.net>
branch:
default
Message:
Removed code to measure rendering times with and without Pygments
cache. This should be investigated (profiled) more thouroughly anyway.
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • browser.py

    r316 r317  
    173173        Handle HTTP GET request. 
    174174        """ 
    175         start_time = time.time() 
    176         self._time = None 
    177175        # reject forbidden clients 
    178176        if config.allowed_clients is not config.ALL_CLIENTS and \ 
     
    235233                       h1_class=h1_class, 
    236234                       use_header_and_footer=use_header_and_footer) 
    237         print "Render time:", time.time() - start_time, "s" 
    238235 
    239236    # 
  • converter.py

    r316 r317  
    199199    return u"\n".join(('<pre>', cgi.escape(text), '</pre>')) 
    200200 
    201 def text_to_html(text, path, _cache={}): 
     201def text_to_html(text, path): 
    202202    """ 
    203203    Convert the unicode string `text` to HTML and return the HTML 
     
    207207    if not pygmentsfinder.found_pygments: 
    208208        return dumb_text_to_html(text) 
    209     #TODO make cache handling threadsafe when Websourcebrowser 
    210     #  works multithreaded 
    211     if (text, path) in _cache: 
    212         return _cache[text, path] 
    213209    try: 
    214210        # assume the link doesn't point to a link or at least has 
     
    227223                linenos=config.line_numbers) 
    228224    html = pygmentsfinder.pygments.highlight(text, lexer, formatter) 
    229     _cache[text, path] = html 
    230225    return html 
    231226