Hi, Vincent,
I believe most of your questions are answered in the jira issue I've
mentioned, specifically in the attached comment that includes screenshots:
https://jira.xwiki.org/browse/XWIKI-14578?focusedCommentId=95833&page=c…
The default is the new code viewer. You have to click a button to get the
blame view, so that's not by default.
In terms of performance, yes, there is an obvious penalty, but only when
loading the blame view. The blame view navigates through all the revisions
of a document, incrementally building the annotated data (line-by-line). We
can limit how far back in the revisions it should drill down to (as it is
done in the blame API example, to the last 10 revisions), but that would
produce suboptimal results IMO and, since it's an explicit user-requested
action, I believe it's worth the penalty.
In terms of numbers, I've used 2 older pages to test it out using the
?debug=true parameter and looking at the time (ms) spent on code.vm on the
server side.
http://platform.xwiki.org/xwiki/bin/view/Features/XWikiRESTfulAPI
* 1255 lines
* 132 versions
* No caching, just after wiki restart, browser cache refresh: 3912
* Just browser cache refresh: 2884, 2586, 2756, 2466
* Caches enabled, simple browser refresh: 2183, 2065, 2057, 2112, 2209, 2082
http://platform.xwiki.org/xwiki/bin/view/Features/PageEditing
* 212 lines
* 332 versions
* No caching, just after wiki restart, browser cache refresh: 2158
* Just browser cache refresh: 1542, 1419 ,1322, 1131, 1445
* Caches enabled, simple browser refresh: 1048, 1165, 1025, 1100
The versions number includes minor versions.
These documents are either large or have many revisions, so the numbers
should be good enough to make an approximation on real-world waiting times
to compute the blame. AFAICT, the number of lines has a bigger hit on
performance than the revisions have.
Thanks,
Eduard
On Wed, Aug 2, 2017 at 1:28 PM, Vincent Massol <vincent(a)massol.net> wrote:
Hi Edy,
Actually I have some additional questions:
* How well does it perform? Imagine that there’s a 300 lines document and
300 revisions, each one changing one line from the document. How long does
it take to display the blame view?
* AFAIK our JRCS API is not very performant and thus I’m worried about
performance.
* I can imagine 2 things to help with this:
** 1) Do not display the blame view by default when going to the source
view (let the user click a “show blame view” button)
** 2) Use a progress bar to compute the blame UI. I hope that the Java API
has provision for this.
WDYT? Could you share with us some stats on performance?
Thanks
-Vincent
On 1 Aug 2017, at 14:57, Eduard Moraru
<enygma2002(a)gmail.com> wrote:
Hi, devs,
During a hackathon session, I have done a refresh on XWiki's code viewer
("code.vm") and integrated the Blame API [1] developed by Denis to add
line-by-line blame information, just like GitHub's blame feature.
Please see the associated Jira issue that also includes before and after
screenshots:
https://jira.xwiki.org/browse/XWIKI-14578
The Blame API module is a commons module since 2014 but not bundled
neither
in the WAR nor in the flavor, so, in order to go
along and merge my work,
I'd need it to be available as a core extension (to be also usable by
code.vm).
I have not studied it deeply, but the module seems to be doing its job
well
and the result is very nice and it is very
generic.
Being able to perform a blame analysis builds upon the diff module and
both
are features of XWiki's versioning
capabilities, so, IMO, both should be
considered core extensions (and not only the diff module, which already
is
core).
The PR is available at
https://github.com/xwiki/xwiki-platform/pull/605
Here is my (obvious) +1 to bundle the blame-api and merge the PR which
includes the UI.
Thanks,
Eduard
----------
[1]
http://extensions.xwiki.org/xwiki/bin/view/Extension/Blame%20Module