GetRevisionActions: Remove ETag

The computation of the ETag takes as long as doing the real computation.
This defeats the purpose of using ETags, hence rather drop it. This cuts
the execution time by half for cases where the ETag didn't match
(because instead of computing the ETag and the actual value, we now only
need to compute the actual value). For cases where the ETag matched the
execution time should roughly stay the same (instead of the ETag we now
compute the actual value, but this should take the same amount of time).

Keep the etag() method on the RevisionApi interface to not break
implementors of this interface.

Signed-off-by: Edwin Kempin <ekempin@google.com>
Change-Id: Ia3db97037755fc364af4d1cb8fef94bb1e69fb5a
This commit is contained in:
Edwin Kempin
2021-01-15 14:02:24 +01:00
parent 4cd6ad5714
commit 8103d8109a
4 changed files with 4 additions and 207 deletions

View File

@@ -106,7 +106,7 @@ import java.util.Set;
import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.revwalk.RevWalk;
class RevisionApiImpl implements RevisionApi {
class RevisionApiImpl extends RevisionApi.NotImplemented {
interface Factory {
RevisionApiImpl create(RevisionResource r);
}
@@ -686,11 +686,6 @@ class RevisionApiImpl implements RevisionApi {
}
}
@Override
public String etag() throws RestApiException {
return revisionActions.getETag(revision);
}
@Override
public BinaryResult getArchive(ArchiveFormat format) throws RestApiException {
GetArchive getArchive = getArchiveProvider.get();