Skip to content

Question about Uniswap V2 swap (aot) low speed up #77

@jafar75

Description

@jafar75

Hi there,
Recently, I created an example of swap weth/usdc with a uniswap v2 pair. I compiled all the required contracts in build.rs and also I created related functions using extern_revmc!

I epxected a speed up of at least 3-4 times in compare with interpreter mode, but it only achieves about %20-30 speed up.
I shared the source code and appreciate any suggestion or fix, if I used the feature in a wrong way. Another thing I noticed, all examples (as benches) in repo, are related to contracts without any i/o and storage read. Maybe, this factor affect the performance, because in a swap of uni v2, it needs to fetch some data.

Note: I used cache db and provided a warm up stage, that all needed data were fetched and cahced into CacheDB.

impl link: https://github.com/jafar75/revmc/tree/main/examples/univ2_swap

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions