[package] name = "dht-crawler" version = "0.0.1" edition = "2021" authors = ["桥下红药 <1121744186@qq.com>"] description = "高性能的 Rust DHT(分布式哈希表)爬虫库,用于爬取 BitTorrent DHT 网络中的种子信息" license = "MIT" documentation = "https://docs.rs/dht-crawler" keywords = ["dht", "bittorrent", "crawler", "p2p", "torrent", "metadata"] categories = ["network-programming", "asynchronous"] readme = "README.md" [lib] name = "dht_crawler" path = "src/lib.rs" [dependencies] tokio = { version = "1.35", features = ["full"] } serde = { version = "1.0", features = ["derive"] } serde_bencode = "0.2" sha1 = "0.10" hex = "0.4" rand = "0.8" log = "0.4" thiserror = "1.0" socket2 = { version = "0.5", features = ["all"] } rbit = "0.1" bytes = "1.0" bloomfilter = "1.0" ahash = "0.8" serde_bytes = "0.11.19" mimalloc = { version = "0.1", optional = true } [dev-dependencies] tracing-subscriber = { version = "0.3", features = ["env-filter", "fmt"] } [features] default = [] mimalloc = ["dep:mimalloc"] [[example]] name = "dht_crawler_example" path = "examples/main.rs" # ==================== 性能优化配置 ==================== [profile.release] opt-level = 3 # 最高优化级别 lto = "fat" # 链接时优化(LTO)- 显著提升性能 codegen-units = 1 # 单编译单元 - 更好的优化但编译慢 panic = "abort" # panic时直接终止 - 减少二进制大小 strip = true # 移除调试符号 - 减小二进制 # 开发时快速编译 [profile.dev] opt-level = 0 debug = true