Created
February 17, 2016 18:21
-
-
Save nmk/ed115b30480a30cc917c to your computer and use it in GitHub Desktop.
Bad Vector dropWhile performance Core
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
==================== Tidy Core ==================== | |
2016-02-17 18:20:25.680333 UTC | |
Result size of Tidy Core = {terms: 869, types: 656, coercions: 162} | |
lvl_rdKT | |
lvl_rdKT = | |
case $wshowSignedInt 0 10000000 ([]) | |
of _ { (# ww5_a93C, ww6_a93D #) -> | |
: ww5_a93C ww6_a93D | |
} | |
lvl1_rdKU | |
lvl1_rdKU = | |
unpackAppendCString# | |
"Primitive.basicUnsafeNew: length to large: "# lvl_rdKT | |
lvl2_rdKV | |
lvl2_rdKV = | |
\ @ s_a8lQ s1_a8lR -> | |
case divInt# 9223372036854775807 8 of ww4_a92V { __DEFAULT -> | |
case tagToEnum# (># 10000000 ww4_a92V) of _ { | |
False -> | |
case newByteArray# 80000000 (s1_a8lR `cast` ...) | |
of _ { (# ipv_a8MY, ipv1_a8MZ #) -> | |
letrec { | |
$s$wa_sdm4 | |
$s$wa_sdm4 = | |
\ sc_sdlZ sc1_sdm0 sc2_sdm1 sc3_sdm3 -> | |
case tagToEnum# (># sc2_sdm1 0) of _ { | |
False -> (# sc3_sdm3, I# sc_sdlZ #); | |
True -> | |
case writeDoubleArray# | |
ipv1_a8MZ sc_sdlZ sc1_sdm0 (sc3_sdm3 `cast` ...) | |
of s'#_aaA0 { __DEFAULT -> | |
$s$wa_sdm4 | |
(+# sc_sdlZ 1) | |
(+## sc1_sdm0 1.0) | |
(-# sc2_sdm1 1) | |
(s'#_aaA0 `cast` ...) | |
} | |
}; } in | |
case $s$wa_sdm4 0 0.0 10000000 (ipv_a8MY `cast` ...) | |
of _ { (# ipv6_a8hW, ipv7_a8hX #) -> | |
case ipv7_a8hX of _ { I# dt4_a94m -> | |
case unsafeFreezeByteArray# ipv1_a8MZ (ipv6_a8hW `cast` ...) | |
of _ { (# ipv2_a8L0, ipv3_a8L1 #) -> | |
(# ipv2_a8L0 `cast` ..., | |
(Vector 0 dt4_a94m ipv3_a8L1) `cast` ... #) | |
} | |
} | |
} | |
}; | |
True -> case error lvl1_rdKU of wild_00 { } | |
} | |
} | |
lvl3_rdKW | |
lvl3_rdKW = runSTRep lvl2_rdKV | |
a_rdKX | |
a_rdKX = \ s_a9b0 -> (# s_a9b0, lvl3_rdKW #) | |
a1_rdKY | |
a1_rdKY = | |
\ x_a8al -> | |
case x_a8al `cast` ... | |
of _ { Vector ipv_saQz ipv1_saQA ipv2_saQB -> | |
(I# ipv1_saQA) `cast` ... | |
} | |
main5 | |
main5 = unpackCString# "dropWhile'"# | |
main6 | |
main6 = unpackCString# "V.dropWhile"# | |
main7 | |
main7 = unpackCString# "noDrop"# | |
main8 | |
main8 = unpackCString# "funcs"# | |
bDropWhile'2 | |
bDropWhile'2 = unpackCString# "(!)"# | |
bDropWhile'3 | |
bDropWhile'3 = I# 235 | |
bDropWhile'4 | |
bDropWhile'4 = unpackCString# "./Data/Vector/Generic.hs"# | |
bNoDrop1 | |
bNoDrop1 = | |
\ y_a8cW -> | |
checkError | |
bDropWhile'4 | |
bDropWhile'3 | |
Bounds | |
bDropWhile'2 | |
(checkIndex_msg# 0 y_a8cW) | |
$sdrop_$slength | |
$sdrop_$slength = a1_rdKY `cast` ... | |
bNoDrop2 | |
bNoDrop2 = | |
\ x1_a8bx n#_a8ck -> | |
checkError | |
bDropWhile'4 | |
bDropWhile'3 | |
Bounds | |
bDropWhile'2 | |
(checkIndex_msg# x1_a8bx n#_a8ck) | |
lvl7_rdL6 | |
lvl7_rdL6 = | |
\ @ s2_a8g5 ww_sbFE -> | |
error | |
(unpackAppendCString# | |
"Primitive.basicUnsafeNew: length to large: "# | |
(case $wshowSignedInt 0 ww_sbFE ([]) | |
of _ { (# ww5_a93C, ww6_a93D #) -> | |
: ww5_a93C ww6_a93D | |
})) | |
lvl8_rdL7 | |
lvl8_rdL7 = | |
\ @ s2_a8g5 ww_sbFE -> | |
error | |
(unpackAppendCString# | |
"Primitive.basicUnsafeNew: negative length: "# | |
(case $wshowSignedInt 0 ww_sbFE ([]) | |
of _ { (# ww5_a93C, ww6_a93D #) -> | |
: ww5_a93C ww6_a93D | |
})) | |
$wbDropWhile | |
$wbDropWhile = | |
\ ww_scpl ww1_scpm ww2_scpn -> | |
case ww1_scpm of wild3_a88U { | |
__DEFAULT -> | |
case (runSTRep | |
(\ @ s_a8lQ s1_a8lR -> | |
case tagToEnum# (<# wild3_a88U 0) of _ { | |
False -> | |
case divInt# 9223372036854775807 8 of ww4_a92V { __DEFAULT -> | |
case tagToEnum# (># wild3_a88U ww4_a92V) of _ { | |
False -> | |
case newByteArray# (*# wild3_a88U 8) (s1_a8lR `cast` ...) | |
of _ { (# ipv_a8MY, ipv1_a8MZ #) -> | |
letrec { | |
$s$wa_sdhX | |
$s$wa_sdhX = | |
\ sc_sdhQ sc1_sdhR sc2_sdhS sc3_sdhT -> | |
case writeDoubleArray# | |
ipv1_a8MZ sc_sdhQ sc1_sdhR (sc3_sdhT `cast` ...) | |
of s'#_aaA0 { __DEFAULT -> | |
case tagToEnum# (>=# sc2_sdhS wild3_a88U) of _ { | |
False -> | |
case indexDoubleArray# ww2_scpn (+# ww_scpl sc2_sdhS) | |
of wild_a97C { __DEFAULT -> | |
$s$wa_sdhX | |
(+# sc_sdhQ 1) | |
wild_a97C | |
(+# sc2_sdhS 1) | |
(s'#_aaA0 `cast` ...) | |
}; | |
True -> (# s'#_aaA0 `cast` ..., I# (+# sc_sdhQ 1) #) | |
} | |
}; } in | |
letrec { | |
$s$wa1_sdhP | |
$s$wa1_sdhP = | |
\ sc_sdhL sc1_sdhM sc2_sdhO -> | |
case tagToEnum# (>=# sc1_sdhM wild3_a88U) of _ { | |
False -> | |
case indexDoubleArray# ww2_scpn (+# ww_scpl sc1_sdhM) | |
of wild_a97C { __DEFAULT -> | |
case tagToEnum# (<## wild_a97C 10.0) of _ { | |
False -> | |
$s$wa_sdhX sc_sdhL wild_a97C (+# sc1_sdhM 1) sc2_sdhO; | |
True -> $s$wa1_sdhP sc_sdhL (+# sc1_sdhM 1) sc2_sdhO | |
} | |
}; | |
True -> (# sc2_sdhO, I# sc_sdhL #) | |
}; } in | |
case $s$wa1_sdhP 0 0 (ipv_a8MY `cast` ...) | |
of _ { (# ipv6_a8hW, ipv7_a8hX #) -> | |
case ipv7_a8hX of _ { I# dt4_a94m -> | |
case unsafeFreezeByteArray# ipv1_a8MZ (ipv6_a8hW `cast` ...) | |
of _ { (# ipv2_a8L0, ipv3_a8L1 #) -> | |
(# ipv2_a8L0 `cast` ..., | |
(Vector 0 dt4_a94m ipv3_a8L1) `cast` ... #) | |
} | |
} | |
} | |
}; | |
True -> case lvl7_rdL6 wild3_a88U of wild_00 { } | |
} | |
}; | |
True -> case lvl8_rdL7 wild3_a88U of wild_00 { } | |
})) | |
`cast` ... | |
of ww3_scpd { Vector ww4_scpe ww5_scpf ww6_scpg -> | |
case $sdrop_$slength (ww3_scpd `cast` ...) of _ { I# x_a8by -> | |
let { | |
x1_a8bx | |
x1_a8bx = -# x_a8by 1 } in | |
case tagToEnum# (>=# x1_a8bx 0) of _ { | |
False -> case bNoDrop2 x1_a8bx x_a8by of wild1_00 { }; | |
True -> | |
case tagToEnum# (<# x1_a8bx x_a8by) of _ { | |
False -> case bNoDrop2 x1_a8bx x_a8by of wild1_00 { }; | |
True -> | |
case tagToEnum# (<# 0 x_a8by) of _ { | |
False -> case bNoDrop1 x_a8by of wild5_00 { }; | |
True -> | |
case indexDoubleArray# ww6_scpg (+# ww4_scpe x1_a8bx) | |
of wild5_a97C { __DEFAULT -> | |
case indexDoubleArray# ww6_scpg ww4_scpe | |
of wild6_X9aq { __DEFAULT -> | |
/## wild5_a97C wild6_X9aq | |
} | |
} | |
} | |
} | |
} | |
} | |
}; | |
0 -> 0.0 | |
} | |
bDropWhile | |
bDropWhile = | |
\ w_scpi -> | |
case w_scpi `cast` ... of _ { Vector ww1_scpl ww2_scpm ww3_scpn -> | |
case $wbDropWhile ww1_scpl ww2_scpm ww3_scpn | |
of ww4_scpr { __DEFAULT -> | |
D# ww4_scpr | |
} | |
} | |
bDropWhile'1 | |
bDropWhile'1 = | |
\ ww_scpM ww1_scpN ww2_scpO -> | |
case $sdrop_$slength | |
((Vector ww_scpM ww1_scpN ww2_scpO) `cast` ...) | |
of _ { I# x_a8by -> | |
let { | |
x1_a8bx | |
x1_a8bx = -# x_a8by 1 } in | |
case tagToEnum# (>=# x1_a8bx 0) of _ { | |
False -> | |
case checkError | |
bDropWhile'4 | |
bDropWhile'3 | |
Bounds | |
bDropWhile'2 | |
(checkIndex_msg# x1_a8bx x_a8by) | |
of wild1_00 { | |
}; | |
True -> | |
case tagToEnum# (<# x1_a8bx x_a8by) of _ { | |
False -> | |
case checkError | |
bDropWhile'4 | |
bDropWhile'3 | |
Bounds | |
bDropWhile'2 | |
(checkIndex_msg# x1_a8bx x_a8by) | |
of wild1_00 { | |
}; | |
True -> | |
case tagToEnum# (<# 0 x_a8by) of _ { | |
False -> | |
case checkError | |
bDropWhile'4 | |
bDropWhile'3 | |
Bounds | |
bDropWhile'2 | |
(checkIndex_msg# 0 x_a8by) | |
of wild3_00 { | |
}; | |
True -> | |
case indexDoubleArray# ww2_scpO (+# ww_scpM x1_a8bx) | |
of wild3_a97C { __DEFAULT -> | |
case indexDoubleArray# ww2_scpO ww_scpM | |
of wild5_X9at { __DEFAULT -> | |
/## wild3_a97C wild5_X9at | |
} | |
} | |
} | |
} | |
} | |
} | |
$wbDropWhile' | |
$wbDropWhile' = | |
\ ww_scpT ww1_scpU ww2_scpV -> | |
case ww1_scpU of wild3_a88U { | |
__DEFAULT -> | |
case $sdrop_$slength | |
((Vector ww_scpT wild3_a88U ww2_scpV) `cast` ...) | |
of _ { I# ww4_scpv -> | |
letrec { | |
$wgo_scpF | |
$wgo_scpF = | |
\ ww5_scpA -> | |
case tagToEnum# (==# ww5_scpA ww4_scpv) of _ { | |
False -> | |
case indexDoubleArray# ww2_scpV (+# ww_scpT ww5_scpA) | |
of wild1_a97C { __DEFAULT -> | |
case tagToEnum# (<## wild1_a97C 10.0) of _ { | |
False -> ww5_scpA; | |
True -> $wgo_scpF (+# ww5_scpA 1) | |
} | |
}; | |
True -> ww5_scpA | |
}; } in | |
case $wgo_scpF 0 of ww5_scpE { __DEFAULT -> | |
case tagToEnum# (<=# ww5_scpE 0) of _ { | |
False -> | |
case tagToEnum# (<=# ww5_scpE ww4_scpv) of _ { | |
False -> | |
let { | |
y1_a8v3 | |
y1_a8v3 = -# ww4_scpv ww5_scpE } in | |
case tagToEnum# (<=# 0 y1_a8v3) of _ { | |
False -> bDropWhile'1 (+# ww_scpT ww4_scpv) 0 ww2_scpV; | |
True -> bDropWhile'1 (+# ww_scpT ww4_scpv) y1_a8v3 ww2_scpV | |
}; | |
True -> | |
let { | |
y1_a8v3 | |
y1_a8v3 = -# ww4_scpv ww5_scpE } in | |
case tagToEnum# (<=# 0 y1_a8v3) of _ { | |
False -> bDropWhile'1 (+# ww_scpT ww5_scpE) 0 ww2_scpV; | |
True -> bDropWhile'1 (+# ww_scpT ww5_scpE) y1_a8v3 ww2_scpV | |
} | |
}; | |
True -> | |
case tagToEnum# (<=# 0 ww4_scpv) of _ { | |
False -> bDropWhile'1 (+# ww_scpT ww4_scpv) 0 ww2_scpV; | |
True -> bDropWhile'1 ww_scpT ww4_scpv ww2_scpV | |
} | |
} | |
} | |
}; | |
0 -> 0.0 | |
} | |
bDropWhile' | |
bDropWhile' = | |
\ w_scpQ -> | |
case w_scpQ `cast` ... of _ { Vector ww1_scpT ww2_scpU ww3_scpV -> | |
case $wbDropWhile' ww1_scpT ww2_scpU ww3_scpV | |
of ww4_scpZ { __DEFAULT -> | |
D# ww4_scpZ | |
} | |
} | |
$wbNoDrop | |
$wbNoDrop = | |
\ ww_scq4 ww1_scq5 ww2_scq6 -> | |
case ww1_scq5 of wild3_a88U { | |
__DEFAULT -> | |
case $sdrop_$slength | |
((Vector ww_scq4 wild3_a88U ww2_scq6) `cast` ...) | |
of _ { I# x_a8by -> | |
let { | |
x1_a8bx | |
x1_a8bx = -# x_a8by 1 } in | |
case tagToEnum# (>=# x1_a8bx 0) of _ { | |
False -> case bNoDrop2 x1_a8bx x_a8by of wild1_00 { }; | |
True -> | |
case tagToEnum# (<# x1_a8bx x_a8by) of _ { | |
False -> case bNoDrop2 x1_a8bx x_a8by of wild1_00 { }; | |
True -> | |
case tagToEnum# (<# 0 x_a8by) of _ { | |
False -> case bNoDrop1 x_a8by of wild5_00 { }; | |
True -> | |
case indexDoubleArray# ww2_scq6 (+# ww_scq4 x1_a8bx) | |
of wild5_a97C { __DEFAULT -> | |
case indexDoubleArray# ww2_scq6 ww_scq4 | |
of wild6_X9ak { __DEFAULT -> | |
/## wild5_a97C wild6_X9ak | |
} | |
} | |
} | |
} | |
} | |
}; | |
0 -> 0.0 | |
} | |
bNoDrop | |
bNoDrop = | |
\ w_scq1 -> | |
case w_scq1 `cast` ... of _ { Vector ww1_scq4 ww2_scq5 ww3_scq6 -> | |
case $wbNoDrop ww1_scq4 ww2_scq5 ww3_scq6 | |
of ww4_scqa { __DEFAULT -> | |
D# ww4_scqa | |
} | |
} | |
setupEnv | |
setupEnv = a_rdKX `cast` ... | |
Rec { | |
main_$s$wa2 | |
main_$s$wa2 = | |
\ sc_sdhC sc1_sdhD sc2_sdhE -> | |
case tagToEnum# (<=# sc1_sdhD 0) of _ { | |
False -> | |
case seq# | |
(case sc_sdhC `cast` ... | |
of _ { Vector ww1_scq4 ww2_scq5 ww3_scq6 -> | |
case $wbNoDrop ww1_scq4 ww2_scq5 ww3_scq6 of _ { __DEFAULT -> () } | |
}) | |
sc2_sdhE | |
of _ { (# ipv_a9by, ipv1_a9bz #) -> | |
main_$s$wa2 sc_sdhC (-# sc1_sdhD 1) ipv_a9by | |
}; | |
True -> (# sc2_sdhE, () #) | |
} | |
end Rec } | |
Rec { | |
main_$s$wa1 | |
main_$s$wa1 = | |
\ sc_sdhv sc1_sdhw sc2_sdhx -> | |
case tagToEnum# (<=# sc1_sdhw 0) of _ { | |
False -> | |
case seq# | |
(case sc_sdhv `cast` ... | |
of _ { Vector ww1_scpl ww2_scpm ww3_scpn -> | |
case $wbDropWhile ww1_scpl ww2_scpm ww3_scpn of _ { __DEFAULT -> | |
() | |
} | |
}) | |
sc2_sdhx | |
of _ { (# ipv_a9by, ipv1_a9bz #) -> | |
main_$s$wa1 sc_sdhv (-# sc1_sdhw 1) ipv_a9by | |
}; | |
True -> (# sc2_sdhx, () #) | |
} | |
end Rec } | |
Rec { | |
main_$s$wa | |
main_$s$wa = | |
\ sc_sdho sc1_sdhp sc2_sdhq -> | |
case tagToEnum# (<=# sc1_sdhp 0) of _ { | |
False -> | |
case seq# | |
(case sc_sdho `cast` ... | |
of _ { Vector ww1_scpT ww2_scpU ww3_scpV -> | |
case $wbDropWhile' ww1_scpT ww2_scpU ww3_scpV of _ { __DEFAULT -> | |
() | |
} | |
}) | |
sc2_sdhq | |
of _ { (# ipv_a9by, ipv1_a9bz #) -> | |
main_$s$wa sc_sdho (-# sc1_sdhp 1) ipv_a9by | |
}; | |
True -> (# sc2_sdhq, () #) | |
} | |
end Rec } | |
$wa | |
$wa = | |
\ w_scqD -> | |
(# main8, | |
: (Benchmark | |
main7 | |
((\ eta2_a7Ud eta3_a7Ue -> | |
case eta2_a7Ud of _ { I64# ww1_scqi -> | |
main_$s$wa2 w_scqD ww1_scqi eta3_a7Ue | |
}) | |
`cast` ...)) | |
(: (Benchmark | |
main6 | |
((\ eta2_a7Ud eta3_a7Ue -> | |
case eta2_a7Ud of _ { I64# ww1_scqr -> | |
main_$s$wa1 w_scqD ww1_scqr eta3_a7Ue | |
}) | |
`cast` ...)) | |
(: (Benchmark | |
main5 | |
((\ eta2_a7Ud eta3_a7Ue -> | |
case eta2_a7Ud of _ { I64# ww1_scqA -> | |
main_$s$wa w_scqD ww1_scqA eta3_a7Ue | |
}) | |
`cast` ...)) | |
([]))) #) | |
main4 | |
main4 = | |
\ w_scqD -> | |
case $wa w_scqD of _ { (# ww1_scqX, ww2_scqY #) -> | |
BenchGroup ww1_scqX ww2_scqY | |
} | |
main3 | |
main3 = | |
Environment (($fNFDataVector_$crnf) `cast` ...) setupEnv main4 | |
main2 | |
main2 = : main3 ([]) | |
main1 | |
main1 = defaultMain2 defaultConfig main2 | |
main | |
main = main1 `cast` ... | |
main9 | |
main9 = runMainIO1 (main1 `cast` ...) | |
main | |
main = main9 `cast` ... | |
------ Local rules for imported ids -------- | |
"SPEC/Main length @ Vector @ Double" [ALWAYS] | |
forall $dVector_X8dZ. length $dVector_X8dZ = $sdrop_$slength | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment