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

fix: test-account negative index did not refer to correct account #2444

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

antazoey
Copy link
Member

@antazoey antazoey commented Dec 23, 2024

fixes an issue where negative indices could get cached thus causing them to no longer refer to their calculated index.
also fixes the performance of the repr methods in both account managers, as it was very slow with some experimental account plugins installed.

basically just a bunch of fixes to test-accounts that i found when working on the new ape-titanoboa plugin.

fixes: #2436
Fixes: APE-1865

BEFORE:

In [1]: %time accounts.test_accounts
Wall time: 17.1 ms
Wall time: 10 μs

In [1]: %time accounts.test_accounts[5]
Wall time: 329 ms
Wall time: 30 μs

In [1]: %time accounts.test_accounts[0].address
Wall time: 344 ms
Wall time: 250 μs


AFTER:

In [1]: %time accounts.test_accounts
Wall time: 10.4 ms
Wall time: 7.87 μs

In [1]: %time accounts.test_accounts[5]
Wall time: 335 ms
Wall time: 34.1 μs

In [1]: %time accounts.test_accounts[0].address
Wall time: 325 ms
Wall time: 38.9 μs

@antazoey antazoey force-pushed the perf/test-accounts branch from 9cfc122 to 310174e Compare January 7, 2025 00:43
@antazoey antazoey changed the title perf: test accounts __repr__ and some refactoring of generated accounts perf: __repr__ can be unnecessarily slow on AccountManager Jan 7, 2025
@antazoey antazoey force-pushed the perf/test-accounts branch from 3e2f68d to 34bd7f4 Compare January 7, 2025 01:02
@antazoey antazoey changed the title perf: __repr__ can be unnecessarily slow on AccountManager fix: test-account negative index were misplaced after creating more accounts Jan 7, 2025
@antazoey antazoey changed the title fix: test-account negative index were misplaced after creating more accounts fix: test-account negative index did not refer to correct account Jan 7, 2025
@antazoey antazoey force-pushed the perf/test-accounts branch from 34bd7f4 to 4257c8c Compare January 9, 2025 23:43
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.

Improve performance of accounts.test_accounts
1 participant