sambitdash / PDFIO.jl

PDF Reader Library for Native Julia.
Other
127 stars 13 forks source link

improve parsing speed #104

Closed hhaensel closed 2 years ago

hhaensel commented 2 years ago

I was recently struggling with the parsing speed and finally found the bottleneck.

The root cause of slow performance is the expression evaluation

eval(Expr(:call, arr...))

which I replaced with

arr[1](arr[2:end]...)

I also did some minor rewrite but that's not a real speed gain (1%) whereas I could get a speed improvement of more than a factor of 10 for some files by removing the expression evaluation.

sambitdash commented 2 years ago

@hhaensel please review #105 as well.

hhaensel commented 2 years ago

Let's go for #105 Identical speed, but clearer