getsentry / pdb

A parser for Microsoft PDB (Program Database) debugging information
https://docs.rs/pdb/
Apache License 2.0
368 stars 68 forks source link

LineProgram::lines_at_offset is pretty slow #61

Closed calixteman closed 2 years ago

calixteman commented 4 years ago

Looking at https://github.com/willglynn/pdb/blob/master/src/modi/c13.rs#L897 it seems that getting all the line info for all the files is quadratic in the number of files.

jan-auer commented 4 years ago

Correct. It currently parses all sections over and over again, instead of just once when constructing the line program.

I have a preliminaty fix for this already, will try to check it in soon.

calixteman commented 4 years ago

It'd be nice :) Using perf I noticed that 20% of the time is spent in this fonction.