Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

chore(rome_*):reduce parking_lot usage #2818

Closed

Conversation

IWANABETHATGUY
Copy link
Contributor

@IWANABETHATGUY IWANABETHATGUY commented Jul 5, 2022

Summary

  1. Since we have upgraded rust-toolchain to 1.62.0 stable which has been stabilized the new Mutex api.
    Also, it is faster than parking_lot in Linux platform https://blog.rust-lang.org/2022/06/30/Rust-1.62.0.html#thinner-faster-mutexes-on-linux.
    So, we could reduce the parking-lot crate usage to speed up our compile-time a little.

Test Plan

  1. cargo test

@xunilrj
Copy link
Contributor

xunilrj commented Jul 5, 2022

Will be interesting to see the differences.

@IWANABETHATGUY
Copy link
Contributor Author

I don't benchmark this pull request, You could see the detailed benchmark made by rust core team rust-lang/rust#95035 (comment)

@IWANABETHATGUY
Copy link
Contributor Author

This pull request more likely to be a compile-time improvement

@IWANABETHATGUY IWANABETHATGUY marked this pull request as ready for review July 5, 2022 14:12
Copy link
Contributor

@ematipico ematipico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know it's annoying, but each unwrap should be documented with a // SAFETY comment

crates/rome_js_formatter/Cargo.toml Outdated Show resolved Hide resolved
@IWANABETHATGUY
Copy link
Contributor Author

The const constructor of {Mutex, Condvar, RwLock} would be stable until 1.63, https://github.com/rust-lang/rust/pull/97791/files#diff-3ec0c54e5f945521d425d023283b935edaa5c16fe7e2c0f675b07f35e65f639bR125, So i am going to close this pr for now

@IWANABETHATGUY IWANABETHATGUY deleted the chore/reduce-parking-lot branch July 6, 2022 07:51
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants