Added build timings.

This commit is contained in:
Alex Huszagh
2021-09-04 00:14:42 -05:00
parent c91249601c
commit 770056ceb4
3 changed files with 1115 additions and 4 deletions
+1 -4
View File
@@ -1,9 +1,6 @@
minimal-lexical
===============
[![Build Status](https://api.travis-ci.org/Alexhuszagh/minimal-lexical.svg?branch=master)](https://travis-ci.org/Alexhuszagh/minimal-lexical)
[![Rustc Version 1.31+](https://img.shields.io/badge/rustc-1.31+-lightgray.svg)](https://blog.rust-lang.org/2018/12/06/Rust-1.31-and-rust-2018.html)
This is a minimal version of [rust-lexical](https://github.com/Alexhuszagh/rust-lexical), meant to allow efficient round-trip float parsing. minimal-lexical implements a correct, fast float parser.
Due to the small, stable nature of minimal-lexical, it is also well-adapted to private forks. If you do privately fork minimal-lexical, I recommend you contact me via [email](mailto:ahuszagh@gmail.com) or [Twitter](https://twitter.com/KardOnIce), so I can notify you of feature updates, bug fixes, or security vulnerabilities, as well as help you implement custom feature requests. I will not use your information for any other purpose, including, but not limited to disclosing your project or organization's use of minimal-lexical.
@@ -12,7 +9,7 @@ minimal-lexical is designed for fast compile times and small binaries sizes, at
**Similar Projects**
For a high-level, all-in-one number conversion routines, see [rust-lexical](https://github.com/Alexhuszagh/rust-lexical). For language bindings to lexical, see [lexical-capi](https://github.com/Alexhuszagh/rust-lexical/tree/master/lexical-capi).
For a high-level, all-in-one number conversion routines, see [rust-lexical](https://github.com/Alexhuszagh/rust-lexical).
**Table Of Contents**
+935
View File
@@ -0,0 +1,935 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg height="345.6pt" version="1.1" viewBox="0 0 460.8 345.6" width="460.8pt" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<metadata>
<rdf:RDF xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<cc:Work>
<dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
<dc:date>2021-09-04T00:13:21.196328</dc:date>
<dc:format>image/svg+xml</dc:format>
<dc:creator>
<cc:Agent>
<dc:title>Matplotlib v3.4.3, https://matplotlib.org/</dc:title>
</cc:Agent>
</dc:creator>
</cc:Work>
</rdf:RDF>
</metadata>
<defs>
<style type="text/css">*{stroke-linecap:butt;stroke-linejoin:round;}</style>
</defs>
<g id="figure_1">
<g id="patch_1">
<path d="M 0 345.6
L 460.8 345.6
L 460.8 0
L 0 0
z
" style="fill:#ffffff;"/>
</g>
<g id="axes_1">
<g id="patch_2">
<path d="M 57.6 307.584
L 414.72 307.584
L 414.72 41.472
L 57.6 41.472
z
" style="fill:#e5e5e5;"/>
</g>
<g id="matplotlib.axis_1">
<g id="xtick_1">
<g id="line2d_1">
<path clip-path="url(#pffce4df39a)" d="M 57.6 307.584
L 57.6 41.472
" style="fill:none;stroke:#ffffff;stroke-linecap:square;stroke-width:0.8;"/>
</g>
<g id="line2d_2">
<defs>
<path d="M 0 0
L 0 3.5
" id="mb2a27af6ad" style="stroke:#555555;stroke-width:0.8;"/>
</defs>
<g>
<use style="fill:#555555;stroke:#555555;stroke-width:0.8;" x="57.6" xlink:href="#mb2a27af6ad" y="307.584"/>
</g>
</g>
<g id="text_1">
<!-- 0.0 -->
<g style="fill:#555555;" transform="translate(49.648438 322.182437)scale(0.1 -0.1)">
<defs>
<path d="M 2034 4250
Q 1547 4250 1301 3770
Q 1056 3291 1056 2328
Q 1056 1369 1301 889
Q 1547 409 2034 409
Q 2525 409 2770 889
Q 3016 1369 3016 2328
Q 3016 3291 2770 3770
Q 2525 4250 2034 4250
z
M 2034 4750
Q 2819 4750 3233 4129
Q 3647 3509 3647 2328
Q 3647 1150 3233 529
Q 2819 -91 2034 -91
Q 1250 -91 836 529
Q 422 1150 422 2328
Q 422 3509 836 4129
Q 1250 4750 2034 4750
z
" id="DejaVuSans-30" transform="scale(0.015625)"/>
<path d="M 684 794
L 1344 794
L 1344 0
L 684 0
L 684 794
z
" id="DejaVuSans-2e" transform="scale(0.015625)"/>
</defs>
<use xlink:href="#DejaVuSans-30"/>
<use x="63.623047" xlink:href="#DejaVuSans-2e"/>
<use x="95.410156" xlink:href="#DejaVuSans-30"/>
</g>
</g>
</g>
<g id="xtick_2">
<g id="line2d_3">
<path clip-path="url(#pffce4df39a)" d="M 100.033066 307.584
L 100.033066 41.472
" style="fill:none;stroke:#ffffff;stroke-linecap:square;stroke-width:0.8;"/>
</g>
<g id="line2d_4">
<g>
<use style="fill:#555555;stroke:#555555;stroke-width:0.8;" x="100.033066" xlink:href="#mb2a27af6ad" y="307.584"/>
</g>
</g>
<g id="text_2">
<!-- 0.1 -->
<g style="fill:#555555;" transform="translate(92.081503 322.182437)scale(0.1 -0.1)">
<defs>
<path d="M 794 531
L 1825 531
L 1825 4091
L 703 3866
L 703 4441
L 1819 4666
L 2450 4666
L 2450 531
L 3481 531
L 3481 0
L 794 0
L 794 531
z
" id="DejaVuSans-31" transform="scale(0.015625)"/>
</defs>
<use xlink:href="#DejaVuSans-30"/>
<use x="63.623047" xlink:href="#DejaVuSans-2e"/>
<use x="95.410156" xlink:href="#DejaVuSans-31"/>
</g>
</g>
</g>
<g id="xtick_3">
<g id="line2d_5">
<path clip-path="url(#pffce4df39a)" d="M 142.466131 307.584
L 142.466131 41.472
" style="fill:none;stroke:#ffffff;stroke-linecap:square;stroke-width:0.8;"/>
</g>
<g id="line2d_6">
<g>
<use style="fill:#555555;stroke:#555555;stroke-width:0.8;" x="142.466131" xlink:href="#mb2a27af6ad" y="307.584"/>
</g>
</g>
<g id="text_3">
<!-- 0.2 -->
<g style="fill:#555555;" transform="translate(134.514569 322.182437)scale(0.1 -0.1)">
<defs>
<path d="M 1228 531
L 3431 531
L 3431 0
L 469 0
L 469 531
Q 828 903 1448 1529
Q 2069 2156 2228 2338
Q 2531 2678 2651 2914
Q 2772 3150 2772 3378
Q 2772 3750 2511 3984
Q 2250 4219 1831 4219
Q 1534 4219 1204 4116
Q 875 4013 500 3803
L 500 4441
Q 881 4594 1212 4672
Q 1544 4750 1819 4750
Q 2544 4750 2975 4387
Q 3406 4025 3406 3419
Q 3406 3131 3298 2873
Q 3191 2616 2906 2266
Q 2828 2175 2409 1742
Q 1991 1309 1228 531
z
" id="DejaVuSans-32" transform="scale(0.015625)"/>
</defs>
<use xlink:href="#DejaVuSans-30"/>
<use x="63.623047" xlink:href="#DejaVuSans-2e"/>
<use x="95.410156" xlink:href="#DejaVuSans-32"/>
</g>
</g>
</g>
<g id="xtick_4">
<g id="line2d_7">
<path clip-path="url(#pffce4df39a)" d="M 184.899197 307.584
L 184.899197 41.472
" style="fill:none;stroke:#ffffff;stroke-linecap:square;stroke-width:0.8;"/>
</g>
<g id="line2d_8">
<g>
<use style="fill:#555555;stroke:#555555;stroke-width:0.8;" x="184.899197" xlink:href="#mb2a27af6ad" y="307.584"/>
</g>
</g>
<g id="text_4">
<!-- 0.3 -->
<g style="fill:#555555;" transform="translate(176.947635 322.182437)scale(0.1 -0.1)">
<defs>
<path d="M 2597 2516
Q 3050 2419 3304 2112
Q 3559 1806 3559 1356
Q 3559 666 3084 287
Q 2609 -91 1734 -91
Q 1441 -91 1130 -33
Q 819 25 488 141
L 488 750
Q 750 597 1062 519
Q 1375 441 1716 441
Q 2309 441 2620 675
Q 2931 909 2931 1356
Q 2931 1769 2642 2001
Q 2353 2234 1838 2234
L 1294 2234
L 1294 2753
L 1863 2753
Q 2328 2753 2575 2939
Q 2822 3125 2822 3475
Q 2822 3834 2567 4026
Q 2313 4219 1838 4219
Q 1578 4219 1281 4162
Q 984 4106 628 3988
L 628 4550
Q 988 4650 1302 4700
Q 1616 4750 1894 4750
Q 2613 4750 3031 4423
Q 3450 4097 3450 3541
Q 3450 3153 3228 2886
Q 3006 2619 2597 2516
z
" id="DejaVuSans-33" transform="scale(0.015625)"/>
</defs>
<use xlink:href="#DejaVuSans-30"/>
<use x="63.623047" xlink:href="#DejaVuSans-2e"/>
<use x="95.410156" xlink:href="#DejaVuSans-33"/>
</g>
</g>
</g>
<g id="xtick_5">
<g id="line2d_9">
<path clip-path="url(#pffce4df39a)" d="M 227.332263 307.584
L 227.332263 41.472
" style="fill:none;stroke:#ffffff;stroke-linecap:square;stroke-width:0.8;"/>
</g>
<g id="line2d_10">
<g>
<use style="fill:#555555;stroke:#555555;stroke-width:0.8;" x="227.332263" xlink:href="#mb2a27af6ad" y="307.584"/>
</g>
</g>
<g id="text_5">
<!-- 0.4 -->
<g style="fill:#555555;" transform="translate(219.3807 322.182437)scale(0.1 -0.1)">
<defs>
<path d="M 2419 4116
L 825 1625
L 2419 1625
L 2419 4116
z
M 2253 4666
L 3047 4666
L 3047 1625
L 3713 1625
L 3713 1100
L 3047 1100
L 3047 0
L 2419 0
L 2419 1100
L 313 1100
L 313 1709
L 2253 4666
z
" id="DejaVuSans-34" transform="scale(0.015625)"/>
</defs>
<use xlink:href="#DejaVuSans-30"/>
<use x="63.623047" xlink:href="#DejaVuSans-2e"/>
<use x="95.410156" xlink:href="#DejaVuSans-34"/>
</g>
</g>
</g>
<g id="xtick_6">
<g id="line2d_11">
<path clip-path="url(#pffce4df39a)" d="M 269.765329 307.584
L 269.765329 41.472
" style="fill:none;stroke:#ffffff;stroke-linecap:square;stroke-width:0.8;"/>
</g>
<g id="line2d_12">
<g>
<use style="fill:#555555;stroke:#555555;stroke-width:0.8;" x="269.765329" xlink:href="#mb2a27af6ad" y="307.584"/>
</g>
</g>
<g id="text_6">
<!-- 0.5 -->
<g style="fill:#555555;" transform="translate(261.813766 322.182437)scale(0.1 -0.1)">
<defs>
<path d="M 691 4666
L 3169 4666
L 3169 4134
L 1269 4134
L 1269 2991
Q 1406 3038 1543 3061
Q 1681 3084 1819 3084
Q 2600 3084 3056 2656
Q 3513 2228 3513 1497
Q 3513 744 3044 326
Q 2575 -91 1722 -91
Q 1428 -91 1123 -41
Q 819 9 494 109
L 494 744
Q 775 591 1075 516
Q 1375 441 1709 441
Q 2250 441 2565 725
Q 2881 1009 2881 1497
Q 2881 1984 2565 2268
Q 2250 2553 1709 2553
Q 1456 2553 1204 2497
Q 953 2441 691 2322
L 691 4666
z
" id="DejaVuSans-35" transform="scale(0.015625)"/>
</defs>
<use xlink:href="#DejaVuSans-30"/>
<use x="63.623047" xlink:href="#DejaVuSans-2e"/>
<use x="95.410156" xlink:href="#DejaVuSans-35"/>
</g>
</g>
</g>
<g id="xtick_7">
<g id="line2d_13">
<path clip-path="url(#pffce4df39a)" d="M 312.198394 307.584
L 312.198394 41.472
" style="fill:none;stroke:#ffffff;stroke-linecap:square;stroke-width:0.8;"/>
</g>
<g id="line2d_14">
<g>
<use style="fill:#555555;stroke:#555555;stroke-width:0.8;" x="312.198394" xlink:href="#mb2a27af6ad" y="307.584"/>
</g>
</g>
<g id="text_7">
<!-- 0.6 -->
<g style="fill:#555555;" transform="translate(304.246832 322.182437)scale(0.1 -0.1)">
<defs>
<path d="M 2113 2584
Q 1688 2584 1439 2293
Q 1191 2003 1191 1497
Q 1191 994 1439 701
Q 1688 409 2113 409
Q 2538 409 2786 701
Q 3034 994 3034 1497
Q 3034 2003 2786 2293
Q 2538 2584 2113 2584
z
M 3366 4563
L 3366 3988
Q 3128 4100 2886 4159
Q 2644 4219 2406 4219
Q 1781 4219 1451 3797
Q 1122 3375 1075 2522
Q 1259 2794 1537 2939
Q 1816 3084 2150 3084
Q 2853 3084 3261 2657
Q 3669 2231 3669 1497
Q 3669 778 3244 343
Q 2819 -91 2113 -91
Q 1303 -91 875 529
Q 447 1150 447 2328
Q 447 3434 972 4092
Q 1497 4750 2381 4750
Q 2619 4750 2861 4703
Q 3103 4656 3366 4563
z
" id="DejaVuSans-36" transform="scale(0.015625)"/>
</defs>
<use xlink:href="#DejaVuSans-30"/>
<use x="63.623047" xlink:href="#DejaVuSans-2e"/>
<use x="95.410156" xlink:href="#DejaVuSans-36"/>
</g>
</g>
</g>
<g id="xtick_8">
<g id="line2d_15">
<path clip-path="url(#pffce4df39a)" d="M 354.63146 307.584
L 354.63146 41.472
" style="fill:none;stroke:#ffffff;stroke-linecap:square;stroke-width:0.8;"/>
</g>
<g id="line2d_16">
<g>
<use style="fill:#555555;stroke:#555555;stroke-width:0.8;" x="354.63146" xlink:href="#mb2a27af6ad" y="307.584"/>
</g>
</g>
<g id="text_8">
<!-- 0.7 -->
<g style="fill:#555555;" transform="translate(346.679898 322.182437)scale(0.1 -0.1)">
<defs>
<path d="M 525 4666
L 3525 4666
L 3525 4397
L 1831 0
L 1172 0
L 2766 4134
L 525 4134
L 525 4666
z
" id="DejaVuSans-37" transform="scale(0.015625)"/>
</defs>
<use xlink:href="#DejaVuSans-30"/>
<use x="63.623047" xlink:href="#DejaVuSans-2e"/>
<use x="95.410156" xlink:href="#DejaVuSans-37"/>
</g>
</g>
</g>
<g id="xtick_9">
<g id="line2d_17">
<path clip-path="url(#pffce4df39a)" d="M 397.064526 307.584
L 397.064526 41.472
" style="fill:none;stroke:#ffffff;stroke-linecap:square;stroke-width:0.8;"/>
</g>
<g id="line2d_18">
<g>
<use style="fill:#555555;stroke:#555555;stroke-width:0.8;" x="397.064526" xlink:href="#mb2a27af6ad" y="307.584"/>
</g>
</g>
<g id="text_9">
<!-- 0.8 -->
<g style="fill:#555555;" transform="translate(389.112963 322.182437)scale(0.1 -0.1)">
<defs>
<path d="M 2034 2216
Q 1584 2216 1326 1975
Q 1069 1734 1069 1313
Q 1069 891 1326 650
Q 1584 409 2034 409
Q 2484 409 2743 651
Q 3003 894 3003 1313
Q 3003 1734 2745 1975
Q 2488 2216 2034 2216
z
M 1403 2484
Q 997 2584 770 2862
Q 544 3141 544 3541
Q 544 4100 942 4425
Q 1341 4750 2034 4750
Q 2731 4750 3128 4425
Q 3525 4100 3525 3541
Q 3525 3141 3298 2862
Q 3072 2584 2669 2484
Q 3125 2378 3379 2068
Q 3634 1759 3634 1313
Q 3634 634 3220 271
Q 2806 -91 2034 -91
Q 1263 -91 848 271
Q 434 634 434 1313
Q 434 1759 690 2068
Q 947 2378 1403 2484
z
M 1172 3481
Q 1172 3119 1398 2916
Q 1625 2713 2034 2713
Q 2441 2713 2670 2916
Q 2900 3119 2900 3481
Q 2900 3844 2670 4047
Q 2441 4250 2034 4250
Q 1625 4250 1398 4047
Q 1172 3844 1172 3481
z
" id="DejaVuSans-38" transform="scale(0.015625)"/>
</defs>
<use xlink:href="#DejaVuSans-30"/>
<use x="63.623047" xlink:href="#DejaVuSans-2e"/>
<use x="95.410156" xlink:href="#DejaVuSans-38"/>
</g>
</g>
</g>
<g id="text_10">
<!-- Time (s) -->
<g style="fill:#555555;" transform="translate(211.765312 337.38025)scale(0.12 -0.12)">
<defs>
<path d="M -19 4666
L 3928 4666
L 3928 4134
L 2272 4134
L 2272 0
L 1638 0
L 1638 4134
L -19 4134
L -19 4666
z
" id="DejaVuSans-54" transform="scale(0.015625)"/>
<path d="M 603 3500
L 1178 3500
L 1178 0
L 603 0
L 603 3500
z
M 603 4863
L 1178 4863
L 1178 4134
L 603 4134
L 603 4863
z
" id="DejaVuSans-69" transform="scale(0.015625)"/>
<path d="M 3328 2828
Q 3544 3216 3844 3400
Q 4144 3584 4550 3584
Q 5097 3584 5394 3201
Q 5691 2819 5691 2113
L 5691 0
L 5113 0
L 5113 2094
Q 5113 2597 4934 2840
Q 4756 3084 4391 3084
Q 3944 3084 3684 2787
Q 3425 2491 3425 1978
L 3425 0
L 2847 0
L 2847 2094
Q 2847 2600 2669 2842
Q 2491 3084 2119 3084
Q 1678 3084 1418 2786
Q 1159 2488 1159 1978
L 1159 0
L 581 0
L 581 3500
L 1159 3500
L 1159 2956
Q 1356 3278 1631 3431
Q 1906 3584 2284 3584
Q 2666 3584 2933 3390
Q 3200 3197 3328 2828
z
" id="DejaVuSans-6d" transform="scale(0.015625)"/>
<path d="M 3597 1894
L 3597 1613
L 953 1613
Q 991 1019 1311 708
Q 1631 397 2203 397
Q 2534 397 2845 478
Q 3156 559 3463 722
L 3463 178
Q 3153 47 2828 -22
Q 2503 -91 2169 -91
Q 1331 -91 842 396
Q 353 884 353 1716
Q 353 2575 817 3079
Q 1281 3584 2069 3584
Q 2775 3584 3186 3129
Q 3597 2675 3597 1894
z
M 3022 2063
Q 3016 2534 2758 2815
Q 2500 3097 2075 3097
Q 1594 3097 1305 2825
Q 1016 2553 972 2059
L 3022 2063
z
" id="DejaVuSans-65" transform="scale(0.015625)"/>
<path id="DejaVuSans-20" transform="scale(0.015625)"/>
<path d="M 1984 4856
Q 1566 4138 1362 3434
Q 1159 2731 1159 2009
Q 1159 1288 1364 580
Q 1569 -128 1984 -844
L 1484 -844
Q 1016 -109 783 600
Q 550 1309 550 2009
Q 550 2706 781 3412
Q 1013 4119 1484 4856
L 1984 4856
z
" id="DejaVuSans-28" transform="scale(0.015625)"/>
<path d="M 2834 3397
L 2834 2853
Q 2591 2978 2328 3040
Q 2066 3103 1784 3103
Q 1356 3103 1142 2972
Q 928 2841 928 2578
Q 928 2378 1081 2264
Q 1234 2150 1697 2047
L 1894 2003
Q 2506 1872 2764 1633
Q 3022 1394 3022 966
Q 3022 478 2636 193
Q 2250 -91 1575 -91
Q 1294 -91 989 -36
Q 684 19 347 128
L 347 722
Q 666 556 975 473
Q 1284 391 1588 391
Q 1994 391 2212 530
Q 2431 669 2431 922
Q 2431 1156 2273 1281
Q 2116 1406 1581 1522
L 1381 1569
Q 847 1681 609 1914
Q 372 2147 372 2553
Q 372 3047 722 3315
Q 1072 3584 1716 3584
Q 2034 3584 2315 3537
Q 2597 3491 2834 3397
z
" id="DejaVuSans-73" transform="scale(0.015625)"/>
<path d="M 513 4856
L 1013 4856
Q 1481 4119 1714 3412
Q 1947 2706 1947 2009
Q 1947 1309 1714 600
Q 1481 -109 1013 -844
L 513 -844
Q 928 -128 1133 580
Q 1338 1288 1338 2009
Q 1338 2731 1133 3434
Q 928 4138 513 4856
z
" id="DejaVuSans-29" transform="scale(0.015625)"/>
</defs>
<use xlink:href="#DejaVuSans-54"/>
<use x="57.958984" xlink:href="#DejaVuSans-69"/>
<use x="85.742188" xlink:href="#DejaVuSans-6d"/>
<use x="183.154297" xlink:href="#DejaVuSans-65"/>
<use x="244.677734" xlink:href="#DejaVuSans-20"/>
<use x="276.464844" xlink:href="#DejaVuSans-28"/>
<use x="315.478516" xlink:href="#DejaVuSans-73"/>
<use x="367.578125" xlink:href="#DejaVuSans-29"/>
</g>
</g>
</g>
<g id="matplotlib.axis_2">
<g id="ytick_1">
<g id="line2d_19">
<path clip-path="url(#pffce4df39a)" d="M 57.6 174.528
L 414.72 174.528
" style="fill:none;stroke:#ffffff;stroke-linecap:square;stroke-width:0.8;"/>
</g>
<g id="line2d_20"/>
</g>
</g>
<g id="patch_3">
<path clip-path="url(#pffce4df39a)" d="M 57.6 187.8336
L 236.501124 187.8336
L 236.501124 161.2224
L 57.6 161.2224
z
" style="fill:#87cefa;opacity:0.6;"/>
</g>
<g id="patch_4">
<path clip-path="url(#pffce4df39a)" d="M 189.53449 187.8336
L 236.501124 187.8336
L 236.501124 161.2224
L 189.53449 161.2224
z
" style="fill:#9932cc;opacity:0.6;"/>
</g>
<g id="patch_5">
<path d="M 57.6 307.584
L 57.6 41.472
" style="fill:none;stroke:#ffffff;stroke-linecap:square;stroke-linejoin:miter;"/>
</g>
<g id="patch_6">
<path d="M 414.72 307.584
L 414.72 41.472
" style="fill:none;stroke:#ffffff;stroke-linecap:square;stroke-linejoin:miter;"/>
</g>
<g id="patch_7">
<path d="M 57.6 307.584
L 414.72 307.584
" style="fill:none;stroke:#ffffff;stroke-linecap:square;stroke-linejoin:miter;"/>
</g>
<g id="patch_8">
<path d="M 57.6 41.472
L 414.72 41.472
" style="fill:none;stroke:#ffffff;stroke-linecap:square;stroke-linejoin:miter;"/>
</g>
<g id="text_11">
<!-- minimal-lexical 0.42s -->
<g transform="translate(244.987737 177.287375)scale(0.1 -0.1)">
<defs>
<path d="M 3513 2113
L 3513 0
L 2938 0
L 2938 2094
Q 2938 2591 2744 2837
Q 2550 3084 2163 3084
Q 1697 3084 1428 2787
Q 1159 2491 1159 1978
L 1159 0
L 581 0
L 581 3500
L 1159 3500
L 1159 2956
Q 1366 3272 1645 3428
Q 1925 3584 2291 3584
Q 2894 3584 3203 3211
Q 3513 2838 3513 2113
z
" id="DejaVuSans-6e" transform="scale(0.015625)"/>
<path d="M 2194 1759
Q 1497 1759 1228 1600
Q 959 1441 959 1056
Q 959 750 1161 570
Q 1363 391 1709 391
Q 2188 391 2477 730
Q 2766 1069 2766 1631
L 2766 1759
L 2194 1759
z
M 3341 1997
L 3341 0
L 2766 0
L 2766 531
Q 2569 213 2275 61
Q 1981 -91 1556 -91
Q 1019 -91 701 211
Q 384 513 384 1019
Q 384 1609 779 1909
Q 1175 2209 1959 2209
L 2766 2209
L 2766 2266
Q 2766 2663 2505 2880
Q 2244 3097 1772 3097
Q 1472 3097 1187 3025
Q 903 2953 641 2809
L 641 3341
Q 956 3463 1253 3523
Q 1550 3584 1831 3584
Q 2591 3584 2966 3190
Q 3341 2797 3341 1997
z
" id="DejaVuSans-61" transform="scale(0.015625)"/>
<path d="M 603 4863
L 1178 4863
L 1178 0
L 603 0
L 603 4863
z
" id="DejaVuSans-6c" transform="scale(0.015625)"/>
<path d="M 313 2009
L 1997 2009
L 1997 1497
L 313 1497
L 313 2009
z
" id="DejaVuSans-2d" transform="scale(0.015625)"/>
<path d="M 3513 3500
L 2247 1797
L 3578 0
L 2900 0
L 1881 1375
L 863 0
L 184 0
L 1544 1831
L 300 3500
L 978 3500
L 1906 2253
L 2834 3500
L 3513 3500
z
" id="DejaVuSans-78" transform="scale(0.015625)"/>
<path d="M 3122 3366
L 3122 2828
Q 2878 2963 2633 3030
Q 2388 3097 2138 3097
Q 1578 3097 1268 2742
Q 959 2388 959 1747
Q 959 1106 1268 751
Q 1578 397 2138 397
Q 2388 397 2633 464
Q 2878 531 3122 666
L 3122 134
Q 2881 22 2623 -34
Q 2366 -91 2075 -91
Q 1284 -91 818 406
Q 353 903 353 1747
Q 353 2603 823 3093
Q 1294 3584 2113 3584
Q 2378 3584 2631 3529
Q 2884 3475 3122 3366
z
" id="DejaVuSans-63" transform="scale(0.015625)"/>
</defs>
<use xlink:href="#DejaVuSans-6d"/>
<use x="97.412109" xlink:href="#DejaVuSans-69"/>
<use x="125.195312" xlink:href="#DejaVuSans-6e"/>
<use x="188.574219" xlink:href="#DejaVuSans-69"/>
<use x="216.357422" xlink:href="#DejaVuSans-6d"/>
<use x="313.769531" xlink:href="#DejaVuSans-61"/>
<use x="375.048828" xlink:href="#DejaVuSans-6c"/>
<use x="402.832031" xlink:href="#DejaVuSans-2d"/>
<use x="438.916016" xlink:href="#DejaVuSans-6c"/>
<use x="466.699219" xlink:href="#DejaVuSans-65"/>
<use x="526.472656" xlink:href="#DejaVuSans-78"/>
<use x="585.652344" xlink:href="#DejaVuSans-69"/>
<use x="613.435547" xlink:href="#DejaVuSans-63"/>
<use x="668.416016" xlink:href="#DejaVuSans-61"/>
<use x="729.695312" xlink:href="#DejaVuSans-6c"/>
<use x="757.478516" xlink:href="#DejaVuSans-20"/>
<use x="789.265625" xlink:href="#DejaVuSans-30"/>
<use x="852.888672" xlink:href="#DejaVuSans-2e"/>
<use x="884.675781" xlink:href="#DejaVuSans-34"/>
<use x="948.298828" xlink:href="#DejaVuSans-32"/>
<use x="1011.921875" xlink:href="#DejaVuSans-73"/>
</g>
</g>
<g id="text_12">
<!-- Build Timings -->
<g transform="translate(187.7265 35.472)scale(0.144 -0.144)">
<defs>
<path d="M 1259 2228
L 1259 519
L 2272 519
Q 2781 519 3026 730
Q 3272 941 3272 1375
Q 3272 1813 3026 2020
Q 2781 2228 2272 2228
L 1259 2228
z
M 1259 4147
L 1259 2741
L 2194 2741
Q 2656 2741 2882 2914
Q 3109 3088 3109 3444
Q 3109 3797 2882 3972
Q 2656 4147 2194 4147
L 1259 4147
z
M 628 4666
L 2241 4666
Q 2963 4666 3353 4366
Q 3744 4066 3744 3513
Q 3744 3084 3544 2831
Q 3344 2578 2956 2516
Q 3422 2416 3680 2098
Q 3938 1781 3938 1306
Q 3938 681 3513 340
Q 3088 0 2303 0
L 628 0
L 628 4666
z
" id="DejaVuSans-42" transform="scale(0.015625)"/>
<path d="M 544 1381
L 544 3500
L 1119 3500
L 1119 1403
Q 1119 906 1312 657
Q 1506 409 1894 409
Q 2359 409 2629 706
Q 2900 1003 2900 1516
L 2900 3500
L 3475 3500
L 3475 0
L 2900 0
L 2900 538
Q 2691 219 2414 64
Q 2138 -91 1772 -91
Q 1169 -91 856 284
Q 544 659 544 1381
z
M 1991 3584
L 1991 3584
z
" id="DejaVuSans-75" transform="scale(0.015625)"/>
<path d="M 2906 2969
L 2906 4863
L 3481 4863
L 3481 0
L 2906 0
L 2906 525
Q 2725 213 2448 61
Q 2172 -91 1784 -91
Q 1150 -91 751 415
Q 353 922 353 1747
Q 353 2572 751 3078
Q 1150 3584 1784 3584
Q 2172 3584 2448 3432
Q 2725 3281 2906 2969
z
M 947 1747
Q 947 1113 1208 752
Q 1469 391 1925 391
Q 2381 391 2643 752
Q 2906 1113 2906 1747
Q 2906 2381 2643 2742
Q 2381 3103 1925 3103
Q 1469 3103 1208 2742
Q 947 2381 947 1747
z
" id="DejaVuSans-64" transform="scale(0.015625)"/>
<path d="M 2906 1791
Q 2906 2416 2648 2759
Q 2391 3103 1925 3103
Q 1463 3103 1205 2759
Q 947 2416 947 1791
Q 947 1169 1205 825
Q 1463 481 1925 481
Q 2391 481 2648 825
Q 2906 1169 2906 1791
z
M 3481 434
Q 3481 -459 3084 -895
Q 2688 -1331 1869 -1331
Q 1566 -1331 1297 -1286
Q 1028 -1241 775 -1147
L 775 -588
Q 1028 -725 1275 -790
Q 1522 -856 1778 -856
Q 2344 -856 2625 -561
Q 2906 -266 2906 331
L 2906 616
Q 2728 306 2450 153
Q 2172 0 1784 0
Q 1141 0 747 490
Q 353 981 353 1791
Q 353 2603 747 3093
Q 1141 3584 1784 3584
Q 2172 3584 2450 3431
Q 2728 3278 2906 2969
L 2906 3500
L 3481 3500
L 3481 434
z
" id="DejaVuSans-67" transform="scale(0.015625)"/>
</defs>
<use xlink:href="#DejaVuSans-42"/>
<use x="68.603516" xlink:href="#DejaVuSans-75"/>
<use x="131.982422" xlink:href="#DejaVuSans-69"/>
<use x="159.765625" xlink:href="#DejaVuSans-6c"/>
<use x="187.548828" xlink:href="#DejaVuSans-64"/>
<use x="251.025391" xlink:href="#DejaVuSans-20"/>
<use x="282.8125" xlink:href="#DejaVuSans-54"/>
<use x="340.771484" xlink:href="#DejaVuSans-69"/>
<use x="368.554688" xlink:href="#DejaVuSans-6d"/>
<use x="465.966797" xlink:href="#DejaVuSans-69"/>
<use x="493.75" xlink:href="#DejaVuSans-6e"/>
<use x="557.128906" xlink:href="#DejaVuSans-67"/>
<use x="620.605469" xlink:href="#DejaVuSans-73"/>
</g>
</g>
</g>
</g>
<defs>
<clipPath id="pffce4df39a">
<rect height="266.112" width="357.12" x="57.6" y="41.472"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 23 KiB

+179
View File
@@ -0,0 +1,179 @@
#!/usr/bin/env python
'''
timings
=======
Plot the timings from building minimal-lexical.
'''
import argparse
import json
import subprocess
import os
import matplotlib.pyplot as plt
from matplotlib import patches
from matplotlib import textpath
plt.style.use('ggplot')
scripts = os.path.dirname(os.path.realpath(__file__))
home = os.path.dirname(scripts)
def parse_args(argv=None):
'''Create and parse our command line arguments.'''
parser = argparse.ArgumentParser(description='Time building minimal-lexical.')
parser.add_argument(
'--features',
help='''optional features to add''',
default='',
)
parser.add_argument(
'--no-default-features',
help='''disable default features''',
action='store_true',
)
return parser.parse_args(argv)
def clean(directory=home):
'''Clean the project'''
os.chdir(directory)
subprocess.check_call(
['cargo', '+nightly', 'clean'],
shell=False,
stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL,
)
def build(args):
'''Build the project and get the timings output.'''
command = 'cargo +nightly build -Z timings=json'
if args.no_default_features:
command = f'{command} --no-default-features'
if args.features:
command = f'{command} --features={args.features}'
process = subprocess.Popen(
# Use shell for faster performance.
# Spawning a new process is a **lot** slower, gives misleading info.
command,
shell=True,
stderr=subprocess.DEVNULL,
stdout=subprocess.PIPE,
)
process.wait()
data = {}
for line in iter(process.stdout.readline, b''):
line = line.decode('utf-8')
crate = json.loads(line)
name = crate['target']['name']
data[name] = (crate['duration'], crate['rmeta_time'])
process.stdout.close()
return data
def filename(basename, args):
'''Get a resilient name for the benchmark data.'''
name = basename
if args.no_default_features:
name = f'{name}_nodefault'
if args.features:
name = f'{name}_features={args.features}'
return name
def plot_timings(timings, output):
'''Plot our timings data.'''
offset = 0
text_length = 0
count = len(timings) + 1
fig, ax = plt.subplots()
bar_height = count * 0.05
def plot_timing(name):
'''Plot the timing of a specific value.'''
nonlocal count
nonlocal text_length
if name not in timings:
return
duration, rmeta = timings[name]
local_offset = offset
ax.add_patch(patches.Rectangle(
(offset, count - bar_height / 2), duration, bar_height,
alpha=0.6,
facecolor='lightskyblue',
label=name,
))
local_offset += rmeta
ax.add_patch(patches.Rectangle(
(local_offset, count - bar_height / 2), duration - rmeta, bar_height,
alpha=0.6,
facecolor='darkorchid',
label=f'{name}_rmeta',
))
local_offset += duration - rmeta
text = f'minimal-lexical {round(duration, 2)}s'
text_length = max(len(text), text_length)
ax.annotate(
text,
xy=(local_offset + 0.02, count),
xycoords='data',
horizontalalignment='left',
verticalalignment='center',
)
count -= 1
def max_duration(*keys):
'''Get the max duration from a list of keys.'''
max_time = 0
for key in keys:
if key not in timings:
continue
max_time = max(timings[key][0], max_time)
return max_time
# Plot in order of our dependencies.
plot_timing('minimal-lexical')
offset += max_duration('minimal-lexical')
title = 'Build Timings'
ax.set_title(title)
ax.set_xlabel('Time (s)')
# Hide the y-axis labels.
ax.set_yticks(list(range(1, len(timings) + 2)))
ax.yaxis.set_tick_params(which='both', length=0)
plt.setp(ax.get_yticklabels(), visible=False)
# Ensure the canvas includes all the annotations.
# 0.5 is long enough for the largest label.
plt.xlim(0, offset + 0.02 * text_length)
plt.ylim(count + 0.5, len(timings) + 1.5)
# Save the figure.
fig.savefig(output, format='svg')
fig.clf()
def plot(args):
'''Build and plot the timings for the root module.'''
clean()
timings = build(args)
path = f'{home}/assets/timings_{filename("timings", args)}_{os.name}.svg'
plot_timings(timings, path)
def main(argv=None):
'''Entry point.'''
args = parse_args(argv)
plot(args)
if __name__ == '__main__':
main()