├── .gitignore ├── Cargo.toml ├── justfile ├── readme.md ├── result_ref.txt ├── examples └── generate.rs ├── src └── main.rs └── Cargo.lock /.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | /measurements.txt 3 | /perf.data 4 | /perf.data.old 5 | /flamegraph.svg 6 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "one-billion-row-challenge" 3 | version = "0.1.0" 4 | edition = "2021" 5 | default-run = "one-billion-row-challenge" 6 | 7 | [profile.release] 8 | lto = "thin" 9 | debug = true 10 | incremental = true 11 | 12 | [dependencies] 13 | assert2 = "0.3.11" 14 | clap = "4.4.14" 15 | colored = "2.1.0" 16 | fxhash = "0.2.1" 17 | memmap2 = "0.9.3" 18 | ptr_hash = { git = "https://github.com/ragnargrootkoerkamp/ptrhash", default_features = false } 19 | 20 | [dev-dependencies] 21 | anyhow = "1.0.79" 22 | rand = "0.8.5" 23 | rand_distr = "0.4.3" 24 | 25 | [features] 26 | no_pdep = [] 27 | -------------------------------------------------------------------------------- /justfile: -------------------------------------------------------------------------------- 1 | run *args: 2 | cargo run -r --quiet -- {{args}} 3 | large *args: 4 | cargo run -r --quiet -- measurements3.txt {{args}} 5 | time *args: 6 | cargo build -r --quiet && time ./target/release/one-billion-row-challenge {{args}} 7 | small: 8 | cargo run --quiet -- measurements-small.txt 9 | flame: 10 | cargo flamegraph --open 11 | stat *args: 12 | cargo build -r --quiet 13 | perf stat cargo run -r --quiet -- {{args}} 14 | record: 15 | cargo build -r --quiet 16 | perf record cargo run -r 17 | report: 18 | perf report 19 | 20 | test *args: 21 | cargo test --quiet -- {{args}} 22 | 23 | verify: 24 | cargo run -r --quiet -- --print > result.txt && diff result.txt result_ref.txt 25 | 26 | wverify: 27 | cargo run -r --quiet -- --print > result.txt && wdiff result.txt result_ref.txt 28 | 29 | cpu-slow: 30 | sudo cpupower frequency-set --governor performance -d 0.6GHz -u 3.6GHz > /dev/null 31 | cpu-fast: 32 | sudo cpupower frequency-set --governor performance -d 0.6GHz -u 4.6GHz > /dev/null 33 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # One Billion Row Challenge 2 | 3 | See [here](https://www.morling.dev/blog/one-billion-row-challenge/) for the 4 | original description of this challenge. 5 | 6 | I wrote a blog post explaining my ideas at https://curiouscoding.nl/posts/1brc . 7 | 8 | Note that I do make some assumptions: 9 | - Lines in the input are at most 33 characters, including the newline. 10 | - City names are uniquely determined by their first and last 8 characters. 11 | - Each input line contains a city drawn uniform random from the set of available cities. 12 | 13 | On my `i7-10750H CPU` running at `4.6GHz`, this results in: 14 | - 5.72s wall time on a single thread. 15 | - 1.01s wall time on 12 threads on 6 cores. 16 | 17 | 18 | ## While you're here 19 | The `justfile` contains some often used commands that can be run using [`just`](https://github.com/casey/just). 20 | 21 | For this project, I wrote a small shell 22 | [`just-shell`](https://github.com/RagnarGrootKoerkamp/just-shell) to 23 | conveniently run `just` commands. It has super aggressive auto-completion, which 24 | makes running a small set of commands very convenient. 25 | -------------------------------------------------------------------------------- /result_ref.txt: -------------------------------------------------------------------------------- 1 | {Abha=-37.5/18.0/69.9, Abidjan=-30.0/26.0/78.1, Abéché=-23.6/29.4/81.0, Accra=-23.1/26.4/75.5, Addis Ababa=-32.0/16.0/64.7, Adelaide=-32.4/17.3/68.9, Aden=-20.3/29.1/79.2, Ahvaz=-24.5/25.4/73.9, Albuquerque=-33.6/14.0/63.6, Alexandra=-40.0/11.0/62.4, Alexandria=-31.4/20.0/71.3, Algiers=-31.7/18.2/67.8, Alice Springs=-29.4/21.0/68.3, Almaty=-37.6/10.0/61.2, Amsterdam=-40.0/10.2/62.6, Anadyr=-58.4/-6.9/39.3, Anchorage=-48.0/2.8/55.8, Andorra la Vella=-46.1/9.8/60.1, Ankara=-36.5/12.0/60.4, Antananarivo=-35.1/17.9/70.6, Antsiranana=-24.4/25.2/74.3, Arkhangelsk=-50.0/1.3/50.3, Ashgabat=-35.6/17.1/71.5, Asmara=-31.7/15.6/68.4, Assab=-18.4/30.5/79.9, Astana=-45.9/3.5/53.3, Athens=-33.5/19.2/70.8, Atlanta=-37.2/17.0/67.1, Auckland=-33.5/15.2/63.1, Austin=-32.7/20.7/72.5, Baghdad=-27.6/22.8/72.4, Baguio=-27.4/19.5/69.7, Baku=-34.5/15.1/64.1, Baltimore=-37.6/13.1/61.0, Bamako=-20.5/27.8/82.7, Bangkok=-19.5/28.6/77.9, Bangui=-23.7/26.0/77.4, Banjul=-23.0/26.0/78.2, Barcelona=-34.7/18.2/68.5, Bata=-27.9/25.1/75.4, Batumi=-37.4/14.0/65.5, Beijing=-36.3/12.9/65.0, Beirut=-26.6/20.9/69.9, Belgrade=-35.7/12.5/67.1, Belize City=-21.4/26.7/74.8, Benghazi=-29.0/19.9/68.5, Bergen=-44.4/7.7/57.0, Berlin=-39.8/10.3/64.8, Bilbao=-36.6/14.7/60.6, Birao=-22.7/26.5/80.4, Bishkek=-36.1/11.3/60.7, Bissau=-22.1/27.0/78.0, Blantyre=-36.0/22.2/81.3, Bloemfontein=-37.4/15.6/64.5, Boise=-42.7/11.4/63.5, Bordeaux=-39.0/14.2/63.5, Bosaso=-21.1/30.0/76.9, Boston=-37.5/10.9/59.4, Bouaké=-22.6/26.0/76.4, Bratislava=-38.2/10.5/60.5, Brazzaville=-29.3/25.0/73.8, Bridgetown=-20.7/27.0/77.8, Brisbane=-26.8/21.4/71.8, Brussels=-40.0/10.5/57.9, Bucharest=-41.8/10.8/62.7, Budapest=-36.8/11.3/61.6, Bujumbura=-24.8/23.8/78.3, Bulawayo=-28.8/18.9/73.0, Burnie=-34.8/13.1/62.6, Busan=-34.6/15.0/65.1, Cabo San Lucas=-27.3/23.9/72.1, Cairns=-22.1/25.0/75.4, Cairo=-28.2/21.4/71.2, Calgary=-45.9/4.4/55.3, Canberra=-36.9/13.1/61.0, Cape Town=-34.0/16.2/68.1, Changsha=-38.6/17.4/68.0, Charlotte=-36.8/16.1/67.1, Chiang Mai=-21.9/25.8/75.6, Chicago=-43.3/9.8/61.2, Chihuahua=-33.1/18.6/65.9, Chittagong=-29.8/25.9/74.5, Chișinău=-37.4/10.2/64.3, Chongqing=-32.8/18.6/70.9, Christchurch=-35.2/12.2/62.9, City of San Marino=-39.4/11.8/61.1, Colombo=-22.5/27.4/83.5, Columbus=-37.1/11.7/66.6, Conakry=-26.6/26.4/81.0, Copenhagen=-40.7/9.1/63.2, Cotonou=-22.7/27.2/79.0, Cracow=-41.9/9.3/57.9, Da Lat=-31.2/17.9/65.9, Da Nang=-28.7/25.8/76.1, Dakar=-24.9/24.0/81.3, Dallas=-34.1/19.0/66.0, Damascus=-33.5/17.0/68.2, Dampier=-26.2/26.4/74.0, Dar es Salaam=-23.1/25.8/80.0, Darwin=-20.0/27.6/76.8, Denpasar=-24.7/23.7/71.2, Denver=-40.7/10.4/58.6, Detroit=-39.3/10.0/60.6, Dhaka=-26.7/25.9/74.8, Dikson=-61.2/-11.1/37.6, Dili=-20.4/26.6/74.7, Djibouti=-21.8/29.9/77.0, Dodoma=-25.5/22.7/70.6, Dolisie=-30.0/24.0/78.6, Douala=-25.0/26.7/76.5, Dubai=-21.1/26.9/76.5, Dublin=-44.0/9.8/61.5, Dunedin=-37.9/11.1/62.3, Durban=-28.6/20.6/72.0, Dushanbe=-36.6/14.7/68.3, Edinburgh=-39.4/9.3/58.7, Edmonton=-45.8/4.2/51.7, El Paso=-31.4/18.1/67.5, Entebbe=-26.0/21.0/76.9, Erbil=-28.5/19.5/70.4, Erzurum=-46.3/5.1/52.7, Fairbanks=-50.9/-2.3/47.2, Fianarantsoa=-28.7/17.9/66.9, Flores, Petén=-23.6/26.4/79.3, Frankfurt=-37.1/10.6/62.7, Fresno=-34.3/17.9/74.3, Fukuoka=-33.8/17.0/68.4, Gaborone=-29.6/21.0/76.0, Gabès=-31.1/19.5/69.3, Gagnoa=-23.2/26.0/84.6, Gangtok=-32.2/15.2/64.8, Garissa=-21.4/29.3/77.4, Garoua=-22.3/28.3/78.9, George Town=-21.5/27.9/77.9, Ghanzi=-26.0/21.4/74.5, Gjoa Haven=-64.2/-14.4/37.0, Guadalajara=-27.2/20.9/71.2, Guangzhou=-27.4/22.4/68.9, Guatemala City=-30.7/20.4/68.5, Halifax=-47.7/7.5/55.4, Hamburg=-38.3/9.7/57.1, Hamilton=-39.2/13.8/69.1, Hanga Roa=-29.6/20.5/70.4, Hanoi=-25.7/23.6/76.4, Harare=-33.3/18.4/68.8, Harbin=-48.3/5.0/53.6, Hargeisa=-33.3/21.7/72.7, Hat Yai=-24.8/27.0/76.0, Havana=-28.1/25.2/73.2, Helsinki=-43.8/5.9/54.9, Heraklion=-31.2/18.9/71.1, Hiroshima=-29.7/16.3/64.7, Ho Chi Minh City=-22.2/27.4/78.8, Hobart=-38.9/12.7/60.2, Hong Kong=-25.8/23.3/72.5, Honiara=-22.7/26.5/77.0, Honolulu=-25.8/25.4/74.3, Houston=-26.7/20.8/69.1, Ifrane=-36.9/11.4/60.9, Indianapolis=-37.6/11.8/63.0, Iqaluit=-57.0/-9.3/39.4, Irkutsk=-48.0/1.0/55.4, Istanbul=-37.5/13.9/69.4, Jacksonville=-32.5/20.3/70.0, Jakarta=-25.8/26.7/78.8, Jayapura=-24.7/27.0/76.5, Jerusalem=-29.7/18.3/68.9, Johannesburg=-34.0/15.5/68.9, Jos=-29.7/22.8/70.8, Juba=-21.4/27.8/79.1, Kabul=-38.1/12.1/66.4, Kampala=-29.4/20.0/74.7, Kandi=-21.5/27.7/77.6, Kankan=-25.1/26.5/77.3, Kano=-24.3/26.4/76.3, Kansas City=-35.9/12.5/60.4, Karachi=-24.1/26.0/73.2, Karonga=-24.0/24.4/76.1, Kathmandu=-28.3/18.3/72.0, Khartoum=-21.3/29.9/79.2, Kingston=-26.8/27.4/78.8, Kinshasa=-21.2/25.3/77.6, Kolkata=-23.6/26.7/76.7, Kuala Lumpur=-21.5/27.3/74.6, Kumasi=-21.0/26.0/74.0, Kunming=-33.5/15.7/63.6, Kuopio=-50.0/3.4/56.2, Kuwait City=-24.0/25.7/76.8, Kyiv=-40.9/8.4/58.4, Kyoto=-32.7/15.8/64.0, La Ceiba=-24.1/26.2/80.3, La Paz=-29.6/23.7/76.9, Lagos=-24.3/26.8/75.7, Lahore=-24.0/24.3/74.1, Lake Havasu City=-26.5/23.7/74.4, Lake Tekapo=-40.7/8.7/61.2, Las Palmas de Gran Canaria=-28.1/21.2/72.8, Las Vegas=-26.8/20.3/70.7, Launceston=-39.7/13.1/63.4, Lhasa=-44.8/7.6/62.2, Libreville=-24.1/25.9/76.9, Lisbon=-30.5/17.5/72.0, Livingstone=-27.7/21.8/72.5, Ljubljana=-41.2/10.9/61.1, Lodwar=-25.7/29.3/87.2, Lomé=-22.4/26.9/76.3, London=-42.1/11.3/59.8, Los Angeles=-30.7/18.6/69.7, Louisville=-34.7/13.9/63.7, Luanda=-24.8/25.8/75.9, Lubumbashi=-39.9/20.8/69.0, Lusaka=-31.5/19.9/74.4, Luxembourg City=-42.1/9.3/62.1, Lviv=-40.6/7.8/55.1, Lyon=-35.7/12.5/64.5, Madrid=-36.5/15.0/67.0, Mahajanga=-25.9/26.3/76.5, Makassar=-21.5/26.7/78.6, Makurdi=-27.2/26.0/74.6, Malabo=-26.2/26.3/77.5, Malé=-22.8/28.0/78.1, Managua=-23.0/27.3/76.5, Manama=-28.3/26.5/74.2, Mandalay=-21.9/28.0/79.2, Mango=-21.4/28.1/78.8, Manila=-23.1/28.4/77.9, Maputo=-25.2/22.8/73.1, Marrakesh=-33.0/19.6/70.1, Marseille=-32.7/15.8/60.7, Maun=-28.4/22.4/73.0, Medan=-23.8/26.5/73.9, Mek'ele=-31.3/22.7/74.5, Melbourne=-33.2/15.1/70.3, Memphis=-32.8/17.2/74.3, Mexicali=-25.8/23.1/75.3, Mexico City=-32.4/17.5/68.9, Miami=-24.0/24.9/72.8, Milan=-38.2/13.0/61.3, Milwaukee=-44.1/8.9/60.3, Minneapolis=-43.0/7.8/57.8, Minsk=-47.3/6.7/57.7, Mogadishu=-23.5/27.1/75.8, Mombasa=-21.8/26.3/77.8, Monaco=-30.6/16.4/68.7, Moncton=-49.3/6.1/58.3, Monterrey=-27.6/22.3/74.3, Montreal=-39.6/6.8/58.4, Moscow=-43.5/5.8/54.2, Mumbai=-21.2/27.1/78.2, Murmansk=-48.0/0.6/54.5, Muscat=-20.4/28.0/81.5, Mzuzu=-32.5/17.7/68.8, N'Djamena=-29.9/28.3/78.1, Naha=-26.6/23.1/76.6, Nairobi=-34.8/17.8/67.5, Nakhon Ratchasima=-24.3/27.3/77.2, Napier=-37.7/14.6/66.2, Napoli=-37.9/15.9/67.7, Nashville=-39.1/15.4/70.0, Nassau=-25.5/24.6/76.8, Ndola=-30.5/20.3/69.1, New Delhi=-29.6/25.0/74.1, New Orleans=-27.3/20.7/69.2, New York City=-35.5/12.9/65.8, Ngaoundéré=-25.9/22.0/71.5, Niamey=-19.9/29.3/81.1, Nicosia=-29.7/19.7/70.7, Niigata=-37.1/13.9/67.4, Nouadhibou=-32.9/21.3/76.6, Nouakchott=-26.8/25.7/74.8, Novosibirsk=-44.8/1.7/53.1, Nuuk=-56.5/-1.4/50.4, Odesa=-39.8/10.7/58.7, Odienné=-21.6/26.0/77.0, Oklahoma City=-35.7/15.9/67.0, Omaha=-42.8/10.6/58.7, Oranjestad=-19.6/28.1/78.6, Oslo=-42.0/5.7/53.7, Ottawa=-44.9/6.6/56.0, Ouagadougou=-19.0/28.3/78.6, Ouahigouya=-18.2/28.6/77.9, Ouarzazate=-25.8/18.9/70.0, Oulu=-49.5/2.7/49.3, Palembang=-26.4/27.3/83.0, Palermo=-31.3/18.5/68.4, Palm Springs=-24.1/24.5/73.3, Palmerston North=-36.7/13.2/63.1, Panama City=-23.9/28.0/77.2, Parakou=-23.6/26.8/84.9, Paris=-37.1/12.3/65.6, Perth=-30.6/18.7/70.2, Petropavlovsk-Kamchatsky=-45.7/1.9/53.4, Philadelphia=-35.1/13.2/65.2, Phnom Penh=-19.4/28.3/77.5, Phoenix=-28.4/23.9/77.0, Pittsburgh=-36.3/10.8/59.7, Podgorica=-35.5/15.3/61.8, Pointe-Noire=-22.5/26.1/75.1, Pontianak=-21.0/27.7/76.3, Port Moresby=-22.7/26.9/76.1, Port Sudan=-24.0/28.4/79.2, Port Vila=-23.6/24.3/73.0, Port-Gentil=-23.4/26.0/79.3, Portland (OR)=-39.6/12.4/66.9, Porto=-37.6/15.7/62.9, Prague=-45.1/8.4/59.9, Praia=-23.7/24.4/74.9, Pretoria=-34.8/18.2/68.9, Pyongyang=-38.9/10.8/58.7, Rabat=-32.5/17.2/64.6, Rangpur=-26.8/24.4/75.7, Reggane=-18.7/28.3/83.5, Reykjavík=-42.3/4.3/57.4, Riga=-41.5/6.2/53.1, Riyadh=-23.8/26.0/74.2, Rome=-36.2/15.2/62.5, Roseau=-24.9/26.2/75.7, Rostov-on-Don=-40.1/9.9/61.7, Sacramento=-30.4/16.3/64.9, Saint Petersburg=-42.6/5.8/54.2, Saint-Pierre=-44.8/5.7/58.7, Salt Lake City=-37.4/11.6/65.2, San Antonio=-28.0/20.8/75.3, San Diego=-33.2/17.8/67.1, San Francisco=-33.7/14.6/62.3, San Jose=-34.9/16.4/64.7, San José=-28.2/22.6/70.3, San Juan=-22.9/27.2/80.5, San Salvador=-28.4/23.1/71.5, Sana'a=-29.7/20.0/68.6, Santo Domingo=-24.6/25.9/76.5, Sapporo=-39.6/8.9/59.9, Sarajevo=-40.1/10.1/62.1, Saskatoon=-46.7/3.3/51.1, Seattle=-37.7/11.3/58.5, Seoul=-40.3/12.5/62.8, Seville=-32.5/19.2/66.2, Shanghai=-32.3/16.7/70.4, Singapore=-21.9/27.0/78.2, Skopje=-37.8/12.4/66.1, Sochi=-41.7/14.2/64.4, Sofia=-39.8/10.6/64.5, Sokoto=-26.4/28.0/77.9, Split=-35.3/16.1/64.1, St. John's=-44.7/5.0/55.1, St. Louis=-35.2/13.9/61.3, Stockholm=-46.2/6.6/55.9, Surabaya=-20.8/27.1/77.8, Suva=-24.4/25.6/73.0, Suwałki=-42.3/7.2/60.0, Sydney=-36.5/17.7/69.3, Ségou=-17.9/28.0/77.8, Tabora=-25.6/23.0/73.8, Tabriz=-38.4/12.6/60.2, Taipei=-28.7/23.0/73.8, Tallinn=-42.8/6.4/58.5, Tamale=-20.5/27.9/80.8, Tamanrasset=-30.6/21.7/70.1, Tampa=-25.0/22.9/69.9, Tashkent=-36.6/14.8/66.6, Tauranga=-34.8/14.8/66.2, Tbilisi=-34.1/12.9/60.2, Tegucigalpa=-30.9/21.7/74.1, Tehran=-35.0/17.0/67.2, Tel Aviv=-28.6/20.0/69.7, Thessaloniki=-35.4/16.0/68.4, Thiès=-25.1/24.0/71.3, Tijuana=-34.3/17.8/67.2, Timbuktu=-22.5/28.0/77.7, Tirana=-30.8/15.2/63.9, Toamasina=-26.6/23.4/74.5, Tokyo=-33.7/15.4/68.5, Toliara=-28.8/24.1/74.0, Toluca=-41.9/12.4/61.9, Toronto=-41.7/9.4/58.0, Tripoli=-30.6/20.0/69.4, Tromsø=-44.3/2.9/54.3, Tucson=-27.6/20.9/70.3, Tunis=-29.1/18.4/68.4, Ulaanbaatar=-50.8/-0.4/47.1, Upington=-31.5/20.4/69.9, Vaduz=-36.6/10.1/65.2, Valencia=-31.2/18.3/67.2, Valletta=-30.5/18.8/73.4, Vancouver=-42.3/10.4/59.4, Veracruz=-22.7/25.4/77.6, Vienna=-39.5/10.4/62.8, Vientiane=-28.3/25.9/77.7, Villahermosa=-24.4/27.1/79.3, Vilnius=-46.8/6.0/62.2, Virginia Beach=-35.2/15.8/71.1, Vladivostok=-47.5/4.9/53.4, Warsaw=-41.2/8.5/56.2, Washington, D.C.=-36.0/14.6/66.2, Wau=-22.4/27.8/76.6, Wellington=-34.6/12.9/63.4, Whitehorse=-50.9/-0.1/47.9, Wichita=-38.4/13.9/61.9, Willemstad=-19.3/28.0/80.5, Winnipeg=-48.7/3.0/50.5, Wrocław=-41.7/9.6/58.0, Xi'an=-38.5/14.1/63.4, Yakutsk=-61.0/-8.8/41.2, Yangon=-26.0/27.5/78.5, Yaoundé=-25.5/23.8/75.5, Yellowknife=-52.2/-4.3/45.4, Yerevan=-35.7/12.4/66.3, Yinchuan=-43.4/9.0/56.4, Zagreb=-39.4/10.7/59.6, Zanzibar City=-24.2/26.0/76.6, Zürich=-42.2/9.3/56.0, Ürümqi=-43.1/7.4/57.7, İzmir=-34.4/17.9/66.4} 2 | -------------------------------------------------------------------------------- /examples/generate.rs: -------------------------------------------------------------------------------- 1 | //! SOURCE: https://github.com/coriolinus/1brc/blob/b6029edc63611f2a47c462f84a40bdca0de3eede/src/bin/generate.rs 2 | //! 3 | //! Generate a file with an arbitrary number of rows. 4 | //! 5 | //! See reference implementation: https://github.com/gunnarmorling/1brc/blob/main/src/main/java/dev/morling/onebrc/CreateMeasurements.java 6 | 7 | use anyhow::{anyhow, Context, Result}; 8 | use rand::seq::SliceRandom; 9 | use rand_distr::{Distribution, Normal}; 10 | use std::io::Write; 11 | 12 | fn main() -> Result<()> { 13 | let n = std::env::args() 14 | .nth(1) 15 | .ok_or_else(|| anyhow!("requires at least one argument"))? 16 | .parse::() 17 | .context("must be able to parse as usize")?; 18 | 19 | let mut rng = rand::thread_rng(); 20 | 21 | let file = 22 | std::fs::File::create("measurements.txt").context("opening output file for write")?; 23 | let mut buf = std::io::BufWriter::new(file); 24 | 25 | let std_devs = Normal::new(10.0, 2.5).context("std_devs is valid normal distribution")?; 26 | let mut data = Vec::with_capacity(DATA.len()); 27 | for (city, mean) in DATA.iter().copied() { 28 | let dist = Normal::new(mean, std_devs.sample(&mut rng)) 29 | .context(anyhow!("creating new normal distribution for {city}"))?; 30 | data.push((city, dist)); 31 | } 32 | 33 | for _ in 0..n { 34 | let (city, dist) = data.choose(&mut rng).expect("data is not empty"); 35 | let mut temp = dist.sample(&mut rng); 36 | while temp >= 100. { 37 | temp -= 100.; 38 | } 39 | while temp < -100. { 40 | temp += 100.; 41 | } 42 | let temp = (temp * 10.0).round() / 10.0; 43 | writeln!(buf, "{city};{temp:.1}").context("writing data line")?; 44 | } 45 | 46 | Ok(()) 47 | } 48 | 49 | const DATA: &[(&str, f64)] = &[ 50 | ("Abha", 18.0), 51 | ("Abidjan", 26.0), 52 | ("Abéché", 29.4), 53 | ("Accra", 26.4), 54 | ("Addis Ababa", 16.0), 55 | ("Adelaide", 17.3), 56 | ("Aden", 29.1), 57 | ("Ahvaz", 25.4), 58 | ("Albuquerque", 14.0), 59 | ("Alexandra", 11.0), 60 | ("Alexandria", 20.0), 61 | ("Algiers", 18.2), 62 | ("Alice Springs", 21.0), 63 | ("Almaty", 10.0), 64 | ("Amsterdam", 10.2), 65 | ("Anadyr", -6.9), 66 | ("Anchorage", 2.8), 67 | ("Andorra la Vella", 9.8), 68 | ("Ankara", 12.0), 69 | ("Antananarivo", 17.9), 70 | ("Antsiranana", 25.2), 71 | ("Arkhangelsk", 1.3), 72 | ("Ashgabat", 17.1), 73 | ("Asmara", 15.6), 74 | ("Assab", 30.5), 75 | ("Astana", 3.5), 76 | ("Athens", 19.2), 77 | ("Atlanta", 17.0), 78 | ("Auckland", 15.2), 79 | ("Austin", 20.7), 80 | ("Baghdad", 22.77), 81 | ("Baguio", 19.5), 82 | ("Baku", 15.1), 83 | ("Baltimore", 13.1), 84 | ("Bamako", 27.8), 85 | ("Bangkok", 28.6), 86 | ("Bangui", 26.0), 87 | ("Banjul", 26.0), 88 | ("Barcelona", 18.2), 89 | ("Bata", 25.1), 90 | ("Batumi", 14.0), 91 | ("Beijing", 12.9), 92 | ("Beirut", 20.9), 93 | ("Belgrade", 12.5), 94 | ("Belize City", 26.7), 95 | ("Benghazi", 19.9), 96 | ("Bergen", 7.7), 97 | ("Berlin", 10.3), 98 | ("Bilbao", 14.7), 99 | ("Birao", 26.5), 100 | ("Bishkek", 11.3), 101 | ("Bissau", 27.0), 102 | ("Blantyre", 22.2), 103 | ("Bloemfontein", 15.6), 104 | ("Boise", 11.4), 105 | ("Bordeaux", 14.2), 106 | ("Bosaso", 30.0), 107 | ("Boston", 10.9), 108 | ("Bouaké", 26.0), 109 | ("Bratislava", 10.5), 110 | ("Brazzaville", 25.0), 111 | ("Bridgetown", 27.0), 112 | ("Brisbane", 21.4), 113 | ("Brussels", 10.5), 114 | ("Bucharest", 10.8), 115 | ("Budapest", 11.3), 116 | ("Bujumbura", 23.8), 117 | ("Bulawayo", 18.9), 118 | ("Burnie", 13.1), 119 | ("Busan", 15.0), 120 | ("Cabo San Lucas", 23.9), 121 | ("Cairns", 25.0), 122 | ("Cairo", 21.4), 123 | ("Calgary", 4.4), 124 | ("Canberra", 13.1), 125 | ("Cape Town", 16.2), 126 | ("Changsha", 17.4), 127 | ("Charlotte", 16.1), 128 | ("Chiang Mai", 25.8), 129 | ("Chicago", 9.8), 130 | ("Chihuahua", 18.6), 131 | ("Chișinău", 10.2), 132 | ("Chittagong", 25.9), 133 | ("Chongqing", 18.6), 134 | ("Christchurch", 12.2), 135 | ("City of San Marino", 11.8), 136 | ("Colombo", 27.4), 137 | ("Columbus", 11.7), 138 | ("Conakry", 26.4), 139 | ("Copenhagen", 9.1), 140 | ("Cotonou", 27.2), 141 | ("Cracow", 9.3), 142 | ("Da Lat", 17.9), 143 | ("Da Nang", 25.8), 144 | ("Dakar", 24.0), 145 | ("Dallas", 19.0), 146 | ("Damascus", 17.0), 147 | ("Dampier", 26.4), 148 | ("Dar es Salaam", 25.8), 149 | ("Darwin", 27.6), 150 | ("Denpasar", 23.7), 151 | ("Denver", 10.4), 152 | ("Detroit", 10.0), 153 | ("Dhaka", 25.9), 154 | ("Dikson", -11.1), 155 | ("Dili", 26.6), 156 | ("Djibouti", 29.9), 157 | ("Dodoma", 22.7), 158 | ("Dolisie", 24.0), 159 | ("Douala", 26.7), 160 | ("Dubai", 26.9), 161 | ("Dublin", 9.8), 162 | ("Dunedin", 11.1), 163 | ("Durban", 20.6), 164 | ("Dushanbe", 14.7), 165 | ("Edinburgh", 9.3), 166 | ("Edmonton", 4.2), 167 | ("El Paso", 18.1), 168 | ("Entebbe", 21.0), 169 | ("Erbil", 19.5), 170 | ("Erzurum", 5.1), 171 | ("Fairbanks", -2.3), 172 | ("Fianarantsoa", 17.9), 173 | ("Flores, Petén", 26.4), 174 | ("Frankfurt", 10.6), 175 | ("Fresno", 17.9), 176 | ("Fukuoka", 17.0), 177 | ("Gabès", 19.5), 178 | ("Gaborone", 21.0), 179 | ("Gagnoa", 26.0), 180 | ("Gangtok", 15.2), 181 | ("Garissa", 29.3), 182 | ("Garoua", 28.3), 183 | ("George Town", 27.9), 184 | ("Ghanzi", 21.4), 185 | ("Gjoa Haven", -14.4), 186 | ("Guadalajara", 20.9), 187 | ("Guangzhou", 22.4), 188 | ("Guatemala City", 20.4), 189 | ("Halifax", 7.5), 190 | ("Hamburg", 9.7), 191 | ("Hamilton", 13.8), 192 | ("Hanga Roa", 20.5), 193 | ("Hanoi", 23.6), 194 | ("Harare", 18.4), 195 | ("Harbin", 5.0), 196 | ("Hargeisa", 21.7), 197 | ("Hat Yai", 27.0), 198 | ("Havana", 25.2), 199 | ("Helsinki", 5.9), 200 | ("Heraklion", 18.9), 201 | ("Hiroshima", 16.3), 202 | ("Ho Chi Minh City", 27.4), 203 | ("Hobart", 12.7), 204 | ("Hong Kong", 23.3), 205 | ("Honiara", 26.5), 206 | ("Honolulu", 25.4), 207 | ("Houston", 20.8), 208 | ("Ifrane", 11.4), 209 | ("Indianapolis", 11.8), 210 | ("Iqaluit", -9.3), 211 | ("Irkutsk", 1.0), 212 | ("Istanbul", 13.9), 213 | ("İzmir", 17.9), 214 | ("Jacksonville", 20.3), 215 | ("Jakarta", 26.7), 216 | ("Jayapura", 27.0), 217 | ("Jerusalem", 18.3), 218 | ("Johannesburg", 15.5), 219 | ("Jos", 22.8), 220 | ("Juba", 27.8), 221 | ("Kabul", 12.1), 222 | ("Kampala", 20.0), 223 | ("Kandi", 27.7), 224 | ("Kankan", 26.5), 225 | ("Kano", 26.4), 226 | ("Kansas City", 12.5), 227 | ("Karachi", 26.0), 228 | ("Karonga", 24.4), 229 | ("Kathmandu", 18.3), 230 | ("Khartoum", 29.9), 231 | ("Kingston", 27.4), 232 | ("Kinshasa", 25.3), 233 | ("Kolkata", 26.7), 234 | ("Kuala Lumpur", 27.3), 235 | ("Kumasi", 26.0), 236 | ("Kunming", 15.7), 237 | ("Kuopio", 3.4), 238 | ("Kuwait City", 25.7), 239 | ("Kyiv", 8.4), 240 | ("Kyoto", 15.8), 241 | ("La Ceiba", 26.2), 242 | ("La Paz", 23.7), 243 | ("Lagos", 26.8), 244 | ("Lahore", 24.3), 245 | ("Lake Havasu City", 23.7), 246 | ("Lake Tekapo", 8.7), 247 | ("Las Palmas de Gran Canaria", 21.2), 248 | ("Las Vegas", 20.3), 249 | ("Launceston", 13.1), 250 | ("Lhasa", 7.6), 251 | ("Libreville", 25.9), 252 | ("Lisbon", 17.5), 253 | ("Livingstone", 21.8), 254 | ("Ljubljana", 10.9), 255 | ("Lodwar", 29.3), 256 | ("Lomé", 26.9), 257 | ("London", 11.3), 258 | ("Los Angeles", 18.6), 259 | ("Louisville", 13.9), 260 | ("Luanda", 25.8), 261 | ("Lubumbashi", 20.8), 262 | ("Lusaka", 19.9), 263 | ("Luxembourg City", 9.3), 264 | ("Lviv", 7.8), 265 | ("Lyon", 12.5), 266 | ("Madrid", 15.0), 267 | ("Mahajanga", 26.3), 268 | ("Makassar", 26.7), 269 | ("Makurdi", 26.0), 270 | ("Malabo", 26.3), 271 | ("Malé", 28.0), 272 | ("Managua", 27.3), 273 | ("Manama", 26.5), 274 | ("Mandalay", 28.0), 275 | ("Mango", 28.1), 276 | ("Manila", 28.4), 277 | ("Maputo", 22.8), 278 | ("Marrakesh", 19.6), 279 | ("Marseille", 15.8), 280 | ("Maun", 22.4), 281 | ("Medan", 26.5), 282 | ("Mek'ele", 22.7), 283 | ("Melbourne", 15.1), 284 | ("Memphis", 17.2), 285 | ("Mexicali", 23.1), 286 | ("Mexico City", 17.5), 287 | ("Miami", 24.9), 288 | ("Milan", 13.0), 289 | ("Milwaukee", 8.9), 290 | ("Minneapolis", 7.8), 291 | ("Minsk", 6.7), 292 | ("Mogadishu", 27.1), 293 | ("Mombasa", 26.3), 294 | ("Monaco", 16.4), 295 | ("Moncton", 6.1), 296 | ("Monterrey", 22.3), 297 | ("Montreal", 6.8), 298 | ("Moscow", 5.8), 299 | ("Mumbai", 27.1), 300 | ("Murmansk", 0.6), 301 | ("Muscat", 28.0), 302 | ("Mzuzu", 17.7), 303 | ("N'Djamena", 28.3), 304 | ("Naha", 23.1), 305 | ("Nairobi", 17.8), 306 | ("Nakhon Ratchasima", 27.3), 307 | ("Napier", 14.6), 308 | ("Napoli", 15.9), 309 | ("Nashville", 15.4), 310 | ("Nassau", 24.6), 311 | ("Ndola", 20.3), 312 | ("New Delhi", 25.0), 313 | ("New Orleans", 20.7), 314 | ("New York City", 12.9), 315 | ("Ngaoundéré", 22.0), 316 | ("Niamey", 29.3), 317 | ("Nicosia", 19.7), 318 | ("Niigata", 13.9), 319 | ("Nouadhibou", 21.3), 320 | ("Nouakchott", 25.7), 321 | ("Novosibirsk", 1.7), 322 | ("Nuuk", -1.4), 323 | ("Odesa", 10.7), 324 | ("Odienné", 26.0), 325 | ("Oklahoma City", 15.9), 326 | ("Omaha", 10.6), 327 | ("Oranjestad", 28.1), 328 | ("Oslo", 5.7), 329 | ("Ottawa", 6.6), 330 | ("Ouagadougou", 28.3), 331 | ("Ouahigouya", 28.6), 332 | ("Ouarzazate", 18.9), 333 | ("Oulu", 2.7), 334 | ("Palembang", 27.3), 335 | ("Palermo", 18.5), 336 | ("Palm Springs", 24.5), 337 | ("Palmerston North", 13.2), 338 | ("Panama City", 28.0), 339 | ("Parakou", 26.8), 340 | ("Paris", 12.3), 341 | ("Perth", 18.7), 342 | ("Petropavlovsk-Kamchatsky", 1.9), 343 | ("Philadelphia", 13.2), 344 | ("Phnom Penh", 28.3), 345 | ("Phoenix", 23.9), 346 | ("Pittsburgh", 10.8), 347 | ("Podgorica", 15.3), 348 | ("Pointe-Noire", 26.1), 349 | ("Pontianak", 27.7), 350 | ("Port Moresby", 26.9), 351 | ("Port Sudan", 28.4), 352 | ("Port Vila", 24.3), 353 | ("Port-Gentil", 26.0), 354 | ("Portland (OR)", 12.4), 355 | ("Porto", 15.7), 356 | ("Prague", 8.4), 357 | ("Praia", 24.4), 358 | ("Pretoria", 18.2), 359 | ("Pyongyang", 10.8), 360 | ("Rabat", 17.2), 361 | ("Rangpur", 24.4), 362 | ("Reggane", 28.3), 363 | ("Reykjavík", 4.3), 364 | ("Riga", 6.2), 365 | ("Riyadh", 26.0), 366 | ("Rome", 15.2), 367 | ("Roseau", 26.2), 368 | ("Rostov-on-Don", 9.9), 369 | ("Sacramento", 16.3), 370 | ("Saint Petersburg", 5.8), 371 | ("Saint-Pierre", 5.7), 372 | ("Salt Lake City", 11.6), 373 | ("San Antonio", 20.8), 374 | ("San Diego", 17.8), 375 | ("San Francisco", 14.6), 376 | ("San Jose", 16.4), 377 | ("San José", 22.6), 378 | ("San Juan", 27.2), 379 | ("San Salvador", 23.1), 380 | ("Sana'a", 20.0), 381 | ("Santo Domingo", 25.9), 382 | ("Sapporo", 8.9), 383 | ("Sarajevo", 10.1), 384 | ("Saskatoon", 3.3), 385 | ("Seattle", 11.3), 386 | ("Ségou", 28.0), 387 | ("Seoul", 12.5), 388 | ("Seville", 19.2), 389 | ("Shanghai", 16.7), 390 | ("Singapore", 27.0), 391 | ("Skopje", 12.4), 392 | ("Sochi", 14.2), 393 | ("Sofia", 10.6), 394 | ("Sokoto", 28.0), 395 | ("Split", 16.1), 396 | ("St. John's", 5.0), 397 | ("St. Louis", 13.9), 398 | ("Stockholm", 6.6), 399 | ("Surabaya", 27.1), 400 | ("Suva", 25.6), 401 | ("Suwałki", 7.2), 402 | ("Sydney", 17.7), 403 | ("Tabora", 23.0), 404 | ("Tabriz", 12.6), 405 | ("Taipei", 23.0), 406 | ("Tallinn", 6.4), 407 | ("Tamale", 27.9), 408 | ("Tamanrasset", 21.7), 409 | ("Tampa", 22.9), 410 | ("Tashkent", 14.8), 411 | ("Tauranga", 14.8), 412 | ("Tbilisi", 12.9), 413 | ("Tegucigalpa", 21.7), 414 | ("Tehran", 17.0), 415 | ("Tel Aviv", 20.0), 416 | ("Thessaloniki", 16.0), 417 | ("Thiès", 24.0), 418 | ("Tijuana", 17.8), 419 | ("Timbuktu", 28.0), 420 | ("Tirana", 15.2), 421 | ("Toamasina", 23.4), 422 | ("Tokyo", 15.4), 423 | ("Toliara", 24.1), 424 | ("Toluca", 12.4), 425 | ("Toronto", 9.4), 426 | ("Tripoli", 20.0), 427 | ("Tromsø", 2.9), 428 | ("Tucson", 20.9), 429 | ("Tunis", 18.4), 430 | ("Ulaanbaatar", -0.4), 431 | ("Upington", 20.4), 432 | ("Ürümqi", 7.4), 433 | ("Vaduz", 10.1), 434 | ("Valencia", 18.3), 435 | ("Valletta", 18.8), 436 | ("Vancouver", 10.4), 437 | ("Veracruz", 25.4), 438 | ("Vienna", 10.4), 439 | ("Vientiane", 25.9), 440 | ("Villahermosa", 27.1), 441 | ("Vilnius", 6.0), 442 | ("Virginia Beach", 15.8), 443 | ("Vladivostok", 4.9), 444 | ("Warsaw", 8.5), 445 | ("Washington, D.C.", 14.6), 446 | ("Wau", 27.8), 447 | ("Wellington", 12.9), 448 | ("Whitehorse", -0.1), 449 | ("Wichita", 13.9), 450 | ("Willemstad", 28.0), 451 | ("Winnipeg", 3.0), 452 | ("Wrocław", 9.6), 453 | ("Xi'an", 14.1), 454 | ("Yakutsk", -8.8), 455 | ("Yangon", 27.5), 456 | ("Yaoundé", 23.8), 457 | ("Yellowknife", -4.3), 458 | ("Yerevan", 12.4), 459 | ("Yinchuan", 9.0), 460 | ("Zagreb", 10.7), 461 | ("Zanzibar City", 26.0), 462 | ("Zürich", 9.3), 463 | ]; 464 | -------------------------------------------------------------------------------- /src/main.rs: -------------------------------------------------------------------------------- 1 | #![feature( 2 | slice_split_once, 3 | portable_simd, 4 | slice_as_chunks, 5 | type_alias_impl_trait, 6 | int_roundings 7 | )] 8 | use clap::Parser; 9 | use colored::Colorize; 10 | use fxhash::FxHashSet; 11 | use memmap2::Mmap; 12 | use ptr_hash::PtrHashParams; 13 | use std::{ 14 | simd::{cmp::SimdPartialEq, Simd}, 15 | thread::available_parallelism, 16 | vec::Vec, 17 | }; 18 | 19 | type V = i32; 20 | 21 | type PtrHash = ptr_hash::DefaultPtrHash; 22 | 23 | struct Phf { 24 | ptr_hash: PtrHash, 25 | keys: Vec>, 26 | slots: Vec, 27 | } 28 | 29 | impl Phf { 30 | fn new(mut keys: Vec>) -> Self { 31 | keys.sort(); 32 | 33 | let num_slots = keys.len() * 5 / 2; 34 | let params = ptr_hash::PtrHashParams { 35 | alpha: 0.9, 36 | c: 1.5, 37 | slots_per_part: num_slots, 38 | ..PtrHashParams::default() 39 | }; 40 | 41 | let mut hashes: Vec = keys.iter().map(|key| hash_name(key)).collect(); 42 | hashes.sort(); 43 | for (x, y) in hashes.iter().zip(hashes.iter().skip(1)) { 44 | assert!(*x != *y, "DUPLICATE HASH"); 45 | } 46 | 47 | let ptr_hash = PtrHash::new(&hashes, params); 48 | 49 | let slots = vec![Record::default(); num_slots]; 50 | 51 | Self { 52 | ptr_hash, 53 | keys, 54 | slots, 55 | } 56 | } 57 | fn compute_index(&self, hash: u64) -> usize { 58 | self.ptr_hash.index_single_part(&hash) 59 | } 60 | fn get_index_mut(&mut self, idx: usize) -> &mut Record { 61 | &mut self.slots[idx] 62 | } 63 | fn index_hash_mut(&mut self, hash: u64) -> &mut Record { 64 | &mut self.slots[self.ptr_hash.index_single_part(&hash)] 65 | } 66 | fn index<'b>(&'b self, key: &[u8]) -> &'b Record { 67 | let hash = hash_name(key); 68 | &self.slots[self.compute_index(hash)] 69 | } 70 | fn index_mut<'b>(&'b mut self, key: &[u8]) -> &'b mut Record { 71 | self.index_hash_mut(hash_name(key)) 72 | } 73 | fn merge(&mut self, r: Self) { 74 | // TODO: If key sets are equal or one is a subset of the other, merge 75 | // smaller into larger. 76 | let mut new_keys = vec![]; 77 | let mut i1 = 0; 78 | let mut i2 = 0; 79 | while i1 < self.keys.len() && i2 < r.keys.len() { 80 | if self.keys[i1] == r.keys[i2] { 81 | new_keys.push(self.keys[i1].clone()); 82 | i1 += 1; 83 | i2 += 1; 84 | continue; 85 | } 86 | if self.keys[i1] < r.keys[i2] { 87 | new_keys.push(self.keys[i1].clone()); 88 | i1 += 1; 89 | continue; 90 | } 91 | if self.keys[i1] > r.keys[i2] { 92 | new_keys.push(r.keys[i2].clone()); 93 | i2 += 1; 94 | continue; 95 | } 96 | panic!(); 97 | } 98 | while i1 < self.keys.len() { 99 | new_keys.push(self.keys[i1].clone()); 100 | i1 += 1; 101 | } 102 | while i2 < r.keys.len() { 103 | new_keys.push(r.keys[i2].clone()); 104 | i2 += 1; 105 | } 106 | let mut new_phf = Self::new(new_keys); 107 | for key in &self.keys { 108 | new_phf.index_mut(key).merge(self.index(key)); 109 | } 110 | for key in &r.keys { 111 | new_phf.index_mut(key).merge(r.index(key)); 112 | } 113 | *self = new_phf; 114 | } 115 | } 116 | 117 | #[derive(Clone, Debug)] 118 | #[repr(align(32))] 119 | struct Record { 120 | count: u64, 121 | // Storing these as two u32 is nice, because they are read as a single u64. 122 | /// Byte representation of string ~b"bc.d" or ~b"\0c.d". 123 | min: u32, 124 | /// Byte representation of string b"bc.d" or b"\0c.d". 125 | max: u32, 126 | sum: u64, 127 | } 128 | 129 | impl Record { 130 | fn default() -> Self { 131 | Self { 132 | count: 0, 133 | min: 0, 134 | max: 0, 135 | sum: 0, 136 | } 137 | } 138 | fn add(&mut self, raw_value: u32, value: u64) { 139 | // assert2::debug_assert!(value < 1000); 140 | self.count += 1; 141 | self.sum += value; 142 | // See https://en.algorithmica.org/hpc/algorithms/argmin/ 143 | if raw_value < self.min { 144 | self.min = raw_value; 145 | } 146 | if raw_value > self.max { 147 | self.max = raw_value; 148 | } 149 | } 150 | fn merge(&mut self, other: &Self) { 151 | self.count += other.count; 152 | self.sum += other.sum_to_val() as u64; 153 | self.min = self.min.min(other.min); 154 | self.max = self.max.max(other.max); 155 | } 156 | fn sum_to_val(&self) -> V { 157 | let m = (1 << 21) - 1; 158 | ((self.sum & m) + 10 * ((self.sum >> 21) & m) + 100 * ((self.sum >> 42) & m)) as _ 159 | } 160 | /// Return (min, avg, max) 161 | fn merge_pos_neg(pos: &Record, neg: &Record) -> (V, V, V) { 162 | let pos_sum = pos.sum as V; 163 | let neg_sum = neg.sum as V; 164 | let sum = pos_sum - neg_sum; 165 | let count = (pos.count + neg.count) as V; 166 | // round to nearest 167 | let avg = (sum + count / 2).div_floor(count); 168 | 169 | let pos_max = raw_to_value(pos.max); 170 | let neg_max = -raw_to_value(neg.min); 171 | let max = pos_max.max(neg_max); 172 | 173 | let pos_min = raw_to_value(pos.min); 174 | let neg_min = -raw_to_value(neg.max); 175 | let min = pos_min.min(neg_min); 176 | 177 | (min, avg, max) 178 | } 179 | } 180 | 181 | /// Reads raw bytes and masks the ; and the b'0'=0x30. 182 | /// Returns something of the form 0x0b0c..0d or 0x000c..0d 183 | fn parse_to_raw(data: &[u8], start: usize, end: usize) -> u32 { 184 | let raw = u32::from_be_bytes(unsafe { *data.get_unchecked(start..).as_ptr().cast() }); 185 | raw >> (8 * (4 - (end - start))) 186 | } 187 | 188 | fn raw_to_pdep(raw: u32) -> u64 { 189 | #[cfg(feature = "no_pdep")] 190 | { 191 | let raw = raw as u64; 192 | (raw & 15) | ((raw & (15 << 16)) << (21 - 16)) | ((raw & (15 << 24)) << (42 - 24)) 193 | } 194 | #[cfg(not(feature = "no_pdep"))] 195 | { 196 | let mask = 0x0f0f000f; 197 | let raw = raw & mask; 198 | // input 0011bbbb0011cccc........0011dddd 199 | // 0b bbbb xxxxcccc yyyyyyyyyyyydddd // Deposit here 200 | // 0b 1111 1111 1111 // Mask out trash using & 201 | let pdep = 0b0000000000000000001111000000000000011111111000001111111111111111u64; 202 | unsafe { core::arch::x86_64::_pdep_u64(raw as u64, pdep) } 203 | } 204 | } 205 | 206 | fn raw_to_value(v: u32) -> V { 207 | let mask = 0x0f0f000f; 208 | let bytes = (v & mask).to_be_bytes(); 209 | // s = bc.d 210 | let b = bytes[0] as V; 211 | let c = bytes[1] as V; 212 | let d = bytes[3] as V; 213 | b as V * 100 * (bytes[0] != 0) as V + c as V * 10 + d as V 214 | } 215 | 216 | fn format(v: V) -> String { 217 | format!("{:.1}", v as f64 / 10.0) 218 | } 219 | 220 | #[allow(unused)] 221 | fn hash_name(name: &[u8]) -> u64 { 222 | // Hash the first and last 8 bytes. 223 | // TODO: More robust hash that actually uses all characters. 224 | let head: [u8; 8] = unsafe { *name.get_unchecked(..8).split_first_chunk().unwrap().0 }; 225 | let tail: [u8; 8] = unsafe { 226 | *name 227 | .get_unchecked(name.len().wrapping_sub(8)..) 228 | .split_first_chunk() 229 | .unwrap() 230 | .0 231 | }; 232 | let shift = 64usize.saturating_sub(8 * name.len()); 233 | let khead = u64::from_ne_bytes(head) << shift; 234 | let ktail = u64::from_ne_bytes(tail) >> shift; 235 | khead.wrapping_add(ktail) 236 | } 237 | 238 | /// Number of SIMD lanes. AVX2 has 256 bits, so 32 lanes. 239 | const L: usize = 32; 240 | /// The Simd type. 241 | type S = Simd; 242 | 243 | #[derive(Copy, Clone)] 244 | struct State { 245 | start: usize, 246 | sep: usize, 247 | end: usize, 248 | } 249 | 250 | /// Find the regions between \n and ; (names) and between ; and \n (values), 251 | /// and calls `callback` for each line. 252 | #[inline(always)] 253 | fn iter_lines<'a>( 254 | mut data: &'a [u8], 255 | mut callback: impl FnMut(&'a [u8], State, State, State, State), 256 | ) { 257 | // Make sure that the out-of-bounds reads we do are OK. 258 | data = &data[..data.len() - 32]; 259 | 260 | let sep = S::splat(b';'); 261 | let end = S::splat(b'\n'); 262 | 263 | let find = |last: usize, sep: S| { 264 | let simd = S::from_array(unsafe { *data.get_unchecked(last..).as_ptr().cast() }); 265 | let eq = sep.simd_eq(simd).to_bitmask() as u32; 266 | let offset = eq.trailing_zeros() as usize; 267 | last + offset 268 | }; 269 | // Modified to be able to search regions longer than 32. 270 | let find_long = |mut last: usize, sep: S| { 271 | let simd = S::from_array(unsafe { *data.get_unchecked(last..).as_ptr().cast() }); 272 | let mut eq = sep.simd_eq(simd).to_bitmask() as u32; 273 | if eq == 0 { 274 | while eq == 0 { 275 | last += 32; 276 | let simd = S::from_array(unsafe { *data.get_unchecked(last..).as_ptr().cast() }); 277 | eq = sep.simd_eq(simd).to_bitmask() as u32; 278 | } 279 | } 280 | let offset = eq.trailing_zeros() as usize; 281 | last + offset 282 | }; 283 | 284 | let init_state = |idx: usize| { 285 | let first_end = find_long(idx, end); 286 | State { 287 | start: first_end + 1, 288 | sep: first_end + 1, 289 | end: 0, 290 | } 291 | }; 292 | 293 | let mut state0 = init_state(0); 294 | let mut state1 = init_state(data.len() / 4); 295 | let mut state2 = init_state(2 * data.len() / 4); 296 | let mut state3 = init_state(3 * data.len() / 4); 297 | 298 | // Duplicate each line for each input state. 299 | macro_rules! step { 300 | [$($s:expr),*] => { 301 | $($s.sep = find_long($s.sep + 1, sep) ;)* 302 | $($s.end = find($s.sep + 1, end) ;)* 303 | callback(data, $($s, )*); 304 | $($s.start = $s.end + 1;)* 305 | } 306 | } 307 | 308 | while state3.start < data.len() { 309 | step!(state0, state1, state2, state3); 310 | } 311 | } 312 | 313 | fn run(data: &[u8], keys: &[Vec]) -> Phf { 314 | // Each thread has its own accumulator. 315 | let mut h = Phf::new(keys.to_vec()); 316 | iter_lines( 317 | data, 318 | |data, mut s0: State, mut s1: State, mut s2: State, mut s3: State| { 319 | unsafe { 320 | // If value is negative, extend name by one character. 321 | s0.sep += (data.get_unchecked(s0.sep + 1) == &b'-') as usize; 322 | let name0 = data.get_unchecked(s0.start..s0.sep); 323 | 324 | s1.sep += (data.get_unchecked(s1.sep + 1) == &b'-') as usize; 325 | let name1 = data.get_unchecked(s1.start..s1.sep); 326 | 327 | s2.sep += (data.get_unchecked(s2.sep + 1) == &b'-') as usize; 328 | let name2 = data.get_unchecked(s2.start..s2.sep); 329 | 330 | s3.sep += (data.get_unchecked(s3.sep + 1) == &b'-') as usize; 331 | let name3 = data.get_unchecked(s3.start..s3.sep); 332 | 333 | let raw0 = parse_to_raw(data, s0.sep + 1, s0.end); 334 | let raw1 = parse_to_raw(data, s1.sep + 1, s1.end); 335 | let raw2 = parse_to_raw(data, s2.sep + 1, s2.end); 336 | let raw3 = parse_to_raw(data, s3.sep + 1, s3.end); 337 | 338 | let h0 = hash_name(name0); 339 | let h1 = hash_name(name1); 340 | let h2 = hash_name(name2); 341 | let h3 = hash_name(name3); 342 | 343 | let idx0 = h.compute_index(h0); 344 | let idx1 = h.compute_index(h1); 345 | let idx2 = h.compute_index(h2); 346 | let idx3 = h.compute_index(h3); 347 | 348 | h.get_index_mut(idx0).add(raw0, raw_to_pdep(raw0)); 349 | h.get_index_mut(idx1).add(raw1, raw_to_pdep(raw1)); 350 | h.get_index_mut(idx2).add(raw2, raw_to_pdep(raw2)); 351 | h.get_index_mut(idx3).add(raw3, raw_to_pdep(raw3)); 352 | } 353 | }, 354 | ); 355 | h 356 | } 357 | 358 | fn run_parallel(data: &[u8], keys: &[Vec], num_threads: usize) -> Phf { 359 | if num_threads == 0 { 360 | return run(data, keys); 361 | } 362 | 363 | let phf = std::sync::Mutex::new(Phf::new(keys.to_vec())); 364 | 365 | // Spawn one thread per core. 366 | std::thread::scope(|s| { 367 | let chunks = data.chunks(data.len() / num_threads + 1); 368 | for chunk in chunks { 369 | s.spawn(|| { 370 | // Each thread has its own accumulator. 371 | let thread_phf = run(chunk, keys); 372 | 373 | // Merge results. 374 | phf.lock().unwrap().merge(thread_phf); 375 | }); 376 | } 377 | }); 378 | 379 | phf.into_inner().unwrap() 380 | } 381 | 382 | fn to_str(name: &[u8]) -> &str { 383 | std::str::from_utf8(name).unwrap() 384 | } 385 | 386 | /// Returns a list of city names found in data. 387 | /// Each city is returned twice, once as `` and once as `;`, 388 | /// with the latter being used to accumulate negative temperatures. 389 | #[inline(never)] 390 | fn find_city_names(data: &[u8]) -> Vec> { 391 | let mut cities = FxHashSet::default(); 392 | 393 | let mut callback = |data: &[u8], state: State| { 394 | let State { start, sep, .. } = state; 395 | let name = unsafe { data.get_unchecked(start..sep) }; 396 | cities.insert(name.to_vec()); 397 | 398 | // Do the same for the name with ; appended. 399 | let name = unsafe { data.get_unchecked(start..sep + 1) }; 400 | cities.insert(name.to_vec()); 401 | }; 402 | iter_lines(data, |d, s0, s1, s2, s3| { 403 | flatten_callback(d, s0, s1, s2, s3, &mut callback) 404 | }); 405 | 406 | let mut cities: Vec<_> = cities.into_iter().collect(); 407 | cities.sort(); 408 | cities 409 | } 410 | 411 | fn flatten_callback<'a>( 412 | data: &'a [u8], 413 | s0: State, 414 | s1: State, 415 | s2: State, 416 | s3: State, 417 | callback: &mut impl FnMut(&'a [u8], State), 418 | ) { 419 | callback(data, s0); 420 | callback(data, s1); 421 | callback(data, s2); 422 | callback(data, s3); 423 | } 424 | 425 | #[derive(clap::Parser)] 426 | struct Args { 427 | input: Option, 428 | 429 | #[clap(short = 'j', long)] 430 | threads: Option, 431 | 432 | #[clap(long)] 433 | print: bool, 434 | 435 | #[clap(long)] 436 | stats: bool, 437 | } 438 | 439 | fn main() { 440 | let args = Args::parse(); 441 | 442 | let start = std::time::Instant::now(); 443 | let filename = args.input.unwrap_or("measurements.txt".to_string()); 444 | let mmap: Mmap; 445 | let data; 446 | { 447 | let file = std::fs::File::open(filename).unwrap(); 448 | mmap = unsafe { Mmap::map(&file).unwrap() }; 449 | data = &*mmap; 450 | } 451 | 452 | // Guaranteed to be aligned for SIMD. 453 | let offset = unsafe { data.align_to::().0.len() }; 454 | let data = &data[offset..]; 455 | 456 | // Build a perfect hash function on the cities found in the first 100k characters. 457 | let names = find_city_names(&data[..4000000]); 458 | 459 | if args.stats { 460 | eprintln!("Num cities: {}", names.len()); 461 | let mut lens = vec![0; 102]; 462 | for n in &names { 463 | if *n.last().unwrap() == b';' { 464 | continue; 465 | } 466 | lens[n.len()] += 1; 467 | } 468 | for (len, count) in lens.iter().enumerate() { 469 | if *count != 0 { 470 | eprintln!("{}: {}", len, count); 471 | } 472 | } 473 | } 474 | 475 | let phf = run_parallel( 476 | data, 477 | &names, 478 | args.threads 479 | .unwrap_or(available_parallelism().unwrap().into()), 480 | ); 481 | 482 | if args.print { 483 | print!("{{"); 484 | let mut first = true; 485 | 486 | let mut keys = phf.keys.clone(); 487 | keys.sort_by(|kl, kr| to_str(kl).cmp(to_str(kr))); 488 | 489 | for name in &keys { 490 | if *name.last().unwrap() != b';' { 491 | continue; 492 | } 493 | let namepos = &name[..name.len() - 1]; 494 | 495 | let rpos = phf.index(namepos); 496 | let rneg = phf.index(name); 497 | let (min, avg, max) = Record::merge_pos_neg(rpos, rneg); 498 | 499 | if !first { 500 | print!(", "); 501 | } 502 | first = false; 503 | 504 | print!( 505 | "{}={}/{}/{}", 506 | to_str(namepos), 507 | format(min), 508 | format(avg), 509 | format(max) 510 | ); 511 | } 512 | println!("}}"); 513 | } 514 | 515 | eprintln!( 516 | "total: {}", 517 | format!("{:>5.2?}", start.elapsed()).bold().green() 518 | ); 519 | } 520 | 521 | #[cfg(test)] 522 | mod test { 523 | #[test] 524 | fn parse_raw() { 525 | use super::*; 526 | let d = b"12.3"; 527 | let raw = parse_to_raw(d, 0, 4); 528 | let v = raw_to_value(raw); 529 | assert_eq!(v, 123); 530 | 531 | let d = b"12.3"; 532 | let raw = parse_to_raw(d, 1, 4); 533 | let v = raw_to_value(raw); 534 | assert_eq!(v, 23); 535 | } 536 | } 537 | -------------------------------------------------------------------------------- /Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 3 4 | 5 | [[package]] 6 | name = "aho-corasick" 7 | version = "1.1.3" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" 10 | dependencies = [ 11 | "memchr", 12 | ] 13 | 14 | [[package]] 15 | name = "anes" 16 | version = "0.1.6" 17 | source = "registry+https://github.com/rust-lang/crates.io-index" 18 | checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" 19 | 20 | [[package]] 21 | name = "anstream" 22 | version = "0.6.13" 23 | source = "registry+https://github.com/rust-lang/crates.io-index" 24 | checksum = "d96bd03f33fe50a863e394ee9718a706f988b9079b20c3784fb726e7678b62fb" 25 | dependencies = [ 26 | "anstyle", 27 | "anstyle-parse", 28 | "anstyle-query", 29 | "anstyle-wincon", 30 | "colorchoice", 31 | "utf8parse", 32 | ] 33 | 34 | [[package]] 35 | name = "anstyle" 36 | version = "1.0.6" 37 | source = "registry+https://github.com/rust-lang/crates.io-index" 38 | checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" 39 | 40 | [[package]] 41 | name = "anstyle-parse" 42 | version = "0.2.3" 43 | source = "registry+https://github.com/rust-lang/crates.io-index" 44 | checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" 45 | dependencies = [ 46 | "utf8parse", 47 | ] 48 | 49 | [[package]] 50 | name = "anstyle-query" 51 | version = "1.0.2" 52 | source = "registry+https://github.com/rust-lang/crates.io-index" 53 | checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" 54 | dependencies = [ 55 | "windows-sys 0.52.0", 56 | ] 57 | 58 | [[package]] 59 | name = "anstyle-wincon" 60 | version = "3.0.2" 61 | source = "registry+https://github.com/rust-lang/crates.io-index" 62 | checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" 63 | dependencies = [ 64 | "anstyle", 65 | "windows-sys 0.52.0", 66 | ] 67 | 68 | [[package]] 69 | name = "anyhow" 70 | version = "1.0.82" 71 | source = "registry+https://github.com/rust-lang/crates.io-index" 72 | checksum = "f538837af36e6f6a9be0faa67f9a314f8119e4e4b5867c6ab40ed60360142519" 73 | 74 | [[package]] 75 | name = "arbitrary-chunks" 76 | version = "0.4.1" 77 | source = "registry+https://github.com/rust-lang/crates.io-index" 78 | checksum = "2ad8689a486416c401ea15715a4694de30054248ec627edbf31f49cb64ee4086" 79 | 80 | [[package]] 81 | name = "assert2" 82 | version = "0.3.14" 83 | source = "registry+https://github.com/rust-lang/crates.io-index" 84 | checksum = "844ca3172d927ddd9d01f63b6c80f4ebd3e01c3f787c204626635450dfe3edba" 85 | dependencies = [ 86 | "assert2-macros", 87 | "diff", 88 | "is-terminal", 89 | "yansi", 90 | ] 91 | 92 | [[package]] 93 | name = "assert2-macros" 94 | version = "0.3.14" 95 | source = "registry+https://github.com/rust-lang/crates.io-index" 96 | checksum = "9ec0e42bd0fe1c8d72c7bde53ac8686764cea0fd86f412b92fcad20fea08b489" 97 | dependencies = [ 98 | "proc-macro2", 99 | "quote", 100 | "rustc_version", 101 | "syn 1.0.109", 102 | ] 103 | 104 | [[package]] 105 | name = "autocfg" 106 | version = "1.2.0" 107 | source = "registry+https://github.com/rust-lang/crates.io-index" 108 | checksum = "f1fdabc7756949593fe60f30ec81974b613357de856987752631dea1e3394c80" 109 | 110 | [[package]] 111 | name = "bitflags" 112 | version = "2.5.0" 113 | source = "registry+https://github.com/rust-lang/crates.io-index" 114 | checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" 115 | 116 | [[package]] 117 | name = "bitvec" 118 | version = "1.0.1" 119 | source = "registry+https://github.com/rust-lang/crates.io-index" 120 | checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" 121 | dependencies = [ 122 | "funty", 123 | "radium", 124 | "tap", 125 | "wyz", 126 | ] 127 | 128 | [[package]] 129 | name = "block-pseudorand" 130 | version = "0.1.2" 131 | source = "registry+https://github.com/rust-lang/crates.io-index" 132 | checksum = "2097358495d244a0643746f4d13eedba4608137008cf9dec54e53a3b700115a6" 133 | dependencies = [ 134 | "chiapos-chacha8", 135 | "nanorand", 136 | ] 137 | 138 | [[package]] 139 | name = "bumpalo" 140 | version = "3.16.0" 141 | source = "registry+https://github.com/rust-lang/crates.io-index" 142 | checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" 143 | 144 | [[package]] 145 | name = "byteorder" 146 | version = "1.5.0" 147 | source = "registry+https://github.com/rust-lang/crates.io-index" 148 | checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" 149 | 150 | [[package]] 151 | name = "cast" 152 | version = "0.3.0" 153 | source = "registry+https://github.com/rust-lang/crates.io-index" 154 | checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" 155 | 156 | [[package]] 157 | name = "cc" 158 | version = "1.0.95" 159 | source = "registry+https://github.com/rust-lang/crates.io-index" 160 | checksum = "d32a725bc159af97c3e629873bb9f88fb8cf8a4867175f76dc987815ea07c83b" 161 | 162 | [[package]] 163 | name = "cfg-if" 164 | version = "1.0.0" 165 | source = "registry+https://github.com/rust-lang/crates.io-index" 166 | checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" 167 | 168 | [[package]] 169 | name = "chiapos-chacha8" 170 | version = "0.1.0" 171 | source = "registry+https://github.com/rust-lang/crates.io-index" 172 | checksum = "33f8be573a85f6c2bc1b8e43834c07e32f95e489b914bf856c0549c3c269cd0a" 173 | dependencies = [ 174 | "rayon", 175 | ] 176 | 177 | [[package]] 178 | name = "ciborium" 179 | version = "0.2.2" 180 | source = "registry+https://github.com/rust-lang/crates.io-index" 181 | checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e" 182 | dependencies = [ 183 | "ciborium-io", 184 | "ciborium-ll", 185 | "serde", 186 | ] 187 | 188 | [[package]] 189 | name = "ciborium-io" 190 | version = "0.2.2" 191 | source = "registry+https://github.com/rust-lang/crates.io-index" 192 | checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757" 193 | 194 | [[package]] 195 | name = "ciborium-ll" 196 | version = "0.2.2" 197 | source = "registry+https://github.com/rust-lang/crates.io-index" 198 | checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9" 199 | dependencies = [ 200 | "ciborium-io", 201 | "half", 202 | ] 203 | 204 | [[package]] 205 | name = "cityhash-102-rs" 206 | version = "0.1.0" 207 | source = "registry+https://github.com/rust-lang/crates.io-index" 208 | checksum = "3c61dc391dedb78a7117507d8efd692268859f279b97c04c7e4aab1235ef8301" 209 | 210 | [[package]] 211 | name = "clap" 212 | version = "4.5.4" 213 | source = "registry+https://github.com/rust-lang/crates.io-index" 214 | checksum = "90bc066a67923782aa8515dbaea16946c5bcc5addbd668bb80af688e53e548a0" 215 | dependencies = [ 216 | "clap_builder", 217 | "clap_derive", 218 | ] 219 | 220 | [[package]] 221 | name = "clap_builder" 222 | version = "4.5.2" 223 | source = "registry+https://github.com/rust-lang/crates.io-index" 224 | checksum = "ae129e2e766ae0ec03484e609954119f123cc1fe650337e155d03b022f24f7b4" 225 | dependencies = [ 226 | "anstream", 227 | "anstyle", 228 | "clap_lex", 229 | "strsim", 230 | ] 231 | 232 | [[package]] 233 | name = "clap_derive" 234 | version = "4.5.4" 235 | source = "registry+https://github.com/rust-lang/crates.io-index" 236 | checksum = "528131438037fd55894f62d6e9f068b8f45ac57ffa77517819645d10aed04f64" 237 | dependencies = [ 238 | "heck", 239 | "proc-macro2", 240 | "quote", 241 | "syn 2.0.60", 242 | ] 243 | 244 | [[package]] 245 | name = "clap_lex" 246 | version = "0.7.0" 247 | source = "registry+https://github.com/rust-lang/crates.io-index" 248 | checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" 249 | 250 | [[package]] 251 | name = "colorchoice" 252 | version = "1.0.0" 253 | source = "registry+https://github.com/rust-lang/crates.io-index" 254 | checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" 255 | 256 | [[package]] 257 | name = "colored" 258 | version = "2.1.0" 259 | source = "registry+https://github.com/rust-lang/crates.io-index" 260 | checksum = "cbf2150cce219b664a8a70df7a1f933836724b503f8a413af9365b4dcc4d90b8" 261 | dependencies = [ 262 | "lazy_static", 263 | "windows-sys 0.48.0", 264 | ] 265 | 266 | [[package]] 267 | name = "common_traits" 268 | version = "0.10.2" 269 | source = "registry+https://github.com/rust-lang/crates.io-index" 270 | checksum = "6963264945d9ccb66c17ba1cc1af34d06812f45bc14c250dda5a1566905b0af0" 271 | dependencies = [ 272 | "anyhow", 273 | "half", 274 | ] 275 | 276 | [[package]] 277 | name = "criterion" 278 | version = "0.5.1" 279 | source = "registry+https://github.com/rust-lang/crates.io-index" 280 | checksum = "f2b12d017a929603d80db1831cd3a24082f8137ce19c69e6447f54f5fc8d692f" 281 | dependencies = [ 282 | "anes", 283 | "cast", 284 | "ciborium", 285 | "clap", 286 | "criterion-plot", 287 | "is-terminal", 288 | "itertools 0.10.5", 289 | "num-traits", 290 | "once_cell", 291 | "oorandom", 292 | "plotters", 293 | "rayon", 294 | "regex", 295 | "serde", 296 | "serde_derive", 297 | "serde_json", 298 | "tinytemplate", 299 | "walkdir", 300 | ] 301 | 302 | [[package]] 303 | name = "criterion-plot" 304 | version = "0.5.0" 305 | source = "registry+https://github.com/rust-lang/crates.io-index" 306 | checksum = "6b50826342786a51a89e2da3a28f1c32b06e387201bc2d19791f622c673706b1" 307 | dependencies = [ 308 | "cast", 309 | "itertools 0.10.5", 310 | ] 311 | 312 | [[package]] 313 | name = "crossbeam-deque" 314 | version = "0.8.5" 315 | source = "registry+https://github.com/rust-lang/crates.io-index" 316 | checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" 317 | dependencies = [ 318 | "crossbeam-epoch", 319 | "crossbeam-utils", 320 | ] 321 | 322 | [[package]] 323 | name = "crossbeam-epoch" 324 | version = "0.9.18" 325 | source = "registry+https://github.com/rust-lang/crates.io-index" 326 | checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" 327 | dependencies = [ 328 | "crossbeam-utils", 329 | ] 330 | 331 | [[package]] 332 | name = "crossbeam-utils" 333 | version = "0.8.19" 334 | source = "registry+https://github.com/rust-lang/crates.io-index" 335 | checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" 336 | 337 | [[package]] 338 | name = "crunchy" 339 | version = "0.2.2" 340 | source = "registry+https://github.com/rust-lang/crates.io-index" 341 | checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" 342 | 343 | [[package]] 344 | name = "diff" 345 | version = "0.1.13" 346 | source = "registry+https://github.com/rust-lang/crates.io-index" 347 | checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8" 348 | 349 | [[package]] 350 | name = "either" 351 | version = "1.11.0" 352 | source = "registry+https://github.com/rust-lang/crates.io-index" 353 | checksum = "a47c1c47d2f5964e29c61246e81db715514cd532db6b5116a25ea3c03d6780a2" 354 | 355 | [[package]] 356 | name = "errno" 357 | version = "0.3.8" 358 | source = "registry+https://github.com/rust-lang/crates.io-index" 359 | checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" 360 | dependencies = [ 361 | "libc", 362 | "windows-sys 0.52.0", 363 | ] 364 | 365 | [[package]] 366 | name = "fastmurmur3" 367 | version = "0.2.0" 368 | source = "registry+https://github.com/rust-lang/crates.io-index" 369 | checksum = "2d7e9bc68be4cdabbb8938140b01a8b5bc1191937f2c7e7ecc2fcebbe2d749df" 370 | 371 | [[package]] 372 | name = "fastrand" 373 | version = "2.0.2" 374 | source = "registry+https://github.com/rust-lang/crates.io-index" 375 | checksum = "658bd65b1cf4c852a3cc96f18a8ce7b5640f6b703f905c7d74532294c2a63984" 376 | 377 | [[package]] 378 | name = "funty" 379 | version = "2.0.0" 380 | source = "registry+https://github.com/rust-lang/crates.io-index" 381 | checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" 382 | 383 | [[package]] 384 | name = "fxhash" 385 | version = "0.2.1" 386 | source = "registry+https://github.com/rust-lang/crates.io-index" 387 | checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" 388 | dependencies = [ 389 | "byteorder", 390 | ] 391 | 392 | [[package]] 393 | name = "getrandom" 394 | version = "0.2.14" 395 | source = "registry+https://github.com/rust-lang/crates.io-index" 396 | checksum = "94b22e06ecb0110981051723910cbf0b5f5e09a2062dd7663334ee79a9d1286c" 397 | dependencies = [ 398 | "cfg-if", 399 | "libc", 400 | "wasi", 401 | ] 402 | 403 | [[package]] 404 | name = "half" 405 | version = "2.4.1" 406 | source = "registry+https://github.com/rust-lang/crates.io-index" 407 | checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" 408 | dependencies = [ 409 | "cfg-if", 410 | "crunchy", 411 | ] 412 | 413 | [[package]] 414 | name = "hashers" 415 | version = "1.0.1" 416 | source = "registry+https://github.com/rust-lang/crates.io-index" 417 | checksum = "b2bca93b15ea5a746f220e56587f71e73c6165eab783df9e26590069953e3c30" 418 | dependencies = [ 419 | "fxhash", 420 | ] 421 | 422 | [[package]] 423 | name = "heck" 424 | version = "0.5.0" 425 | source = "registry+https://github.com/rust-lang/crates.io-index" 426 | checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" 427 | 428 | [[package]] 429 | name = "hermit-abi" 430 | version = "0.3.9" 431 | source = "registry+https://github.com/rust-lang/crates.io-index" 432 | checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" 433 | 434 | [[package]] 435 | name = "highway" 436 | version = "1.1.0" 437 | source = "registry+https://github.com/rust-lang/crates.io-index" 438 | checksum = "b4ba82c000837f4e74df01a5520f0dc48735d4aed955a99eae4428bab7cf3acd" 439 | 440 | [[package]] 441 | name = "is-terminal" 442 | version = "0.4.12" 443 | source = "registry+https://github.com/rust-lang/crates.io-index" 444 | checksum = "f23ff5ef2b80d608d61efee834934d862cd92461afc0560dedf493e4c033738b" 445 | dependencies = [ 446 | "hermit-abi", 447 | "libc", 448 | "windows-sys 0.52.0", 449 | ] 450 | 451 | [[package]] 452 | name = "itertools" 453 | version = "0.10.5" 454 | source = "registry+https://github.com/rust-lang/crates.io-index" 455 | checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" 456 | dependencies = [ 457 | "either", 458 | ] 459 | 460 | [[package]] 461 | name = "itertools" 462 | version = "0.11.0" 463 | source = "registry+https://github.com/rust-lang/crates.io-index" 464 | checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" 465 | dependencies = [ 466 | "either", 467 | ] 468 | 469 | [[package]] 470 | name = "itoa" 471 | version = "1.0.11" 472 | source = "registry+https://github.com/rust-lang/crates.io-index" 473 | checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" 474 | 475 | [[package]] 476 | name = "js-sys" 477 | version = "0.3.69" 478 | source = "registry+https://github.com/rust-lang/crates.io-index" 479 | checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" 480 | dependencies = [ 481 | "wasm-bindgen", 482 | ] 483 | 484 | [[package]] 485 | name = "lazy_static" 486 | version = "1.4.0" 487 | source = "registry+https://github.com/rust-lang/crates.io-index" 488 | checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" 489 | 490 | [[package]] 491 | name = "libc" 492 | version = "0.2.153" 493 | source = "registry+https://github.com/rust-lang/crates.io-index" 494 | checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" 495 | 496 | [[package]] 497 | name = "libm" 498 | version = "0.2.8" 499 | source = "registry+https://github.com/rust-lang/crates.io-index" 500 | checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" 501 | 502 | [[package]] 503 | name = "linux-raw-sys" 504 | version = "0.4.13" 505 | source = "registry+https://github.com/rust-lang/crates.io-index" 506 | checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" 507 | 508 | [[package]] 509 | name = "log" 510 | version = "0.4.21" 511 | source = "registry+https://github.com/rust-lang/crates.io-index" 512 | checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" 513 | 514 | [[package]] 515 | name = "memchr" 516 | version = "2.7.2" 517 | source = "registry+https://github.com/rust-lang/crates.io-index" 518 | checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" 519 | 520 | [[package]] 521 | name = "memmap2" 522 | version = "0.9.4" 523 | source = "registry+https://github.com/rust-lang/crates.io-index" 524 | checksum = "fe751422e4a8caa417e13c3ea66452215d7d63e19e604f4980461212f3ae1322" 525 | dependencies = [ 526 | "libc", 527 | ] 528 | 529 | [[package]] 530 | name = "metrohash" 531 | version = "1.0.6" 532 | source = "registry+https://github.com/rust-lang/crates.io-index" 533 | checksum = "3ba553cb19e2acbc54baa16faef215126243fe45e53357a3b2e9f4ebc7b0506c" 534 | 535 | [[package]] 536 | name = "murmur2" 537 | version = "0.1.0" 538 | source = "registry+https://github.com/rust-lang/crates.io-index" 539 | checksum = "fb585ade2549a017db2e35978b77c319214fa4b37cede841e27954dd6e8f3ca8" 540 | 541 | [[package]] 542 | name = "murmur3" 543 | version = "0.5.2" 544 | source = "registry+https://github.com/rust-lang/crates.io-index" 545 | checksum = "9252111cf132ba0929b6f8e030cac2a24b507f3a4d6db6fb2896f27b354c714b" 546 | 547 | [[package]] 548 | name = "nanorand" 549 | version = "0.6.1" 550 | source = "registry+https://github.com/rust-lang/crates.io-index" 551 | checksum = "729eb334247daa1803e0a094d0a5c55711b85571179f5ec6e53eccfdf7008958" 552 | 553 | [[package]] 554 | name = "num-traits" 555 | version = "0.2.18" 556 | source = "registry+https://github.com/rust-lang/crates.io-index" 557 | checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" 558 | dependencies = [ 559 | "autocfg", 560 | "libm", 561 | ] 562 | 563 | [[package]] 564 | name = "once_cell" 565 | version = "1.19.0" 566 | source = "registry+https://github.com/rust-lang/crates.io-index" 567 | checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" 568 | 569 | [[package]] 570 | name = "one-billion-row-challenge" 571 | version = "0.1.0" 572 | dependencies = [ 573 | "anyhow", 574 | "assert2", 575 | "clap", 576 | "colored", 577 | "fxhash", 578 | "memmap2", 579 | "ptr_hash", 580 | "rand", 581 | "rand_distr", 582 | ] 583 | 584 | [[package]] 585 | name = "oorandom" 586 | version = "11.1.3" 587 | source = "registry+https://github.com/rust-lang/crates.io-index" 588 | checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" 589 | 590 | [[package]] 591 | name = "partition" 592 | version = "0.1.2" 593 | source = "registry+https://github.com/rust-lang/crates.io-index" 594 | checksum = "947f833aaa585cf12b8ec7c0476c98784c49f33b861376ffc84ed92adebf2aba" 595 | 596 | [[package]] 597 | name = "plotters" 598 | version = "0.3.5" 599 | source = "registry+https://github.com/rust-lang/crates.io-index" 600 | checksum = "d2c224ba00d7cadd4d5c660deaf2098e5e80e07846537c51f9cfa4be50c1fd45" 601 | dependencies = [ 602 | "num-traits", 603 | "plotters-backend", 604 | "plotters-svg", 605 | "wasm-bindgen", 606 | "web-sys", 607 | ] 608 | 609 | [[package]] 610 | name = "plotters-backend" 611 | version = "0.3.5" 612 | source = "registry+https://github.com/rust-lang/crates.io-index" 613 | checksum = "9e76628b4d3a7581389a35d5b6e2139607ad7c75b17aed325f210aa91f4a9609" 614 | 615 | [[package]] 616 | name = "plotters-svg" 617 | version = "0.3.5" 618 | source = "registry+https://github.com/rust-lang/crates.io-index" 619 | checksum = "38f6d39893cca0701371e3c27294f09797214b86f1fb951b89ade8ec04e2abab" 620 | dependencies = [ 621 | "plotters-backend", 622 | ] 623 | 624 | [[package]] 625 | name = "ppv-lite86" 626 | version = "0.2.17" 627 | source = "registry+https://github.com/rust-lang/crates.io-index" 628 | checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" 629 | 630 | [[package]] 631 | name = "proc-macro2" 632 | version = "1.0.81" 633 | source = "registry+https://github.com/rust-lang/crates.io-index" 634 | checksum = "3d1597b0c024618f09a9c3b8655b7e430397a36d23fdafec26d6965e9eec3eba" 635 | dependencies = [ 636 | "unicode-ident", 637 | ] 638 | 639 | [[package]] 640 | name = "ptr_hash" 641 | version = "0.1.1" 642 | source = "git+https://github.com/ragnargrootkoerkamp/ptrhash#5f2f7adf3e8abfbcb67314dab858c63d5c41a87f" 643 | dependencies = [ 644 | "anyhow", 645 | "bitvec", 646 | "cityhash-102-rs", 647 | "clap", 648 | "colored", 649 | "common_traits", 650 | "either", 651 | "fastmurmur3", 652 | "fastrand", 653 | "fxhash", 654 | "hashers", 655 | "highway", 656 | "itertools 0.11.0", 657 | "lazy_static", 658 | "metrohash", 659 | "murmur2", 660 | "murmur3", 661 | "radsort", 662 | "rand", 663 | "rand_chacha", 664 | "rayon", 665 | "rdst", 666 | "rustc-hash", 667 | "sucds", 668 | "tempfile", 669 | "wyhash", 670 | "xxhash-rust", 671 | ] 672 | 673 | [[package]] 674 | name = "quote" 675 | version = "1.0.36" 676 | source = "registry+https://github.com/rust-lang/crates.io-index" 677 | checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" 678 | dependencies = [ 679 | "proc-macro2", 680 | ] 681 | 682 | [[package]] 683 | name = "radium" 684 | version = "0.7.0" 685 | source = "registry+https://github.com/rust-lang/crates.io-index" 686 | checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" 687 | 688 | [[package]] 689 | name = "radsort" 690 | version = "0.1.0" 691 | source = "registry+https://github.com/rust-lang/crates.io-index" 692 | checksum = "17fd96390ed3feda12e1dfe2645ed587e0bea749e319333f104a33ff62f77a0b" 693 | 694 | [[package]] 695 | name = "rand" 696 | version = "0.8.5" 697 | source = "registry+https://github.com/rust-lang/crates.io-index" 698 | checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" 699 | dependencies = [ 700 | "libc", 701 | "rand_chacha", 702 | "rand_core", 703 | ] 704 | 705 | [[package]] 706 | name = "rand_chacha" 707 | version = "0.3.1" 708 | source = "registry+https://github.com/rust-lang/crates.io-index" 709 | checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" 710 | dependencies = [ 711 | "ppv-lite86", 712 | "rand_core", 713 | ] 714 | 715 | [[package]] 716 | name = "rand_core" 717 | version = "0.6.4" 718 | source = "registry+https://github.com/rust-lang/crates.io-index" 719 | checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" 720 | dependencies = [ 721 | "getrandom", 722 | ] 723 | 724 | [[package]] 725 | name = "rand_distr" 726 | version = "0.4.3" 727 | source = "registry+https://github.com/rust-lang/crates.io-index" 728 | checksum = "32cb0b9bc82b0a0876c2dd994a7e7a2683d3e7390ca40e6886785ef0c7e3ee31" 729 | dependencies = [ 730 | "num-traits", 731 | "rand", 732 | ] 733 | 734 | [[package]] 735 | name = "rayon" 736 | version = "1.10.0" 737 | source = "registry+https://github.com/rust-lang/crates.io-index" 738 | checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" 739 | dependencies = [ 740 | "either", 741 | "rayon-core", 742 | ] 743 | 744 | [[package]] 745 | name = "rayon-core" 746 | version = "1.12.1" 747 | source = "registry+https://github.com/rust-lang/crates.io-index" 748 | checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" 749 | dependencies = [ 750 | "crossbeam-deque", 751 | "crossbeam-utils", 752 | ] 753 | 754 | [[package]] 755 | name = "rdst" 756 | version = "0.20.14" 757 | source = "registry+https://github.com/rust-lang/crates.io-index" 758 | checksum = "6e7970b4e577b76a96d5e56b5f6662b66d1a4e1f5bb026ee118fc31b373c2752" 759 | dependencies = [ 760 | "arbitrary-chunks", 761 | "block-pseudorand", 762 | "criterion", 763 | "partition", 764 | "rayon", 765 | "tikv-jemallocator", 766 | "voracious_radix_sort", 767 | ] 768 | 769 | [[package]] 770 | name = "regex" 771 | version = "1.10.4" 772 | source = "registry+https://github.com/rust-lang/crates.io-index" 773 | checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" 774 | dependencies = [ 775 | "aho-corasick", 776 | "memchr", 777 | "regex-automata", 778 | "regex-syntax", 779 | ] 780 | 781 | [[package]] 782 | name = "regex-automata" 783 | version = "0.4.6" 784 | source = "registry+https://github.com/rust-lang/crates.io-index" 785 | checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" 786 | dependencies = [ 787 | "aho-corasick", 788 | "memchr", 789 | "regex-syntax", 790 | ] 791 | 792 | [[package]] 793 | name = "regex-syntax" 794 | version = "0.8.3" 795 | source = "registry+https://github.com/rust-lang/crates.io-index" 796 | checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" 797 | 798 | [[package]] 799 | name = "rustc-hash" 800 | version = "1.1.0" 801 | source = "registry+https://github.com/rust-lang/crates.io-index" 802 | checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" 803 | 804 | [[package]] 805 | name = "rustc_version" 806 | version = "0.4.0" 807 | source = "registry+https://github.com/rust-lang/crates.io-index" 808 | checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" 809 | dependencies = [ 810 | "semver", 811 | ] 812 | 813 | [[package]] 814 | name = "rustix" 815 | version = "0.38.34" 816 | source = "registry+https://github.com/rust-lang/crates.io-index" 817 | checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" 818 | dependencies = [ 819 | "bitflags", 820 | "errno", 821 | "libc", 822 | "linux-raw-sys", 823 | "windows-sys 0.52.0", 824 | ] 825 | 826 | [[package]] 827 | name = "ryu" 828 | version = "1.0.17" 829 | source = "registry+https://github.com/rust-lang/crates.io-index" 830 | checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" 831 | 832 | [[package]] 833 | name = "same-file" 834 | version = "1.0.6" 835 | source = "registry+https://github.com/rust-lang/crates.io-index" 836 | checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" 837 | dependencies = [ 838 | "winapi-util", 839 | ] 840 | 841 | [[package]] 842 | name = "semver" 843 | version = "1.0.22" 844 | source = "registry+https://github.com/rust-lang/crates.io-index" 845 | checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca" 846 | 847 | [[package]] 848 | name = "serde" 849 | version = "1.0.198" 850 | source = "registry+https://github.com/rust-lang/crates.io-index" 851 | checksum = "9846a40c979031340571da2545a4e5b7c4163bdae79b301d5f86d03979451fcc" 852 | dependencies = [ 853 | "serde_derive", 854 | ] 855 | 856 | [[package]] 857 | name = "serde_derive" 858 | version = "1.0.198" 859 | source = "registry+https://github.com/rust-lang/crates.io-index" 860 | checksum = "e88edab869b01783ba905e7d0153f9fc1a6505a96e4ad3018011eedb838566d9" 861 | dependencies = [ 862 | "proc-macro2", 863 | "quote", 864 | "syn 2.0.60", 865 | ] 866 | 867 | [[package]] 868 | name = "serde_json" 869 | version = "1.0.116" 870 | source = "registry+https://github.com/rust-lang/crates.io-index" 871 | checksum = "3e17db7126d17feb94eb3fad46bf1a96b034e8aacbc2e775fe81505f8b0b2813" 872 | dependencies = [ 873 | "itoa", 874 | "ryu", 875 | "serde", 876 | ] 877 | 878 | [[package]] 879 | name = "strsim" 880 | version = "0.11.1" 881 | source = "registry+https://github.com/rust-lang/crates.io-index" 882 | checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" 883 | 884 | [[package]] 885 | name = "sucds" 886 | version = "0.8.1" 887 | source = "registry+https://github.com/rust-lang/crates.io-index" 888 | checksum = "d53d46182afe6ed822a94c54a532dc0d59691a8f49226bdc4596529ca864cdd6" 889 | dependencies = [ 890 | "anyhow", 891 | "num-traits", 892 | ] 893 | 894 | [[package]] 895 | name = "syn" 896 | version = "1.0.109" 897 | source = "registry+https://github.com/rust-lang/crates.io-index" 898 | checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" 899 | dependencies = [ 900 | "proc-macro2", 901 | "quote", 902 | "unicode-ident", 903 | ] 904 | 905 | [[package]] 906 | name = "syn" 907 | version = "2.0.60" 908 | source = "registry+https://github.com/rust-lang/crates.io-index" 909 | checksum = "909518bc7b1c9b779f1bbf07f2929d35af9f0f37e47c6e9ef7f9dddc1e1821f3" 910 | dependencies = [ 911 | "proc-macro2", 912 | "quote", 913 | "unicode-ident", 914 | ] 915 | 916 | [[package]] 917 | name = "tap" 918 | version = "1.0.1" 919 | source = "registry+https://github.com/rust-lang/crates.io-index" 920 | checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" 921 | 922 | [[package]] 923 | name = "tempfile" 924 | version = "3.10.1" 925 | source = "registry+https://github.com/rust-lang/crates.io-index" 926 | checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" 927 | dependencies = [ 928 | "cfg-if", 929 | "fastrand", 930 | "rustix", 931 | "windows-sys 0.52.0", 932 | ] 933 | 934 | [[package]] 935 | name = "tikv-jemalloc-sys" 936 | version = "0.5.4+5.3.0-patched" 937 | source = "registry+https://github.com/rust-lang/crates.io-index" 938 | checksum = "9402443cb8fd499b6f327e40565234ff34dbda27460c5b47db0db77443dd85d1" 939 | dependencies = [ 940 | "cc", 941 | "libc", 942 | ] 943 | 944 | [[package]] 945 | name = "tikv-jemallocator" 946 | version = "0.5.4" 947 | source = "registry+https://github.com/rust-lang/crates.io-index" 948 | checksum = "965fe0c26be5c56c94e38ba547249074803efd52adfb66de62107d95aab3eaca" 949 | dependencies = [ 950 | "libc", 951 | "tikv-jemalloc-sys", 952 | ] 953 | 954 | [[package]] 955 | name = "tinytemplate" 956 | version = "1.2.1" 957 | source = "registry+https://github.com/rust-lang/crates.io-index" 958 | checksum = "be4d6b5f19ff7664e8c98d03e2139cb510db9b0a60b55f8e8709b689d939b6bc" 959 | dependencies = [ 960 | "serde", 961 | "serde_json", 962 | ] 963 | 964 | [[package]] 965 | name = "unicode-ident" 966 | version = "1.0.12" 967 | source = "registry+https://github.com/rust-lang/crates.io-index" 968 | checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" 969 | 970 | [[package]] 971 | name = "utf8parse" 972 | version = "0.2.1" 973 | source = "registry+https://github.com/rust-lang/crates.io-index" 974 | checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" 975 | 976 | [[package]] 977 | name = "voracious_radix_sort" 978 | version = "1.2.0" 979 | source = "registry+https://github.com/rust-lang/crates.io-index" 980 | checksum = "446e7ffcb6c27a71d05af7e51ef2ee5b71c48424b122a832f2439651e1914899" 981 | dependencies = [ 982 | "rayon", 983 | ] 984 | 985 | [[package]] 986 | name = "walkdir" 987 | version = "2.5.0" 988 | source = "registry+https://github.com/rust-lang/crates.io-index" 989 | checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" 990 | dependencies = [ 991 | "same-file", 992 | "winapi-util", 993 | ] 994 | 995 | [[package]] 996 | name = "wasi" 997 | version = "0.11.0+wasi-snapshot-preview1" 998 | source = "registry+https://github.com/rust-lang/crates.io-index" 999 | checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" 1000 | 1001 | [[package]] 1002 | name = "wasm-bindgen" 1003 | version = "0.2.92" 1004 | source = "registry+https://github.com/rust-lang/crates.io-index" 1005 | checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" 1006 | dependencies = [ 1007 | "cfg-if", 1008 | "wasm-bindgen-macro", 1009 | ] 1010 | 1011 | [[package]] 1012 | name = "wasm-bindgen-backend" 1013 | version = "0.2.92" 1014 | source = "registry+https://github.com/rust-lang/crates.io-index" 1015 | checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" 1016 | dependencies = [ 1017 | "bumpalo", 1018 | "log", 1019 | "once_cell", 1020 | "proc-macro2", 1021 | "quote", 1022 | "syn 2.0.60", 1023 | "wasm-bindgen-shared", 1024 | ] 1025 | 1026 | [[package]] 1027 | name = "wasm-bindgen-macro" 1028 | version = "0.2.92" 1029 | source = "registry+https://github.com/rust-lang/crates.io-index" 1030 | checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" 1031 | dependencies = [ 1032 | "quote", 1033 | "wasm-bindgen-macro-support", 1034 | ] 1035 | 1036 | [[package]] 1037 | name = "wasm-bindgen-macro-support" 1038 | version = "0.2.92" 1039 | source = "registry+https://github.com/rust-lang/crates.io-index" 1040 | checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" 1041 | dependencies = [ 1042 | "proc-macro2", 1043 | "quote", 1044 | "syn 2.0.60", 1045 | "wasm-bindgen-backend", 1046 | "wasm-bindgen-shared", 1047 | ] 1048 | 1049 | [[package]] 1050 | name = "wasm-bindgen-shared" 1051 | version = "0.2.92" 1052 | source = "registry+https://github.com/rust-lang/crates.io-index" 1053 | checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" 1054 | 1055 | [[package]] 1056 | name = "web-sys" 1057 | version = "0.3.69" 1058 | source = "registry+https://github.com/rust-lang/crates.io-index" 1059 | checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" 1060 | dependencies = [ 1061 | "js-sys", 1062 | "wasm-bindgen", 1063 | ] 1064 | 1065 | [[package]] 1066 | name = "winapi-util" 1067 | version = "0.1.8" 1068 | source = "registry+https://github.com/rust-lang/crates.io-index" 1069 | checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" 1070 | dependencies = [ 1071 | "windows-sys 0.52.0", 1072 | ] 1073 | 1074 | [[package]] 1075 | name = "windows-sys" 1076 | version = "0.48.0" 1077 | source = "registry+https://github.com/rust-lang/crates.io-index" 1078 | checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" 1079 | dependencies = [ 1080 | "windows-targets 0.48.5", 1081 | ] 1082 | 1083 | [[package]] 1084 | name = "windows-sys" 1085 | version = "0.52.0" 1086 | source = "registry+https://github.com/rust-lang/crates.io-index" 1087 | checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" 1088 | dependencies = [ 1089 | "windows-targets 0.52.5", 1090 | ] 1091 | 1092 | [[package]] 1093 | name = "windows-targets" 1094 | version = "0.48.5" 1095 | source = "registry+https://github.com/rust-lang/crates.io-index" 1096 | checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" 1097 | dependencies = [ 1098 | "windows_aarch64_gnullvm 0.48.5", 1099 | "windows_aarch64_msvc 0.48.5", 1100 | "windows_i686_gnu 0.48.5", 1101 | "windows_i686_msvc 0.48.5", 1102 | "windows_x86_64_gnu 0.48.5", 1103 | "windows_x86_64_gnullvm 0.48.5", 1104 | "windows_x86_64_msvc 0.48.5", 1105 | ] 1106 | 1107 | [[package]] 1108 | name = "windows-targets" 1109 | version = "0.52.5" 1110 | source = "registry+https://github.com/rust-lang/crates.io-index" 1111 | checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" 1112 | dependencies = [ 1113 | "windows_aarch64_gnullvm 0.52.5", 1114 | "windows_aarch64_msvc 0.52.5", 1115 | "windows_i686_gnu 0.52.5", 1116 | "windows_i686_gnullvm", 1117 | "windows_i686_msvc 0.52.5", 1118 | "windows_x86_64_gnu 0.52.5", 1119 | "windows_x86_64_gnullvm 0.52.5", 1120 | "windows_x86_64_msvc 0.52.5", 1121 | ] 1122 | 1123 | [[package]] 1124 | name = "windows_aarch64_gnullvm" 1125 | version = "0.48.5" 1126 | source = "registry+https://github.com/rust-lang/crates.io-index" 1127 | checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" 1128 | 1129 | [[package]] 1130 | name = "windows_aarch64_gnullvm" 1131 | version = "0.52.5" 1132 | source = "registry+https://github.com/rust-lang/crates.io-index" 1133 | checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" 1134 | 1135 | [[package]] 1136 | name = "windows_aarch64_msvc" 1137 | version = "0.48.5" 1138 | source = "registry+https://github.com/rust-lang/crates.io-index" 1139 | checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" 1140 | 1141 | [[package]] 1142 | name = "windows_aarch64_msvc" 1143 | version = "0.52.5" 1144 | source = "registry+https://github.com/rust-lang/crates.io-index" 1145 | checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" 1146 | 1147 | [[package]] 1148 | name = "windows_i686_gnu" 1149 | version = "0.48.5" 1150 | source = "registry+https://github.com/rust-lang/crates.io-index" 1151 | checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" 1152 | 1153 | [[package]] 1154 | name = "windows_i686_gnu" 1155 | version = "0.52.5" 1156 | source = "registry+https://github.com/rust-lang/crates.io-index" 1157 | checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" 1158 | 1159 | [[package]] 1160 | name = "windows_i686_gnullvm" 1161 | version = "0.52.5" 1162 | source = "registry+https://github.com/rust-lang/crates.io-index" 1163 | checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" 1164 | 1165 | [[package]] 1166 | name = "windows_i686_msvc" 1167 | version = "0.48.5" 1168 | source = "registry+https://github.com/rust-lang/crates.io-index" 1169 | checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" 1170 | 1171 | [[package]] 1172 | name = "windows_i686_msvc" 1173 | version = "0.52.5" 1174 | source = "registry+https://github.com/rust-lang/crates.io-index" 1175 | checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" 1176 | 1177 | [[package]] 1178 | name = "windows_x86_64_gnu" 1179 | version = "0.48.5" 1180 | source = "registry+https://github.com/rust-lang/crates.io-index" 1181 | checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" 1182 | 1183 | [[package]] 1184 | name = "windows_x86_64_gnu" 1185 | version = "0.52.5" 1186 | source = "registry+https://github.com/rust-lang/crates.io-index" 1187 | checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" 1188 | 1189 | [[package]] 1190 | name = "windows_x86_64_gnullvm" 1191 | version = "0.48.5" 1192 | source = "registry+https://github.com/rust-lang/crates.io-index" 1193 | checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" 1194 | 1195 | [[package]] 1196 | name = "windows_x86_64_gnullvm" 1197 | version = "0.52.5" 1198 | source = "registry+https://github.com/rust-lang/crates.io-index" 1199 | checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" 1200 | 1201 | [[package]] 1202 | name = "windows_x86_64_msvc" 1203 | version = "0.48.5" 1204 | source = "registry+https://github.com/rust-lang/crates.io-index" 1205 | checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" 1206 | 1207 | [[package]] 1208 | name = "windows_x86_64_msvc" 1209 | version = "0.52.5" 1210 | source = "registry+https://github.com/rust-lang/crates.io-index" 1211 | checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" 1212 | 1213 | [[package]] 1214 | name = "wyhash" 1215 | version = "0.5.0" 1216 | source = "registry+https://github.com/rust-lang/crates.io-index" 1217 | checksum = "baf6e163c25e3fac820b4b453185ea2dea3b6a3e0a721d4d23d75bd33734c295" 1218 | dependencies = [ 1219 | "rand_core", 1220 | ] 1221 | 1222 | [[package]] 1223 | name = "wyz" 1224 | version = "0.5.1" 1225 | source = "registry+https://github.com/rust-lang/crates.io-index" 1226 | checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" 1227 | dependencies = [ 1228 | "tap", 1229 | ] 1230 | 1231 | [[package]] 1232 | name = "xxhash-rust" 1233 | version = "0.8.10" 1234 | source = "registry+https://github.com/rust-lang/crates.io-index" 1235 | checksum = "927da81e25be1e1a2901d59b81b37dd2efd1fc9c9345a55007f09bf5a2d3ee03" 1236 | 1237 | [[package]] 1238 | name = "yansi" 1239 | version = "0.5.1" 1240 | source = "registry+https://github.com/rust-lang/crates.io-index" 1241 | checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" 1242 | --------------------------------------------------------------------------------