Skip to content
This repository was archived by the owner on Dec 29, 2021. It is now read-only.
This repository was archived by the owner on Dec 29, 2021. It is now read-only.

Takes ~300ms to run 1 invocation #100

Closed

Description

@rcoh
  • assert_cli version: 0.5
  • Rust version: 1.25.0
  • OS and version: Ubuntu 16.04
    Unfortunately, cargo run takes at minimum about 300ms on my computer:
➜  angle-grinder git:(master) ✗ time cargo run --bin agrind -- '* | json | count' --file test_files/empty
    Finished dev [unoptimized + debuginfo] target(s) in 0.0 secs
     Running `target/debug/agrind '* | json | count' --file test_files/empty`
No data
cargo run --bin agrind -- '* | json | count' --file test_files/empty  0.22s user 0.06s system 92% cpu 0.307 total

It makes it impractical to run hundreds of integration tests with assert_cli.

I'm not positive what a better way would be -- I guess running the binary in dist directly if it exists?

Activity

  1. killercup commented on Apr 7, 2018

    @killercup
    Collaborator

    Hm, indeed. cargo run adds ~300ms overhead on my machine as well (on macOS). That's quite unfortunate! Executing the binary directly takes less than 1ms, though, so making sure everything is compiled correctly and then executing with the then-known path should be a good workaround.

    We should absolutely add this to the docs. And I'll ask the cargo team if there is a way to use cargo's "find binary" feature without having it check if it needs to compile things (which I guess is what's taking so long -- --locked --frozen doesn't speed things up).

  2. epage commented on Apr 7, 2018

    @epage
    Collaborator

    We should absolutely add this to the docs. And I'll ask the cargo team if there is a way to use cargo's "find binary" feature without having it check if it needs to compile things

    Another use case for such a feature is packaging. Looking into this is coming up on my plate for packaging.

  3. killercup commented on Apr 7, 2018

    @killercup
    Collaborator
  4. added a commit that references this issue on May 25, 2018
  5. epage commented on May 29, 2018

    @epage
    Collaborator

    The responsibility for this is moving to assert_cmd and tis will be addressed in assert-rs/assert_cmd#6

    assert_cli is going to morph into a wider-focused tool, including things like assert_fs. See #41

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions