Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chifra export --traces doesn't check the cache without --cache_traces #2675

Closed
wakamex opened this issue Jan 12, 2023 · 4 comments
Closed

chifra export --traces doesn't check the cache without --cache_traces #2675

wakamex opened this issue Jan 12, 2023 · 4 comments

Comments

@wakamex
Copy link
Contributor

wakamex commented Jan 12, 2023

chifra export 0x422494292e7a9dda8778bb4ea05c2779a3d60f5d --traces --factory  1.69s user 0.21s system 2% cpu **1:17.35 total**
chifra export 0x422494292e7a9dda8778bb4ea05c2779a3d60f5d --traces --factory **--cache_traces**   0.34s user 0.10s system 113% cpu **0.390 total**

200x faster using --cache_traces (order doesn't matter)

as opposed to --logs, where without --cache, the cache is still read from, just not written to

chifra export 0x422494292e7a9dda8778bb4ea05c2779a3d60f5d --logs  0.63s user 0.24s system 127% cpu **0.678 total**
chifra export 0x422494292e7a9dda8778bb4ea05c2779a3d60f5d --logs **--cache**  0.75s user 0.32s system 132% cpu **0.805 total**

good first issue? 😀

@tjayrush
Copy link
Member

It's a bit surprising that it acts this way, to be honest.

The first command (--traces without --cache) should be faster than the second because my thought is that the second would be identical to the first with the added downside of writing the cache. That's odd.

The second example (for --logs) makes more sense.

So maybe we can do a test as follows:

time chifra monitors <address> --decache                         # clears the cache
time chifra export <address> --traces --factory                 # should run without writing the cache
time chifra export <address> --traces --factory --cache  # should run without writing the cache
time chifra export <address> --traces --factory                 # this run should be way faster
time chifra export <address> --traces --factory --cache  # this run should be identically as fast as the previous

The same should happen with --logs:

time chifra monitors <address> --decache     # clears the cache
time chifra export <address> --logs                 # should run without writing the cache
time chifra export <address> --logs --cache  # should run without writing the cache
time chifra export <address> --logs                 # this run should be way faster
time chifra export <address> --logs --cache  # this run should be identically as fast as the previous

@tjayrush
Copy link
Member

848 transactions in account 0x422494292e7a9dda8778bb4ea05c2779a3d60f5d

Run S Ms Tx / Sec Comments
clear cache...
--trace --factory 188s 480ms 4.50
--trace --factory --cache 196 390 4.32 slower when writing to cache (makes sense)
--trace --factory - 629 1,348.17 much faster when reading from cache (makes sense)
--trace --factory --cache - 781 1,085.79 slower when reading and writing (slightly strange)
clear cache...
--logs --cache 14 760 57.45
--logs --cache 10 250 82.73 faster when writing to cache (strange)
--logs --cache - 516 1,643.41 much faster when reading from cache (makes sense)
--logs --cache - 803 1,056.04 slower when reading and writing (slightly strange)

@tjayrush
Copy link
Member

good first issue? 😀

Maybe. When you say in the title of the issue that it "doesn't read the cache" is that because you looked at the code or just based on performance?

@tjayrush tjayrush changed the title --traces doesn't check the cache without --cache_traces chifra export --traces doesn't check the cache without --cache_traces Jan 23, 2023
tjayrush added a commit that referenced this issue Nov 23, 2023
@tjayrush
Copy link
Member

This is fixed.

tjayrush added a commit that referenced this issue Nov 23, 2023
…esnt-check-the-cache-without-cache_traces

Fixes issue #2675
tjayrush added a commit that referenced this issue Nov 25, 2023
* Fixes issue #3348

* Adds test case for using .eth in chifra state --call

* Fixes issue #3385

* Improved monitoring a bit

* Cleaning

* Renamed ContractCallArgument to ContractArgument

* Renamed ParseContractCall to ParseCall

* Renames ContractCallNumber tp ArgNumber

* Renames Boolean to ArgBool in parser package

* Renamed ContractCallHex to ArgHex

* Cleaning

* Separates out types in the parser package into their own files

* Cleaning to get started

* Hacky code to allow .eth addresses in chifra state --call

* Adds a few tests for allowing ens names where previously only hex addresses was permitted.

* Adds a new regex for EnsDomain to the lexer

* Adds ArgString to parser so we can explicitly Capture strings to ease debugging

* Implements using .eth names in chifra state --call

* Fixes unit tests (but maybe not correctly)

* Some cleaning to start

* Removes the need for the Etherescan key from simply running a command. Still need it for `chifra state --call` and `chifra export --accounting`

* Fixed call error messages

* Fixed names and comments

* Support subdomains

* Fixes issue #3376

* Fixes lint

* Allows hitting control+c when downloading timestamps

* Tries to grab control of logger.Fatal

* Closes the issue

* Fixes testing

* Allows use of --port for the time being until removed

* Fix/issue 2847 (#3403)

* Changes the word destination to abiMap to be more precise

* Removes unused automatation

* Sends rpc.Connection into NewAbisCache instead of just the chain

* Small cleanups

* Various changes to hide local functions and types into abi and artciulate packages

* Cleaning

* Cleaning

* Just a few cleanups trying to get control of articulation

* Improves articulation and warnings for non-cotracts

* Final cleanup still not done

* Cleaning one more time

* Fixing a latent bug in short circuit articulation

* Cleaning

* Further cleaning

* One more step

* Commenting

* Final changes for now. See the issue.

* Renames FunctionSyncMap to SelectorSyncMap to be more consistent

* Fixes an issue with tracing and export missing check for appropriate node

* Cleaning (#3407)

* Added appearance notification

* Fixed lint error

* Code review fixes

* Bugfix: scrape errors were silently ignored

* Updated tests

* Moved notification struct to pkg so it can be linked by other software

* Fixes issue #2675

* Adds (but does not implement) --reverted to chifra export

* Adds reverted and fourbyte filters to the AppearanceFilter structure

* Code review fixes

* Implements filtering on both four-byte and reverted status

* Fixes tests

* Adds but does not implement chifra status --diagnose

* Start with some test cases

* Removes unused minimal, nowrite, and noaddfld from auto-code gen

* Removes object field from auto-code gen. Pick it up from type

* Removes unused disp field from autogen files

* Remove example from auto code generation

* Removes unused array field from auto code generation

* Enables auto-gen for status and others

* Turns on statumetns auto-gen

* Comments out some references

* Merges develop branch

* Implements part of the issue. See TODOs

* Fixes tests

* Bumps version to v2.1.0-release

* Update CHANGES.md file. Ready to merge to master.

---------

Co-authored-by: Dawid Szlachta <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants