near / nearcore

Reference client for NEAR Protocol
https://near.org
GNU General Public License v3.0
2.31k stars 618 forks source link

Investigating the bottleneck in `compile_and_load()` #10775

Open akhi3030 opened 7 months ago

akhi3030 commented 7 months ago

Zulip discussion: https://near.zulipchat.com/#narrow/stream/295306-contract-runtime/topic/bottleneck.20on.20compile_and_load

In this example we see that from time to time, compile_and_load takes a long time (44.8ms). This issue is to investigate where the time is going.

Based on the spans that are available, it seems like the bulk of the time is being spent here. In production code, the cache is a handle to rocksdb so we suspect that the time is spent loading the serialized module from rocksdb.

akhi3030 commented 7 months ago

Current summary:

akhi3030 commented 7 months ago

Action items from the meeting:

akhi3030 commented 6 months ago

Summary of the meeting:

@nagisa: continue working on https://github.com/near/nearcore/pull/10787 @Ekleog-NEAR: work on https://github.com/near/nearcore/issues/10801 @akashin: It seems like https://github.com/near/nearcore/issues/8806 in general is going to be too complex a implementation to land. So we are now considering reducing gas costs directly. Hence, he will investigate the impact of reducing the gas costs and prototyping introducing compute costs just for function calls.