Skip to content

Conversation

@OriolMunoz-da
Copy link
Contributor

Quick & dirty, but good enough to test locally

Signed-off-by: Oriol Muñoz <[email protected]>
Signed-off-by: Oriol Muñoz <[email protected]>
Signed-off-by: Oriol Muñoz <[email protected]>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

ignore this file for now

Copy link
Contributor Author

Choose a reason for hiding this comment

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

downloads 1h worth of mainnet updates and dumps it into a file, to be loaded in the test above

.readString(dumpFile)
.replace( // TODO: maybe just use the store with dsoParty=mainnet's
"DSO::1220b1431ef217342db44d516bb9befde802be7d8899637d290895fa58880f19accc",
dsoParty.toProtoPrimitive,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

every test uses its own dsoParty... see TODO

store.multiDomainAcsStore.ingestionSink.initialize().futureValue
val timings = mutable.ListBuffer[Long]()
val ingestionConfig = IngestionConfig()
val dumpFile = Paths.get("/home/oriolmunoz/mainnetdump/update_history_response.json")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this dump is 1h of mainnet updates (see next file for how it was obtained).
It should be okay, because:

  • Any (filtered-in) create causes an insert
  • Any archive causes a delete, so as long as the template is included in the filter
  • Txlog doens't care about whether the contract ids involved are present in the ACS store or not

@OriolMunoz-da
Copy link
Contributor Author

@rautenrieth-da can I ask you to verify that what I did is not nonsense? Ignore the fact it's quick & dirty, just trying to make sure that I'm not missing something important here.
So far I know I'm gonna need to measure ingestion of ACS & txlog separetely inside the store, to see where most of the time is spent (current suspicion being txlog, as it's not batched)

val duration = after - before
timings ++= Seq.fill(batch.length)(duration / batch.length)
val avg = timings.sum.toDouble / timings.size
println(
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this wait for the output to be flushed? If yes, it could add significant overhead, consider only printing at the end or only once every N iterations.

store.multiDomainAcsStore.ingestionSink
.ingestUpdateBatch(
NonEmptyList.fromListUnsafe(
txs
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't this ingesting the whole txs list in each iteration? Shouldn't it use batch instead? I'm surprised nothing explodes when we reingest the same transactions over and over.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

🤦 I'm surprised my performance was not god-awful

Copy link
Contributor

Choose a reason for hiding this comment

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

It was probably fine because the first iteration did a lot of work, and all other iterations were no-ops due to the last ingested offset guard.

Signed-off-by: Oriol Muñoz <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants