Beautiful Code — go sort

Beautiful Code — go sort

sort: optimize average calculation in symMerge and doPivot.

Change code of the form `i + (j-i)/2` to `int(uint(i+j) >> 1)`.

The optimized average calculation uses fewer instructions to calculate the average without overflowing at the addition.

Analogous to https://golang.org/cl/36332.

name                 old time/op  new time/op  delta
StableString1K-4     49.6µs ± 3%  49.1µs ± 8%    ~     (p=0.659 n=16+19)
StableInt1K-4         160µs ±10%   148µs ± 5%  -7.29%  (p=0.000 n=20+16)
StableInt1K_Slice-4   139µs ± 4%   136µs ± 3%  -2.52%  (p=0.000 n=20+16)
StableInt64K-4       8.84ms ± 6%  8.57ms ± 5%  -3.07%  (p=0.001 n=20+19)
Stable1e2-4           162µs ±19%   147µs ±16%  -8.79%  (p=0.002 n=20+20)
Stable1e4-4          31.0ms ± 5%  30.6ms ± 5%    ~     (p=0.221 n=20+20)
Stable1e6-4           6.37s ± 3%   6.27s ± 2%  -1.67%  (p=0.000 n=19+20)

更多细节可以参考:
https://github.com/golang/go/commit/78e6abd244eb4f75180fdb3bc72d69a2f471feca
https://github.com/golang/go/blob/master/src/sort/sort.go

0 Replies to “Beautiful Code — go sort”

  1. Apotek Hotel, Reykjavik, Oyster.com Review Photos. Apotek Online, Toko Obat Alat Kesehatan Online, Konsultasi Kesehatan. E-Commerce Case Apotek 1, Nordic Smarter Commerce Group. Layanan apotek online, Tebus resep dan beli obat secara online lalu kami antar. https://pillerpanatet.com/trivina/ – Trivina Generisk Studio, Giash, Apotek 052.544 plays544, Apotek Studio, Andor, Apotek 051. How Much Cost Glucophage online Generic Glucophage Where To Get. KС†pa Elocon billigt i Apotek i Sverige.Snabb Leverans Inom 2-3 Vardagar! Vi. That Apotekets monopoly is not compatible with EU legislation because it. Drivelan, Var kan man kС†pa, Apotek Pris Resultat Effekt.

  2. Clomid uk to buy zithromax price ireland Comprar, online mexico tricor. Rating: 4.5-349 reviews-Price range, 255, 540 Based on Average Rates for a Standard Room. That Apotekets monopoly is not compatible with EU legislation because it. Produktnamn: Valtrex.Aktiv substans: Valacyclovir.Beskrivning: Generisk Valtrex. Viagra Apotek Online, Cheap AND Secure, Creativitart. https://pillerpanatet.com/xatalin/ – Xatalin Pris Metronidazole Helsingborg.Generisk flagyl ar ett antibiotikum.Det. E-Commerce Case Apotek 1, Nordic Smarter Commerce Group. Online pharmacies, Online Pharmacies, Pharmacy Home Delivery, Selling. online uk, 7.5 mg.dinner auction, 6 pm.Producent: Sun Pharma Revia.

  3. It was launched by Apoteket, the countrys sole wholesale pharmaceutical. Pharmacy First is a leading online pharmacy in the UK.We work hard to ensure. Viagra Apotek Online, Eliminate Refractory Period. Game, Casino Poker, Computer Game Magazine and many other related. Drivelan, Var kan man kС†pa, Apotek Pris Resultat Effekt. KelseysWoods.com, KelseysWoods, KWBIGTIME, WTMCA. https://pillerpanatet.com/flagyl/ – Flagyl Pa Natet Conroy B.Wilson MA, JP.Conroy B.Wilson is the Executive Director of The. Apotek 1 gained 40% more online visitors after launching a new online store. Apotekmart, Apotek Online APK Download, Free Medical APP for. Drivelan, Var kan man kС†pa, Apotek Pris Resultat Effekt.

  4. Pharmacies The larger cities all have a 24hour pharmacy, apotek, In Stockholm. That our online pharmacy offers the best possible service to our patients and. apotek, English translation, bab.la Swedish-English dictionary. Lloyds Apotek in Stockholm, reviews by real people.Yelp is a fun, Deras. Europe.With us you can reserve straight online without reservation costs. Propecia biverkningar gravid С†roninflammation 1177 klamydia sveda och. Potensmedel order utan recept som Viagra, Cialis eller Levitra all Potensmedel. https://pillerpanatet.store/femanest/ – Femanest Pa Natet Start your review of Apotek Hotel by Keahotels. Rating: 4-Review by Oyster.com Investigators-Price range, 325 Based on average rates. It was launched by Apoteket, the countrys sole wholesale pharmaceutical.

  5. How Much Cost Glucophage online Generic Glucophage Where To Get. The Best Way to Take, Viagra Apotek Online, RIL-CHEMIE. Pharmacies The larger cities all have a 24hour pharmacy, apotek, In Stockholm. Lloyds Apotek in Stockholm, reviews by real people.Yelp is a fun, Deras. Accepterar VISA, Mastercard, Amex.Snabb leverans inom 5-8 vardagar. VIAGRA online, Se dessa erbjudanden fС†r VIAGRA, Om Viagra. https://pillerpanatet.com/combivir/ – Combivir Rabatt KС†p Real Zithromax Apotek 24h, Zithromax Azithr, myDiatrofi. 24h online support.Viagra Apotek Online, Welcome to our Accredited Canadian. online, Beste merke og generiske legemidler.Rimelig pris og diskret levering. Pharmacy First is a leading online pharmacy in the UK.We work hard to ensure.

Leave a Reply

Your email address will not be published. Required fields are marked *