Skip to content

Tectonic is slower than xelatex #452

@malbarbo

Description

@malbarbo

This can be observed when generating a pdf for tests/xenia/paper.tex.

Using tectonic from master compiled with cargo install --path . and xelatex from Debian 9 in a i3-2330M 2.20GHz machine, I got the following results

> time tectonic -C -c minimal -r 1 paper.tex
real    0m1,642s
user    0m1,530s
sys     0m0,112s

> time xelatex -interaction=batchmode paper.tex
real    0m0,842s
user    0m0,796s
sys     0m0,120s

Running perf show that at least 25% of the time is expended by sha2 crate:

# Overhead  Command   Shared Object             Symbol                                                                                                                                                               
# ........  ........  ........................  ...........................................................................................                                                                          
#                                                                                                                                                                                                                    
    23.78%  tectonic  tectonic                  [.] sha2::sha256_utils::compress256                                                                                                                                  
    10.66%  tectonic  tectonic                  [.] get_next                                                                                                                                                         
     6.03%  tectonic  tectonic                  [.] load_fmt_file                                                                                                                                                    
     3.61%  tectonic  tectonic                  [.] <std::io::buffered::BufReader<R> as std::io::Read>::read                                                                                                         
     3.55%  tectonic  tectonic                  [.] <tectonic::io::InputHandle as std::io::Read>::read                                                                                                               
     3.29%  tectonic  tectonic                  [.] sha2::sha256::Engine256::input                                                                                                                                   
     2.51%  tectonic  tectonic                  [.] macro_call                                                                                                                                                       
     2.17%  tectonic  tectonic                  [.] length                                                                                                                                                           
     1.76%  tectonic  [kernel.kallsyms]         [k] clear_page_rep                                                                                                                                                   
     1.71%  tectonic  tectonic                  [.] tectonic::io::InputHandle::getc                                                                                                                                  
     1.57%  tectonic  tectonic                  [.] flush_list                                                                                                                                                       
     1.50%  tectonic  tectonic                  [.] get_uni_c                                                                                                                                                        
     1.39%  tectonic  tectonic                  [.] tectonic::engines::input_getc                                                                                                                                    
     1.16%  tectonic  tectonic                  [.] id_lookup                                                                                                                                                        
     1.16%  tectonic  tectonic                  [.] ht_lookup_table

Besides using hash to check if the engine needs to be rerun, what are the other uses? Is the hash of cached files checked? (I skimmed the code but was unable to answer that).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions