Skip to content
This repository was archived by the owner on Aug 23, 2020. It is now read-only.

Ability to toggle cache on/off#1706

Open
acha-bill wants to merge 2 commits into
iotaledger-archive:cachefrom
acha-bill:cache-benchmark
Open

Ability to toggle cache on/off#1706
acha-bill wants to merge 2 commits into
iotaledger-archive:cachefrom
acha-bill:cache-benchmark

Conversation

@acha-bill

Copy link
Copy Markdown
Contributor

Description

Because we want to run JMH tests in cache on/off states, we need to check if cache is null for when it's off.

Type of change

  • Enhancement (a non-breaking change which adds functionality)

How Has This Been Tested?

  • Existing unit tests pass

Checklist:

  • My code follows the style guidelines for this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas

@acha-bill acha-bill changed the title Cache benchmark Ability to toggle cache on/off Jan 12, 2020

Cache<Indexable, TransactionViewModel> cache = tangle.getCache(TransactionViewModel.class);
if (cache != null) {
if (cache.get(hash) == null) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

import com.iota.iri.model.persistables.ObsoleteTag;
import com.iota.iri.model.persistables.Tag;
import com.iota.iri.model.persistables.Transaction;
import com.iota.iri.model.persistables.*;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

import java.util.HashMap;
import java.util.HashSet;

import org.junit.*;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines +100 to +102
if (cache == null) {
return true;
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So store doesn't do anything?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants