Giter VIP home page Giter VIP logo

cosmwasm's Introduction

cosmwasm's People

Contributors

0xekez avatar 170210 avatar alpe avatar assafmo avatar brew0722 avatar chipshort avatar da1suk8 avatar dandanlen avatar elfedy avatar emidev98 avatar ethanfrey avatar giansalex avatar hashedone avatar jawoznia avatar juggernaut09 avatar larry0x avatar loloicci avatar lukerhoads avatar maurolacy avatar mergify[bot] avatar neacsu avatar reuvenpo avatar rtviii avatar shiki-tak avatar ueco-jb avatar uint avatar webmaster128 avatar y-pakorn avatar yihuang avatar zemyblue avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cosmwasm's Issues

Improve ExceptionTable overhead

OOB, Unreachable, ... structure needed to handle various exceptions. {offset, exception_code}

After patching the dynamic bound limit in emit_memory_op, the CacheGen size of Singlepass is reduced by 1.37MB.

As the bound check code decreases, the write exception decreases, but it is about 4.8 times larger than the code size. I guess some Inefficiency here.

result of code analysis, The code offset range where the exception occurs is to insert 1 byte each. Therefore, the size of the code and the size of the exception table are proportional to some extent.

fn mark_range_with_exception_code<F: FnOnce(&mut Assembler) -> R, R>(
    a: &mut Assembler,
    etable: &mut ExceptionTable,
    code: ExceptionCode,
    f: F,
) -> R {
    let begin = a.get_offset().0;
    let ret = f(a);
    let end = a.get_offset().0;
    for i in begin..end {
        etable.offset_to_code.insert(i, code);
    }
    ret
}

[VM] cranelift does not yet support disable floating point

I found the description below in the enable_float option.
'Disabling use of floating-point instructions is not yet implemented.'

https://github.com/bytecodealliance/cranelift/blob/4afc658f4325f508e7dcc35d4050bff3aa444714/cranelift-codegen/meta/src/shared/settings.rs#L71

Unable to disable floating point causes non-deterministic problem.
It is necessary to understand the actual implementation in version 0.59.0 and the implementation situation in version 0.59.0 later.

[VM] Separate thread of instance destruction

image

After the module cached, 'drop' remains the biggest overhead.

From drop_in_place, it is released according to the implementation of rust lang, so it is difficult to accurately estimate which object is the overhead caused by dropping it from the profile alone.

However, looking at wasmer_runtime_core::sys::unix::memory::...drop in the middle, it is presumed that the largest occurrence occurs when the vm memory area held by the instance object is destroyed.

let res = call_handle_raw(&mut instance, params, msg);
    *gas_used = instance.create_gas_report().used_internally;
    
    instance.recycle();
    Ok(res?)

In the do_handle of go-cosmwasm, the instance created every time is sync destruction.
The function recycle is called, but in reality it is not recycled. so directly destroyed.

So, I thought that if instance destruction (deallocation) was handled in a separate thread, the above overhead could be eliminated further.

Remove `Response` using `Adjacently tag`

It seems for us to be able to use the Adjacently tag and the deserializer of derive


I wonder why this uses a manually implemented deserializer rather than use derive as follows.

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(untagged)]
pub enum Token {
    FT(FungibleToken),
    NFT(NonFungibleToken),
}

Additionally, using Adjacently tag, seems to be able to reduce the depth of response struct.

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(tag = "type", content = "value")]
pub enum Token {
    #[serde(rename = "collection/FT")]
    FT(FungibleToken),
    #[serde(rename = "collection/NFT")]
    NFT(NonFungibleToken),
}

let res = serde_json::from_str::<Vec<Token>>(json);

but we can discuss reducing depth on another issue.

Originally posted by @whylee259 in #35 (comment)

Measure CosmWasm 0.13.0 performance

The reason why the read_region patch was needed, the present situation of having a large minimum to maximum performance range(0.10.0), should be reproduced in the latest version(0.13.0).

cosmos-sdk is linked to the 0.40.0 stargate version, so script porting is required.

The strategy of versioning and update commit

As our vm repositories are forked from CosmWasm's one, we have to organize the strategy of versioning and update commit.

The current repos as follows.

  • line/link-modules
  • line/wasmvm
  • line/cosmwasm
  • line/wasmer

The versioning rules, we can think about as following two.

  • Do we have our own versioning rule?
    • It is suitable to apply semantic versioning and conventional commit.
    • Not intuitively to know the upstream version
    • Are we in a step to maintain it independent of the upstream repo?
  • Do we use as subversion of the upstream version?
    e.g.) 0.12.0-0.0.1
    • It is not the semantic versioning rule.
    • intuitively to know the upstream version
    • Do you need to know the upstream version frequently?

The update commit rules as follows.

  • keep upstream commits
    • we can keep upstream commits on our repo.
    • verbose (CosmWasm/cosmwasm does create a merge commit for PR)
  • squash commit

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.