-
Notifications
You must be signed in to change notification settings - Fork 9
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
NDEV-2043: Improve performance of neon-api crate #158
Conversation
0989ceb
to
42098a4
Compare
1d83a33
to
84c22a0
Compare
The problem about using actix-web is that we cannot use |
@Denommus Yes, you are right, but we are not using it anywhere anymore. This was the purpose of this PR, converting blocking contexts where async functions need to be executed into async contexts themselves. |
f9c157c
to
593b226
Compare
254301c
to
f241842
Compare
f241842
to
1515a06
Compare
93c9e2d
to
cbcdd4a
Compare
In I don't like that we have diffirent tools to do the same. |
822ac51
to
b04820f
Compare
88a25cb
to
5303cf6
Compare
@anton-lisanin I replaced all usages of |
|
The main purpose of this PR is to remove usages of [`block_in_place`](https://docs.rs/tokio/latest/tokio/task/fn.block_in_place.html) and to re-use the same code in both an async (`neon-api`) and non-async (`evm-loader`) context. - Replaced `#[cfg(feature = "tracing")]` with `#[cfg(target_os = "solana")]` and extended its usage to: - code from `evm-loader` crate used only as a library (`#[cfg(not(target_os = "solana")]`); - code from `evm-loader` crate used only as part of a Solana program (`#[cfg(target_os = "solana")]`). - Replaced [`axum`](https://github.com/tokio-rs/axum) with [`actix-web`](https://github.com/actix/actix-web), because most of the `evm-loader` crate is based on non-`Send` types and [`actix-web`](https://github.com/actix/actix-web) is a web framework which does not require `Future`s to be `Send`. Inspired from #107. - Used [`maybe_async`](https://github.com/fMeow/maybe-async-rs) crate to re-write common parts of `evm-loader` crate used both as an async library and as a non-async Solana program. This also removed all usages of [`block_in_place`](https://docs.rs/tokio/latest/tokio/task/fn.block_in_place.html). - Simplified all types related to multi-threading in the context of non-`Send` `Future`s: less `Arc`s, less `RwLock`s.
The main purpose of this PR is to remove usages of [`block_in_place`](https://docs.rs/tokio/latest/tokio/task/fn.block_in_place.html) and to re-use the same code in both an async (`neon-api`) and non-async (`evm-loader`) context. - Replaced `#[cfg(feature = "tracing")]` with `#[cfg(target_os = "solana")]` and extended its usage to: - code from `evm-loader` crate used only as a library (`#[cfg(not(target_os = "solana")]`); - code from `evm-loader` crate used only as part of a Solana program (`#[cfg(target_os = "solana")]`). - Replaced [`axum`](https://github.com/tokio-rs/axum) with [`actix-web`](https://github.com/actix/actix-web), because most of the `evm-loader` crate is based on non-`Send` types and [`actix-web`](https://github.com/actix/actix-web) is a web framework which does not require `Future`s to be `Send`. Inspired from #107. - Used [`maybe_async`](https://github.com/fMeow/maybe-async-rs) crate to re-write common parts of `evm-loader` crate used both as an async library and as a non-async Solana program. This also removed all usages of [`block_in_place`](https://docs.rs/tokio/latest/tokio/task/fn.block_in_place.html). - Simplified all types related to multi-threading in the context of non-`Send` `Future`s: less `Arc`s, less `RwLock`s.
The main purpose of this PR is to remove usages of [`block_in_place`](https://docs.rs/tokio/latest/tokio/task/fn.block_in_place.html) and to re-use the same code in both an async (`neon-api`) and non-async (`evm-loader`) context. - Replaced `#[cfg(feature = "tracing")]` with `#[cfg(target_os = "solana")]` and extended its usage to: - code from `evm-loader` crate used only as a library (`#[cfg(not(target_os = "solana")]`); - code from `evm-loader` crate used only as part of a Solana program (`#[cfg(target_os = "solana")]`). - Replaced [`axum`](https://github.com/tokio-rs/axum) with [`actix-web`](https://github.com/actix/actix-web), because most of the `evm-loader` crate is based on non-`Send` types and [`actix-web`](https://github.com/actix/actix-web) is a web framework which does not require `Future`s to be `Send`. Inspired from #107. - Used [`maybe_async`](https://github.com/fMeow/maybe-async-rs) crate to re-write common parts of `evm-loader` crate used both as an async library and as a non-async Solana program. This also removed all usages of [`block_in_place`](https://docs.rs/tokio/latest/tokio/task/fn.block_in_place.html). - Simplified all types related to multi-threading in the context of non-`Send` `Future`s: less `Arc`s, less `RwLock`s.
The main purpose of this PR is to remove usages of [`block_in_place`](https://docs.rs/tokio/latest/tokio/task/fn.block_in_place.html) and to re-use the same code in both an async (`neon-api`) and non-async (`evm-loader`) context. - Replaced `#[cfg(feature = "tracing")]` with `#[cfg(target_os = "solana")]` and extended its usage to: - code from `evm-loader` crate used only as a library (`#[cfg(not(target_os = "solana")]`); - code from `evm-loader` crate used only as part of a Solana program (`#[cfg(target_os = "solana")]`). - Replaced [`axum`](https://github.com/tokio-rs/axum) with [`actix-web`](https://github.com/actix/actix-web), because most of the `evm-loader` crate is based on non-`Send` types and [`actix-web`](https://github.com/actix/actix-web) is a web framework which does not require `Future`s to be `Send`. Inspired from #107. - Used [`maybe_async`](https://github.com/fMeow/maybe-async-rs) crate to re-write common parts of `evm-loader` crate used both as an async library and as a non-async Solana program. This also removed all usages of [`block_in_place`](https://docs.rs/tokio/latest/tokio/task/fn.block_in_place.html). - Simplified all types related to multi-threading in the context of non-`Send` `Future`s: less `Arc`s, less `RwLock`s.
The main purpose of this PR is to remove usages of
block_in_place
and to re-use the same code in both an async (neon-api
) and non-async (evm-loader
) context.#[cfg(feature = "tracing")]
with#[cfg(target_os = "solana")]
and extended its usage to:evm-loader
crate used only as a library (#[cfg(not(target_os = "solana")]
);evm-loader
crate used only as part of a Solana program (#[cfg(target_os = "solana")]
).axum
withactix-web
, because most of theevm-loader
crate is based on non-Send
types andactix-web
is a web framework which does not requireFuture
s to beSend
. Inspired from Convert (most) of neon-lib to async #107.maybe_async
crate to re-write common parts ofevm-loader
crate used both as an async library and as a non-async Solana program. This also removed all usages ofblock_in_place
.Send
Future
s: lessArc
s, lessRwLock
s.