ΠΠ°ΠΊ Π²Ρ Π΄ΡΠΌΠ°Π΅ΡΠ΅, ΡΠΊΠ²ΠΈΠ²Π°Π»Π΅Π½ΡΡ Π»ΠΈ ΠΏΠΎ ΠΏΡΠΎΠΈΠ·Π²ΠΎΠ΄ΠΈΡΠ΅Π»ΡΠ½ΠΎΡΡΠΈ ΡΡΠΈ Π΄Π²Π° Π²Π°ΡΠΈΠ°Π½ΡΠ° ΠΏΡΠΎΠ²Π΅ΡΠΊΠΈ ΡΡΠ»ΠΎΠ²ΠΈΠΉ Π²Π½ΡΡΡΠΈ ΡΠΈΠΊΠ»Π°?
if a > b && c*2 > d {
....
}
// ΠΈ
if a <= b {
continue;
}
if c*2 > d {
....
}
ΠΡΠ΅ Π½Π°ΡΠ°Π»ΠΎΡΡ Ρ Β«ΡΠ°Π·ΠΌΠΈΠ½ΠΊΠΈ Π΄Π»Ρ ΠΌΠΎΠ·Π³ΠΎΠ²Β», Π½Π°Π΄ΠΎ Π±ΡΠ»ΠΎ ΠΏΡΠΈΠ²Π΅ΡΡΠΈ ΠΏΡΠΈΠΌΠ΅Ρ ΠΎΠΏΡΠΈΠΌΠ°Π»ΡΠ½ΠΎΠ³ΠΎ ΠΏΠΎΠΈΡΠΊΠ° ΠΏΠΎ ΠΌΠ°ΡΡΠΈΠ²Ρ ΡΠ΅Π»ΡΡ
ΡΠΈΡΠ΅Π» [-x….x] Π½Π°ΠΈΠ±ΠΎΠ»ΡΡΠ΅Π³ΠΎ ΡΠ΅ΡΠ½ΠΎΠ³ΠΎ ΡΠΈΡΠ»Π°. ΠΠ½Π΅ ΡΡΠ°Π»ΠΎ ΠΈΠ½ΡΠ΅ΡΠ΅ΡΠ½ΠΎ, Π½Π°ΡΠΊΠΎΠ»ΡΠΊΠΎ Π±ΡΠ΄Π΅Ρ Π²ΡΡΠ΅ ΠΏΡΠΎΠΈΠ·Π²ΠΎΠ΄ΠΈΡΠ΅Π»ΡΠ½ΠΎΡΡΡ, Π΅ΡΠ»ΠΈ Π΄Π»Ρ Π²ΡΡΡΠ½Π΅Π½ΠΈΡ ΡΠ΅ΡΠ½ΠΎΠ΅ ΡΠΈΡΠ»ΠΎ ΠΈΠ»ΠΈ Π½Π΅Ρ, ΠΈΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°ΡΡ Π»ΠΎΠ³ΠΈΡΠ΅ΡΠΊΠΎΠ΅ ΡΠΌΠ½ΠΎΠΆΠ΅Π½ΠΈΠ΅ Π½Π° 1.
//Ρ ΡΠ΅ΡΠ½ΡΡ
ΡΠΈΡΠ΅Π» ΠΏΠΎΡΠ»Π΅Π΄Π½ΠΈΠΉ Π±ΠΈΡ Π²ΡΠ΅Π³Π΄Π° ΡΠ°Π²Π΅Π½ 0
value & 1 == 0
//vs ΠΊΠ»Π°ΡΡΠΈΡΠ΅ΡΠΊΠΈΠΉ ΠΌΠ΅ΡΠΎΠ΄
value % 2 == 0
ΠΠΎΠΉ ΠΎΠΏΡΡ ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΠΈΡΠΎΠ²Π°Π½ΠΈΡ Π½Π° Go Π½Π΅ ΠΎΡΠ΅Π½Ρ Π±ΠΎΠ»ΡΡΠΎΠΉ, ΡΡΡΡ Π±ΠΎΠ»Π΅Π΅ ΠΏΠΎΠ»ΡΡΠΎΡΠ° Π»Π΅Ρ, ΠΈΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°Π» Ρ Π΅Π³ΠΎ Ρ ΠΎΡΡ ΠΈ ΡΠ°ΡΡΠΎ, Π½ΠΎ ΡΠΈΡΡΠΎ Π² ΡΡΠΈΠ»ΠΈΡΠ°ΡΠ½ΡΡ ΡΠ΅Π»ΡΡ (Π½Ρ ΠΌΠΎΠΆΠ΅Ρ Π±ΡΡΡ ΠΊΡΠΎΠΌΠ΅ ΠΎΠ΄Π½ΠΎΠ³ΠΎ ΠΏΡΠΎΠ΅ΠΊΡΠ° ΡΠ²ΡΠ·Π°Π½Π½ΠΎΠ³ΠΎ Ρ Π²ΡΡΠΎΠΊΠΎΠ½Π°Π³ΡΡΠΆΠ΅Π½Π½ΡΠΌ http ΡΠ΅ΡΠ²ΠΈΡΠΎΠΌ), ΠΏΠΎΡΡΠΎΠΌΡ Π½Π°ΡΠ°Π» Ρ ΠΈΠΌΠ΅Π½Π½ΠΎ Ρ Π½Π΅Π³ΠΎ. ΠΡΠΊΡΡΠ²Π°Π΅ΠΌ GoLand ΠΈ ΠΏΠΈΡΠ΅ΠΌ ΠΏΡΠΎΡΡΠ΅Π½ΡΠΊΠΈΠΉ ΡΠ΅ΡΡ
package main
import (
"fmt"
"log"
"math"
"math/rand"
"time"
)
const size = 100000000 //math.MaxInt32*2
type Result struct {
Name string
Duration time.Duration
Value int32
}
func main() {
log.Println("initial array capacity: " + fmt.Sprint(size))
var maxValue int32
// ΠΡΠ΄Π΅ΠΌ Π²Π°ΡΡΠΈΡΠΎΠ²Π°ΡΡ Π΄ΠΈΠ°ΠΏΠ°Π·ΠΎΠ½ ΡΠΈΡΠ΅Π» ΠΎΡ ΠΌΠΈΠ½ΠΈΠΌΠ°Π»ΡΠ½ΠΎΠ³ΠΎ
// Π΄ΠΎ ΠΌΠ°ΠΊΡΠΈΠΌΠ°Π»ΡΠ½ΠΎΠ³ΠΎ. Π§Π΅ΠΌ ΠΌΠ΅Π½ΡΡΠ΅ Π΄ΠΈΠ°ΠΏΠ°Π·ΠΎΠ½, ΡΠ΅ΠΌ Π±ΠΎΠ»ΡΡΠ΅
// ΠΏΡΠΎΡΠ΅ΡΡΠΎΡΠ½ΠΎΠ³ΠΎ Π²ΡΠ΅ΠΌΠ΅Π½ΠΈ Π±ΡΠ΄Π΅Ρ ΡΡ
ΠΎΠ΄ΠΈΡΡ Π½Π° ΠΎΠΏΠ΅ΡΠ°ΡΠΈΡ
// ΡΡΠ°Π²Π½Π΅Π½ΠΈΡ ΡΠ΅ΠΊΡΡΠ΅Π³ΠΎ ΡΠΈΡΠ»Π°, Ρ ΡΠ°Π½Π΅Π΅ Π½Π°ΠΉΠ΄Π΅Π½Π½ΡΠΌ ΠΈ Π½Π°ΠΎΠ±ΠΎΡΠΎΡ
for maxValue = 128; maxValue < math.MaxInt32/2+1; maxValue = maxValue * 2 {
test(maxValue)
}
}
func test(maxValue int32) {
log.Println("max threshold: " + fmt.Sprint(maxValue))
arr := make([]int32, size)
for i := range arr {
arr[i] = rand.Int31n(maxValue)
// Π² ΡΠ΅ΡΡΠΎΠ²ΡΡ
Π΄Π°Π½Π½ΡΡ
Π½Π°ΠΌ Π½ΡΠΆΠ½Ρ ΠΈ ΠΎΡΡΠΈΡΠ°ΡΠ΅Π»ΡΠ½ΡΠ΅ ΡΠΈΡΠ»Π°
sign := rand.Intn(2)
if sign == 1 {
arr[i] = -arr[i]
}
}
// Π·Π°ΠΏΡΡΠΊΠ°Π΅ΠΌ ΡΠ΅ΡΡ "Π΄Π΅Π»Π΅Π½ΠΈΠ΅ Ρ ΠΎΡΡΠ°ΡΠΊΠΎΠΌ"
result := maxEvenDividing("maxEvenDividing", arr)
log.Printf(result.Name+"t result: "+fmt.Sprint(result.Value)+"ttduration %s", result.Duration)
// Π·Π°ΠΏΡΡΠΊΠ°Π΅ΠΌ ΡΠ΅ΡΡ "ΠΊΠΎΠ½ΡΡΠ½ΠΊΡΠΈΠΈ"
result = maxEvenConjunction("maxEvenConjunction", arr)
log.Printf(result.Name+"t result: "+fmt.Sprint(result.Value)+"ttduration %s", result.Duration)
}
func maxEvenDividing(name string, arr []int32) Result {
start := time.Now()
var current int32 = math.MinInt32
for _, value := range arr {
if value > current && value%2 == 0 {
current = value
}
}
duration := time.Since(start)
result := Result{name, duration, current}
return result
}
func maxEvenConjunction(name string, arr []int32) Result {
start := time.Now()
var current int32 = math.MinInt32
for _, value := range arr {
if value > current && value&1 == 0 {
current = value
}
}
duration := time.Since(start)
result := Result{name, duration, current}
return result
}
ΠΠΎΠ»ΡΡΠ°Π΅ΠΌ ΡΠ΅Π·ΡΠ»ΡΡΠ°Ρ, Π½Π° ΠΊΠΎΡΠΎΡΠΎΠΌ Π²ΠΈΠ΄Π½ΠΎ, ΡΡΠΎ ΡΠ΅ΠΌ Π±ΠΎΠ»ΡΡΠ΅ threshold, ΡΠ΅ΠΌ Π²ΡΠ΅ ΡΠ°ΡΠ΅ ΠΏΠΎΡΠ²Π»ΡΡΡΡΡ ΡΠ»ΡΠΊΡΡΠ°ΡΠΈΠΈ ΠΏΠΎ ΡΠ°ΡΡΠΈ ΠΏΡΠΎΠΈΠ·Π²ΠΎΠ΄ΠΈΡΠ΅Π»ΡΠ½ΠΎΡΡΠΈ.
Π‘ΡΠ°Π²Π½ΠΈΡΠ΅max threshold: 128
maxEvenDividing result: 126 duration 116.0067ms
maxEvenConjunction result: 126 duration 116.0066ms
max threshold: 16384
maxEvenDividing result: 16382 duration 115.0066ms
maxEvenConjunction result: 16382 duration 111.0064ms
......
max threshold: 8388608
maxEvenDividing result: 8388606 duration 109.0063ms
maxEvenConjunction result: 8388606 duration 109.0062ms
max threshold: 16777216
maxEvenDividing result: 16777214 duration 108.0062ms
maxEvenConjunction result: 16777214 duration 109.0062ms
max threshold: 33554432
maxEvenDividing result: 33554430 duration 114.0066ms
maxEvenConjunction result: 33554430 duration 110.0063ms
max threshold: 67108864
maxEvenDividing result: 67108860 duration 111.0064ms
maxEvenConjunction result: 67108860 duration 109.0062ms
max threshold: 134217728
maxEvenDividing result: 134217726 duration 108.0062ms
maxEvenConjunction result: 134217726 duration 109.0063ms
max threshold: 268435456
maxEvenDividing result: 268435446 duration 111.0063ms
maxEvenConjunction result: 268435446 duration 110.0063ms
ΠΠΎΠ½ΡΡΠ½ΠΎ, ΡΡΠΎ Π² Π΄Π°Π½Π½ΠΎΠΌ ΡΠ»ΡΡΠ°Π΅, Π΄Π»Ρ ΡΠ°Π·Π½ΡΡ
threshold ΠΌΡ ΠΈΠΌΠ΅Π΅ΠΌ ΡΠ°Π·Π½ΡΠ΅ Π½Π°Π±ΠΎΡΡ ΡΠ΅ΡΡΠΎΠ²ΡΡ
Π΄Π°Π½Π½ΡΡ
, Π·Π°Π³ΡΡΠ·ΠΊΠ° ΠΏΡΠΎΡΠ΅ΡΡΠΎΡΠ° (Π½Π° ΠΌΠΎΠ΅ΠΌ Π½ΠΎΡΡΠ±ΡΠΊΠ΅ i5-2540M) Π²Π°ΡΡΠΈΡΡΠ΅ΡΡΡ Π² ΡΠ°ΠΉΠΎΠ½Π΅ 20..30%, ΠΏΠ°ΠΌΡΡΡ Π·Π°Π½ΠΈΠΌΠ°Π΅ΠΌΠ°Ρ ΠΏΡΠΈΠ»ΠΎΠΆΠ΅Π½ΠΈΠ΅ΠΌ Π·Π°ΠΏΡΡΠ΅Π½Π½ΡΠΌ ΠΈΠ· ΠΏΠΎΠ΄ GoLand Π² ΡΡΠ΅Π΄Π½Π΅ΠΌ ΠΎΠΊΠΎΠ»ΠΎ 813ΠΠ± β ΡΡΠΎ ΡΠΎΠΆΠ΅ Π²Π»ΠΈΡΠ΅Ρ Π½Π° Π΄ΠΎΡΡΠΎΠ²Π΅ΡΠ½ΠΎΡΡΡ ΡΠ΅Π·ΡΠ»ΡΡΠ°ΡΠ°, Π½ΡΠΆΠ½ΠΎ ΡΠ΅Π°Π»ΠΈΠ·ΠΎΠ²Π°ΡΡ ΡΠΎΡ
ΡΠ°Π½Π΅Π½ΠΈΠ΅ ΡΠ΅ΡΡΠΎΠ²ΡΡ
Π½Π°Π±ΠΎΡΠΎΠ² Π½Π° Π΄ΠΈΡΠΊΠ΅ ΠΈ ΠΏΡΠΎΠ³Π½Π°ΡΡ Π²ΡΠ΅ ΡΠ΅ΡΡΡ Π΄Π»Ρ ΠΊΠ°ΠΆΠ΄ΠΎΠ³ΠΎ threshold ΠΈΠ·ΠΎΠ»ΠΈΡΠΎΠ²Π°Π½ΠΎ Π΄ΡΡΠ³ ΠΎΡ Π΄ΡΡΠ³Π°.
Π Π²ΠΎΡ ΡΠ°Π·Π΄ΡΠΌΡΠ²Π°Ρ Π½Π°Π΄ ΡΠ΅ΠΌ ΠΊΠ°ΠΊ-Π±Ρ Ρ ΠΌΠΈΠ½ΠΈΠΌΠ°Π»ΡΠ½ΡΠΌΠΈ Π·Π°ΡΡΠ°ΡΠ°ΠΌΠΈ Π²ΡΠ΅ ΡΡΠΎ ΡΠ΅Π°Π»ΠΈΠ·ΠΎΠ²Π°ΡΡ, Ρ ΠΌΠ°ΡΠΈΠ½Π°Π»ΡΠ½ΠΎ ΠΈΡΠΏΡΠ°Π²Π»ΡΡ ΠΏΡΠΎΠ²Π΅ΡΠΊΡ ΡΡΠ»ΠΎΠ²ΠΈΡ
if value > current && value&1 == 0 {
current = value
}
Π½Π°
if value <= current {
continue;
}
if value&1 == 0 {
current = value
}
Π·Π°ΠΏΡΡΠΊΠ°Ρ ΡΠ΅ΡΡΡ Π΅ΡΠ΅ ΡΠ°Π·β¦ ΠΈ ΠΏΠ΅ΡΠ΅ΡΡΠ°Ρ ΡΡΠΎ Π»ΠΈΠ±ΠΎ ΠΏΠΎΠ½ΠΈΠΌΠ°ΡΡ π
ΠΡΠ΅ΠΌΡ Π·Π°ΡΡΠ°ΡΠΈΠ²Π°Π΅ΠΌΠΎΠ΅ Π½Π° Π²ΡΠΏΠΎΠ»Π½Π΅Π½ΠΈΠ΅ Π½Π°ΡΠΈΠ½Π°Π΅Ρ ΠΎΡΠ»ΠΈΡΠ°ΡΡΡΡ ΡΠΆΠ΅ Π½Π΅ Π½Π° ΠΏΡΠΎΡΠ΅Π½ΡΡ/Π΄ΠΎΠ»ΠΈ ΠΏΡΠΎΡΠ΅Π½ΡΠ°, Π° Π½Π° 10..15% ΠΡΡΡΡΠΎ Π΄ΠΎΠΏΠΈΡΡΠ²Π°Ρ Π΅ΡΠ΅ 2 ΡΠ΅ΡΡΠ°:
func maxEvenDividing2(name string, arr []int32) Result {
start := time.Now()
var current int32 = math.MinInt32
for _, value := range arr {
if value <= current {
continue
}
if value%2 == 0 {
current = value
}
}
duration := time.Since(start)
result := Result{name, duration, current}
return result
}
func maxEvenConjunction2(name string, arr []int32) Result {
start := time.Now()
var current int32 = math.MinInt32
for _, value := range arr {
if value <= current {
continue
}
if value&1 == 0 {
current = value
}
}
duration := time.Since(start)
result := Result{name, duration, current}
return result
}
Π·Π°ΠΏΡΡΠΊΠ°Ρ ΠΈ ΠΏΠΎΠ»ΡΡΠ°Ρ Π²ΠΎΡ ΡΠ°ΠΊΡΡ ΠΊΠ°ΡΡΠΈΠ½ΠΊΡ:initial array capacity: 100000000
max threshold: 128
maxEvenDividing result: 126 duration 116.0066ms
maxEvenDividing2 result: 126 duration 79.0045ms
maxEvenConjunction result: 126 duration 114.0065ms
maxEvenConjunction2 result: 126 duration 83.0048ms
max threshold: 256
maxEvenDividing result: 254 duration 111.0063ms
maxEvenDividing2 result: 254 duration 77.0044ms
maxEvenConjunction result: 254 duration 110.0063ms
maxEvenConjunction2 result: 254 duration 80.0046ms
max threshold: 512
maxEvenDividing result: 510 duration 114.0066ms
maxEvenDividing2 result: 510 duration 80.0045ms
maxEvenConjunction result: 510 duration 110.0063ms
maxEvenConjunction2 result: 510 duration 80.0046ms
max threshold: 1024
maxEvenDividing result: 1022 duration 109.0063ms
maxEvenDividing2 result: 1022 duration 77.0044ms
maxEvenConjunction result: 1022 duration 111.0063ms
maxEvenConjunction2 result: 1022 duration 81.0047ms
max threshold: 2048
maxEvenDividing result: 2046 duration 114.0065ms
maxEvenDividing2 result: 2046 duration 79.0045ms
maxEvenConjunction result: 2046 duration 113.0065ms
maxEvenConjunction2 result: 2046 duration 81.0046ms
max threshold: 4096
maxEvenDividing result: 4094 duration 114.0065ms
maxEvenDividing2 result: 4094 duration 80.0046ms
maxEvenConjunction result: 4094 duration 111.0063ms
maxEvenConjunction2 result: 4094 duration 78.0045ms
max threshold: 8192
maxEvenDividing result: 8190 duration 107.0062ms
maxEvenDividing2 result: 8190 duration 77.0044ms
maxEvenConjunction result: 8190 duration 111.0063ms
maxEvenConjunction2 result: 8190 duration 77.0044ms
max threshold: 16384
maxEvenDividing result: 16382 duration 109.0063ms
maxEvenDividing2 result: 16382 duration 77.0044ms
maxEvenConjunction result: 16382 duration 108.0062ms
maxEvenConjunction2 result: 16382 duration 77.0044ms
max threshold: 32768
maxEvenDividing result: 32766 duration 112.0064ms
maxEvenDividing2 result: 32766 duration 77.0044ms
maxEvenConjunction result: 32766 duration 109.0062ms
maxEvenConjunction2 result: 32766 duration 78.0045ms
max threshold: 65536
maxEvenDividing result: 65534 duration 109.0062ms
maxEvenDividing2 result: 65534 duration 75.0043ms
maxEvenConjunction result: 65534 duration 109.0063ms
maxEvenConjunction2 result: 65534 duration 79.0045ms
max threshold: 131072
maxEvenDividing result: 131070 duration 108.0061ms
maxEvenDividing2 result: 131070 duration 76.0044ms
maxEvenConjunction result: 131070 duration 110.0063ms
maxEvenConjunction2 result: 131070 duration 80.0046ms
max threshold: 262144
maxEvenDividing result: 262142 duration 110.0063ms
maxEvenDividing2 result: 262142 duration 76.0044ms
maxEvenConjunction result: 262142 duration 107.0061ms
maxEvenConjunction2 result: 262142 duration 78.0044ms
max threshold: 524288
maxEvenDividing result: 524286 duration 109.0062ms
maxEvenDividing2 result: 524286 duration 78.0045ms
maxEvenConjunction result: 524286 duration 109.0062ms
maxEvenConjunction2 result: 524286 duration 80.0046ms
max threshold: 1048576
maxEvenDividing result: 1048574 duration 109.0063ms
maxEvenDividing2 result: 1048574 duration 80.0045ms
maxEvenConjunction result: 1048574 duration 114.0066ms
maxEvenConjunction2 result: 1048574 duration 78.0044ms
max threshold: 2097152
maxEvenDividing result: 2097150 duration 111.0064ms
maxEvenDividing2 result: 2097150 duration 79.0045ms
maxEvenConjunction result: 2097150 duration 112.0064ms
maxEvenConjunction2 result: 2097150 duration 77.0044ms
max threshold: 4194304
maxEvenDividing result: 4194302 duration 111.0063ms
maxEvenDividing2 result: 4194302 duration 78.0045ms
maxEvenConjunction result: 4194302 duration 111.0063ms
maxEvenConjunction2 result: 4194302 duration 77.0044ms
max threshold: 8388608
maxEvenDividing result: 8388606 duration 109.0062ms
maxEvenDividing2 result: 8388606 duration 78.0045ms
maxEvenConjunction result: 8388606 duration 114.0065ms
maxEvenConjunction2 result: 8388606 duration 78.0045ms
max threshold: 16777216
maxEvenDividing result: 16777214 duration 109.0062ms
maxEvenDividing2 result: 16777214 duration 77.0044ms
maxEvenConjunction result: 16777214 duration 109.0063ms
maxEvenConjunction2 result: 16777214 duration 77.0044ms
max threshold: 33554432
maxEvenDividing result: 33554430 duration 113.0065ms
maxEvenDividing2 result: 33554430 duration 78.0045ms
maxEvenConjunction result: 33554430 duration 110.0063ms
maxEvenConjunction2 result: 33554430 duration 80.0045ms
max threshold: 67108864
maxEvenDividing result: 67108860 duration 112.0064ms
maxEvenDividing2 result: 67108860 duration 77.0044ms
maxEvenConjunction result: 67108860 duration 112.0064ms
maxEvenConjunction2 result: 67108860 duration 80.0046ms
max threshold: 134217728
maxEvenDividing result: 134217726 duration 109.0063ms
maxEvenDividing2 result: 134217726 duration 78.0044ms
maxEvenConjunction result: 134217726 duration 114.0065ms
maxEvenConjunction2 result: 134217726 duration 81.0047ms
max threshold: 268435456
maxEvenDividing result: 268435446 duration 111.0064ms
maxEvenDividing2 result: 268435446 duration 79.0045ms
maxEvenConjunction result: 268435446 duration 114.0065ms
maxEvenConjunction2 result: 268435446 duration 79.0045ms
max threshold: 536870912
maxEvenDividing result: 536870910 duration 107.0062ms
maxEvenDividing2 result: 536870910 duration 76.0043ms
maxEvenConjunction result: 536870910 duration 109.0062ms
maxEvenConjunction2 result: 536870910 duration 80.0046ms
ΠΠ½ΡΡΠ½ΠΎΠ³ΠΎ ΠΎΠ±ΡΡΡΠ½Π΅Π½ΠΈΡ, ΠΏΠΎΡΠ΅ΠΌΡ ΠΊΠΎΠΌΠΏΠΈΠ»ΡΡΠΎΡ Go Π½Π΅ ΠΎΠΏΡΠΈΠΌΠΈΠ·ΠΈΡΡΠ΅Ρ ΠΊΠΎΠ΄ ΠΈ Π²ΡΠ΅Π³Π΄Π° ΠΏΡΠΎΠ²Π΅ΡΡΠ΅Ρ Π²ΡΠΎΡΠΎΠ΅ ΡΡΠ»ΠΎΠ²ΠΈΠ΅, Π΄Π°ΠΆΠ΅ Π΅ΡΠ»ΠΈ ΠΏΠ΅ΡΠ²ΠΎΠ΅ Π»ΠΎΠΆΠ½ΠΎ β Ρ Π½Π΅ Π½Π°ΡΠ΅Π». Π ΠΌΠΎΠΆΠ΅Ρ Ρ ΠΌΠ΅Π½Ρ ΠΏΡΠΎΡΡΠΎ Π³Π»Π°Π· Β«Π·Π°ΠΌΡΠ»ΠΈΠ»ΡΡΒ» ΠΈ Ρ Π½Π΅ Π²ΠΈΠΆΡ ΠΊΠ°ΠΊΠΎΠΉ ΡΠΎ ΠΎΡΠ΅Π²ΠΈΠ΄Π½ΠΎΠΉ ΠΎΡΠΈΠ±ΠΊΠΈ? ΠΠ»ΠΈ Π½Π°Π΄ΠΎ ΡΠΊΠ°Π·ΡΠ²Π°ΡΡ ΠΊΠ°ΠΊΠΈΠ΅ ΡΠΎ ΠΎΡΠΎΠ±Π΅Π½Π½ΡΠ΅ ΠΈΠ½ΡΡΡΡΠΊΡΠΈΠΈ ΠΊΠΎΠΌΠΏΠΈΠ»ΡΡΠΎΡΡ? ΠΡΠ» Π±Ρ ΡΠ°Π΄ ΡΠΎΠ»ΠΊΠΎΠ²ΡΠΌ ΠΊΠΎΠΌΠΌΠ΅Π½ΡΠ°ΡΠΈΡΠΌ.
PS: ΠΠ°, Π΄Π»Ρ ΠΈΠ½ΡΠ΅ΡΠ΅ΡΠ°, ΠΏΡΠΎΠ³Π½Π°Π» Π°Π½Π°Π»ΠΎΠ³ΠΈΡΠ½ΡΠ΅ ΡΠ΅ΡΡΡ Π½Π° Java 5 ΠΈ Java 7/8 β Π²ΡΠ΅ ΡΠ΅ΡΠΊΠΎ, Π²ΡΠ΅ΠΌΡ Π²ΡΠΏΠΎΠ»Π½Π΅Π½ΠΈΡ ΠΎΠ΄ΠΈΠ½Π°ΠΊΠΎΠ²ΠΎΠ΅.
ΠΡΡΠΎΡΠ½ΠΈΠΊ: habr.com