bonsai url highlighting is painful for bonsai, gecko, os

RESOLVED WONTFIX

Status

Socorro
General
--
enhancement
RESOLVED WONTFIX
10 years ago
6 years ago

People

(Reporter: timeless, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(URL)

(Reporter)

Description

10 years ago
Frame 	Signature 	Source
0 	syncJournal 	mozilla/db/sqlite3/src/sqlite3.c:23118
1 	sqlite3PagerCommitPhaseOne 	mozilla/db/sqlite3/src/sqlite3.c:24832
2 	sqlite3BtreeCommitPhaseOne 	mozilla/db/sqlite3/src/sqlite3.c:28730
3 	vdbeCommit 	mozilla/db/sqlite3/src/sqlite3.c:35585
4 	sqlite3VdbeHalt 	mozilla/db/sqlite3/src/sqlite3.c:35902
5 	sqlite3VdbeExec 	mozilla/db/sqlite3/src/sqlite3.c:40272
6 	sqlite3Step 	mozilla/db/sqlite3/src/sqlite3.c:37032
7 	sqlite3_step 	mozilla/db/sqlite3/src/sqlite3.c:37099
8 	sqlite3_exec 	mozilla/db/sqlite3/src/sqlite3.c:55877
9 	mozStorageConnection::ExecuteSimpleSQL(nsACString_internal const&) 	mozilla/storage/src/mozStorageConnection.cpp:300

even though the first 9 frames seem to have the same file, they're all distinct urls, this is very expensive for bonsai. ted notes that the code is currently generating simple incremental stacks, which is fine, but unfortunately this distinct mark format is bad for browsers. because each of those 9 links to mozilla/db/sqlite3/src/sqlite3.c are distinct pages.

instead, i'd suggest the following:

the goal is to get the crash stacks to generate a single bonsai url per file and list all the &mark=23118,24832,28730,35585,...

where each line has a different #hash part but the same url
this would enable the browser to cache the document.

whereas today each link is to a different page.

because everything is built row at a time based on a preset string
... like "http://bonsai...%(file)s&rev=%(rev)s&mark=%(line)d#%(line)d" ...
where the format in the vars

a better approach is to create a hash:
hash[filepath]={url:"",filenumber:undefined}

if a filepath isn't in the hash, generate the default url (minus the #%(line)d part), and store
hash[filepath].url=url
hash[filepath].filenumber=++filenumber

then write out a link <a class="f%(filenumber)d" href="%(url)s#%(line)d">

if a file is in the hash, update it:
hash[filepath].newurl ||= hash[filepath].url;
hash[filepath].newurl +=",%(line)d";

but write out <a class="f%(filenumber)d" href="%(url)s#%(line)d">
where url is the original url.

(so far we are not correcting the url, the mark will be to the top frame's line, which is more valuable)

at the end of the stack block, write out a table of links using newurl. followed by js which gets elements by classname and changes the urls to the newurls (and have it hide the block) - in the noscript case, the user gets better urls here, in the script case, then they'll be rewritten and displayed inline.
Doesn't really matter, since for 1.9.1 and newer we're linking to hgweb blame which doesn't have highlight. Not worth spending time on.
Status: NEW → RESOLVED
Last Resolved: 8 years ago
Resolution: --- → WONTFIX
(Assignee)

Updated

6 years ago
Component: Socorro → General
Product: Webtools → Socorro
You need to log in before you can comment on or make changes to this bug.