|Anonymous | Login | Signup for a new account||2014-04-25 00:43 CEST|
|Main | My View | View Issues | Change Log | Roadmap|
|View Issue Details|
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0006302||OCaml||OCaml runtime system||public||2014-01-22 10:51||2014-03-28 10:46|
|Priority||normal||Severity||minor||Reproducibility||have not tried|
|Target Version||Fixed in Version|
|Summary||0006302: Very slow backtraces in bytecode : debug infos read from the filesystem everytime|
|Description||The function read_debug_info() in byterun/backtrace.c is called every time a backtrace is requested.|
Recently, we wanted to log backtraces in one piece of the program and it became extremely slow in bytecode. The .cds file has about 40Mb, and it takes about 0.5s to read it.
What's the rationale for re-reading debug infos every time instead of keeping it in memory?
If it's considered problematic to keep the data in RAM (esp. considering it can be so large), we could have at least have an option to do so, or maybe consider using a more compact representation for location information required for backtraces. Currently, we use debug events, which are much richer than what we need (only their ev_pos and ev_loc fields). We could project debug events to these two fields either upon reading the debugging info in backtrace.c, or maybe have this more compact data stored as a different section in the bytecode/.cds file to optimize reading it.
|Tags||No tags attached.|
|Indeed, I think keeping only the ev_pos and ev_loc of the "events" structure and keeping that in memory should be unproblematic. I had never noticed that event_for_location does a linear search in the event list, do you think that could also be a performance issue for backtrace-heavy applications?|
|The problem is addressed in the patch patch_backtraces.diff attached to 0005899.|
|2014-01-22 10:51||frisch||New Issue|
|2014-01-22 10:54||frisch||Summary||Very flow backtrace in bytecode : debug infos read from the filesystem everytime => Very slow backtraces in bytecode : debug infos read from the filesystem everytime|
|2014-01-22 10:54||frisch||Description Updated||View Revisions|
|2014-01-24 15:36||gasche||Note Added: 0010844|
|2014-03-28 10:45||frisch||Relationship added||related to 0005899|
|2014-03-28 10:46||frisch||Note Added: 0011124|
|Copyright © 2000 - 2011 MantisBT Group|