vazexqi / CodingSpectator

Watches and analyzes code edits in the Eclipse IDE non-invasively
http://codingspectator.cs.illinois.edu
Other
20 stars 14 forks source link

The replayer of CodingTracker is too slow #314

Closed reprogrammer closed 13 years ago

reprogrammer commented 13 years ago

I loaded the change sequence at cs-111/a59ed788-a72b-435a-b673-8b25e13e7e99/1.0.0.201105300951/codingtracker/codechanges.txt and left a break point at timestamp 1313081027570. Then, I replayed the sequence in "Fast" mode. It took about half an hour until CodingTracker failed by throwing an exception. I don't know how long it will take CodingTracker to reach my break point.

Even half an hour to reach a break point is too long. This long delay makes it impractical to replay CodingTracker change sequences.

Wanderer777 commented 13 years ago

@reprogrammer:

reprogrammer commented 13 years ago

@Wanderer777: What concrete actions are you going to take to increase the speed of replays? Are you going to implement the "jump to" action?

Wanderer777 commented 13 years ago

@reprogrammer: Yes, I am going to implement the "jump to" action, but first I will stop showing additional information during the fast replay (i.e. moving the current user operation in the sequences and displaying its details).

Wanderer777 commented 13 years ago

The previous commit adds the "jump to" action to the CodingTracker's replayer. To properly replay the operation sequence from the "jumped to" operation, make sure that the workspace is clean (e.g. click "Reset"). Also, do not jump inside operations that change the content of a conflict editor. Considering that such operations are very rare and you are interested in jumping to refactorings, this should not be a problem. Please let me know how it works out for you.

Wanderer777 commented 13 years ago

In the above commit I fixed the way in which the "jump to" action works. It needs to consider that in between the operation to which a user wants to jump and the actual operation to which the jump is going to happen (which is established as the earliest of the closest snapshots of the files edited after the given "jump to" operation) there could be other file editing operations, which require to establish their corresponding closest snapshot operations and so on. Therefore, CodingTracker establishes the right operation to safely jump to iteratively, i.e. until there are no editing operations without preceding file snapshot operations after this "jump to" operation. As a result, although correct, it could happen that the closest point CodingTracker can safely jump to is quite far from the actual operation a user is interested in. So, as I wrote above, the usefulness of this new feature will be highly dependent on a particular operation sequence and the operation to which a user wants to jump to.

Wanderer777 commented 13 years ago

Speaking about a way not to show Eclipse editors, I found that the easiest approach would be to minimize the window of the Eclipse instance that performs the replay. As a result, I measured an improvement in replay time of around 25% - 30%, which is significant. So, at the moment, the fastest possible replay looks like this:

  1. Jump as close as possible to the desired operation or start from the beginning if interested in replaying the whole sequence.
  2. Start replaying in the fast mode.
  3. Minimize Eclipse window.

To facilitate this approach, I will add a message box that notifies the user that the replay is over or reached a breakpoint, also displaying the replay time. But, the message box sometimes is not immediately visible if other windows are open, so periodically checking the status of the replay is still needed.