Artifactspublic-v0

curl

master
ply4 git calls28 ms289 KiB3 cachedprotocol v2
239 lines9.0 KiBRaw
1/***************************************************************************
2 * _ _ ____ _
3 * Project ___| | | | _ \| |
4 * / __| | | | |_) | |
5 * | (__| |_| | _ <| |___
6 * \___|\___/|_| \_\_____|
7 *
8 * Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
9 *
10 * This software is licensed as described in the file COPYING, which
11 * you should have received as part of this distribution. The terms
12 * are also available at https://curl.se/docs/copyright.html.
13 *
14 * You may opt to use, copy, modify, merge, publish, distribute and/or sell
15 * copies of the Software, and permit persons to whom the Software is
16 * furnished to do so, under the terms of the COPYING file.
17 *
18 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19 * KIND, either express or implied.
20 *
21 * SPDX-License-Identifier: curl
22 *
23 ***************************************************************************/
24#include "first.h"
26struct num {
27 const char *str;
28 int base;
29 curl_off_t max;
30};
32static const struct num nums[] = {
33 { "9223372036854775807", 10, 9223372036854775807LL },
34 { "123456789123456123A", 10, 9223372036854775807LL },
35 { "123456789123456123B", 10, 9223372036854775807LL },
36 { "123456789123456123C", 10, 9223372036854775807LL },
37 { "123456789123456123D", 10, 9223372036854775807LL },
38 { "1234567891234561234", 10, 9223372036854775807LL },
39 { "123456789123456123", 10, 9223372036854775807LL },
40 { "12345678912345612", 10, 9223372036854775807LL },
41 { "1234567891234561", 10, 9223372036854775807LL },
42 { "123456789123456", 10, 9223372036854775807LL },
43 { "12345678912345", 10, 9223372036854775807LL },
44 { "1234567891234", 10, 9223372036854775807LL },
45 { "123456789123", 10, 9223372036854775807LL },
46 { "12345678912", 10, 9223372036854775807LL },
47 { "1234567891", 10, 9223372036854775807LL },
48 { "123456789", 10, 9223372036854775807LL },
49 { "12345678", 10, 9223372036854775807LL },
50 { "1234567", 10, 9223372036854775807LL },
51 { "123456", 10, 9223372036854775807LL },
52 { "12345", 10, 9223372036854775807LL },
53 { "1234", 10, 9223372036854775807LL },
54 { "123", 10, 9223372036854775807LL },
55 { "12", 10, 9223372036854775807LL },
56 { "1", 10, 9223372036854775807 },
57 { "9223372036854775807", 10, 9223372036854775806LL },
58 { "1234567891234561234", 10, 1234567891234561233LL },
59 { "234567891234561234", 10, 234567891234561233LL },
60 { "34567891234561234", 10, 34567891234561233LL },
61 { "4567891234561234", 10, 4567891234561233LL },
62 { "567891234561234", 10, 567891234561233LL },
63 { "67891234561234", 10, 67891234561233LL },
64 { "7891234561234", 10, 7891234561233LL },
65 { "891234561234", 10, 891234561233LL },
66 { "91234561234", 10, 91234561233LL },
67 { "1234561234", 10, 1234561233LL },
68 { "234561234", 10, 234561233LL },
69 { "34561234", 10, 34561233LL },
70 { "4561234", 10, 4561233LL },
72 { "7FFFFFFFFFFFFFFF", 16, 0x7FFFFFFFFFFFFFFFLL },
73 { "7FFFFFFFFFFFFFFF", 16, 0x7FFFFFFFFFFFFFFELL },
74 { "7FFFFFFFFFFFFFFF", 16, 0x7FFFFFFFFFFFFFFDLL },
75 { "7FFFFFFFFFFFFFFF", 16, 0x7FFFFFFFFFFFFFFCLL },
76 { "7FFFFFFFFFFFFFFF", 16, 0x7FFFFFFFFFFFFFFBLL },
77 { "7FFFFFFFFFFFFFFE", 16, 0x7FFFFFFFFFFFFFFFLL },
78 { "7FFFFFFFFFFFFFFD", 16, 0x7FFFFFFFFFFFFFFFLL },
79 { "7FFFFFFFFFFFFFFC", 16, 0x7FFFFFFFFFFFFFFFLL },
80 { "7FFFFFFFFFFFFFFB", 16, 0x7FFFFFFFFFFFFFFFLL },
81 { "7FFFFFFFFFFFFFFA", 16, 0x7FFFFFFFFFFFFFFFLL },
82 { "7FFFFFFFFFFFFFF9", 16, 0x7FFFFFFFFFFFFFFFLL },
83 { "7FFFFFFFFFFFFFFG", 16, 0x7FFFFFFFFFFFFFFFLL },
84 { "GFFFFFFFFFFFFFF9", 16, 0x7FFFFFFFFFFFFFFFLL },
85 { "HFFFFFFFFFFFFFF9", 16, 0x7FFFFFFFFFFFFFFFLL },
86 { "IFFFFFFFFFFFFFF9", 16, 0x7FFFFFFFFFFFFFFFLL },
87 { "KFFFFFFFFFFFFFF9", 16, 0x7FFFFFFFFFFFFFFFLL },
88 { "1234567890123456", 16, 0x1234567890123456LL },
89 { "123456789012345G", 16, 0x1234567890123456LL },
90 { "123456789012345H", 16, 0x1234567890123456LL },
91 { "123456789012345I", 16, 0x1234567890123456LL },
92 { "123456789012345J", 16, 0x1234567890123456LL },
93 { "123456789012345K", 16, 0x1234567890123456LL },
94 { "234567890123456", 16, 0x1234567890123456LL },
95 { "34567890123456", 16, 0x1234567890123456LL },
96 { "4567890123456", 16, 0x1234567890123456LL },
97 { "567890123456", 16, 0x1234567890123456LL },
98 { "567890123456", 16, 0x1234567890123456LL },
99 { "67890123456", 16, 0x1234567890123456LL },
100 { "7890123456", 16, 0x1234567890123456LL },
101 { "890123456", 16, 0x1234567890123456LL },
102 { "90123456", 16, 0x1234567890123456LL },
103 { "0123456", 16, 0x1234567890123456LL },
104 { "123456", 16, 0x1234567890123456LL },
105 { "23456", 16, 0x1234567890123456LL },
106 { "3456", 16, 0x1234567890123456LL },
107 { "456", 16, 0x1234567890123456LL },
108 { "56", 16, 0x1234567890123456LL },
109 { "6", 16, 0x1234567890123456LL },
111 { "1234567890123456", 16, 0x1234567890123455LL },
112 { "234567890123456", 16, 0x234567890123455LL },
113 { "34567890123456", 16, 0x34567890123455LL },
114 { "4567890123456", 16, 0x4567890123455LL },
115 { "67890123456", 16, 0x67890123455LL },
116 { "7890123456", 16, 0x7890123455LL },
117 { "890123456", 16, 0x890123455LL },
118 { "90123456", 16, 0x90123455LL },
119 { "0123456", 16, 0x0123455LL },
120 { "123456", 16, 0x123455LL },
121 { "23456", 16, 0x23455LL },
123 { "10", 10, 5 },
124 { "9", 10, 5 },
125 { "8", 10, 5 },
126 { "7", 10, 5 },
127 { "3", 10, 5 },
128 { "2", 10, 5 },
129 { "1", 10, 5 },
131 { "10", 16, 8 },
132 { "9", 16, 8 },
133 { "8", 16, 8 },
134 { "7", 16, 6 },
135 { "3", 16, 7 },
136 { "2", 16, 5 },
137 { "1", 16, 5 },
139 {"777777777777777777777", 8, 0777777777777777777777LL },
140 {"777777777777777777776", 8, 0777777777777777777777LL },
141 {"777777777777777777775", 8, 0777777777777777777777LL },
142 {"777777777777777777774", 8, 0777777777777777777777LL },
143 {"777777777777777777773", 8, 0777777777777777777777LL },
144 {"777777777777777777772", 8, 0777777777777777777777LL },
145 {"777777777777777777779", 8, 0777777777777777777777LL },
146 {"123456701234567012345", 8, 0123456701234567012345LL },
147 {"12345670123456701234", 8, 0123456701234567012345LL },
148 {"1234567012345670123", 8, 0123456701234567012345LL },
149 {"123456701234567012", 8, 0123456701234567012345LL },
150 {"12345670123456701", 8, 0123456701234567012345LL },
151 {"1234567012345670", 8, 0123456701234567012345LL },
152 {"123456701234567", 8, 0123456701234567012345LL },
153 {"12345670123456", 8, 0123456701234567012345LL },
154 {"1234567012345", 8, 0123456701234567012345LL },
155 {"123456701234", 8, 0123456701234567012345LL },
156 {"12345670123", 8, 0123456701234567012345LL },
157 {"1234567012", 8, 0123456701234567012345LL },
158 {"123456701", 8, 0123456701234567012345LL },
160 {"123456701234567012345", 8, 0123456701234567012344LL },
161 {"23456701234567012345", 8, 023456701234567012344LL },
162 {"3456701234567012345", 8, 03456701234567012344LL },
163 {"456701234567012345", 8, 0456701234567012344LL },
164 {"56701234567012345", 8, 056701234567012344LL },
165 {"6701234567012345", 8, 06701234567012344LL },
166 {"701234567012345", 8, 0701234567012344LL },
167 {"01234567012345", 8, 01234567012344LL },
168 {"1234567012345", 8, 01234567012344LL },
169 {"234567012345", 8, 0234567012344LL },
170 {"34567012345", 8, 034567012344LL },
171 {"4567012345", 8, 04567012344LL },
172 {"567012345", 8, 0567012344LL },
173 {"67012345", 8, 067012344LL },
175 {"123456701234567012348", 8, 0123456701234567012344LL },
176 {"123456701234567012349", 8, 0123456701234567012344LL },
177 {"12345670123456701234A", 8, 0123456701234567012344LL },
178 {"12345670123456701234C", 8, 0123456701234567012344LL },
179 {"12345670123456701234B", 8, 0123456701234567012344LL },
181};
183/*
184 * Parse the numbers
185 */
186static int test_numparser(int argc, const char **argv)
188 struct curltime start;
189 struct curltime end;
190 timediff_t us;
191 long long hn;
192 curl_off_t loops = 500000, loop;
193 curl_off_t count = 0;
194 curl_off_t ecount = 0; /* errors */
195 size_t i;
196 size_t nnumbers = CURL_ARRAYSIZE(nums);
198 if(argc > 1) {
199 const char *ptr = argv[1];
200 curl_off_t num;
201 if(!curlx_str_number(&ptr, &num, INT_MAX) && !*ptr)
202 loops = num;
203 }
205 curl_mprintf("Found %zu numbers to parse\n", nnumbers);
207 start = curlx_now();
208 for(loop = 0; loop < loops; loop++) {
209 for(i = 0; i < nnumbers; i++) {
210 const char *p = nums[i].str;
211 curl_off_t val;
212 int err;
213 if(nums[i].base == 10)
214 err = curlx_str_number(&p, &val, nums[i].max);
215 else if(nums[i].base == 16)
216 err = curlx_str_hex(&p, &val, nums[i].max);
217 else
218 err = curlx_str_octal(&p, &val, nums[i].max);
219 if(err)
220 ecount++;
221 count++;
222 }
223 }
224 end = curlx_now();
225 us = curlx_timediff_us(end, start); /* how many microseconds */
226 hn = count ? us * 1000000 / count : 0; /* 1000 times too big */
227 curl_mprintf("Numbers: %" CURL_FORMAT_CURL_OFF_T "\n"
228 "Time: %lld usecs\n"
229 "Time/num: %lld.%03lld ns\n"
230 "Nums/sec: %lld\n"
231 "Errors: %" CURL_FORMAT_CURL_OFF_T "\n",
232 count,
233 (long long)us,
234 (long long)hn / 1000,
235 (long long)hn % 1000,
236 us ? (long long)(count * 1000000) / us : 0,
237 ecount);
238 return 0;
Diagnostics4 git calls · 28 ms
CallStatusSizeTime028 ms
discover200152 B2 ms
git.upload-pack discover
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=ls-refs
git.upstream.dur_ms=2
git.response.bytes=152
git.server.agent=gitty/1.0
git.server.object_format=sha1
git.server.caps=agent ls-refs fetch object-format
git.server.fetch=shallow filter sideband-all
git.protocol.version=2
git.pkt.frames=8
git.pkt.data=6
git.pkt.flush=2
git.pkt.delim=0
git.pkt.bytes=152
git.pkt.payload.max=34
ls-refs200149 B · hit3 ms
git.upload-pack ls-refs
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=ls-refs
git.upstream.dur_ms=3
git.response.bytes=149
git.response.cache=HIT
git.response.duration_ms=3
git.protocol.version=2
git.pkt.frames=3
git.pkt.data=2
git.pkt.flush=1
git.pkt.delim=0
git.pkt.bytes=149
git.pkt.payload.max=78
git.ls_refs.count=2
git.ls_refs.head=refs/heads/master
fetchblob:none · deepen 10200287 KiB · hit2 ms
git.upload-pack fetch
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=2
git.response.bytes=293470
git.response.cache=HIT
git.response.duration_ms=2
git.fetch.filter=blob:none
git.fetch.filter.requested=tree:0
git.fetch.filter.fallback=blob:none
git.fetch.filter.learned=false
git.fetch.wants=31c911efe5652725e930f4d2e60c9060e5f6646d
git.fetch.haves.count=0
git.fetch.deepen=10
git.fetch.thin_pack=false
git.fetch.ofs_delta=true
git.protocol.version=2
git.pkt.frames=10
git.pkt.data=8
git.pkt.flush=1
git.pkt.delim=1
git.pkt.bytes=293470
git.pkt.payload.max=65516
git.sideband.band1.bytes=293354
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0
git.pack.objects=87
git.pack.bytes=293354
git.pack.ofs_delta=0
git.pack.ref_delta=1
git.pack.chain.max=1
git.pack.trailer=6a646bcda6740bab42e321b51998b52ea15146c0
git.pack.full=86
Open pack map
fetch2001.7 KiB · hit23 ms
git.upload-pack fetch
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=23
git.response.bytes=1734
git.response.cache=HIT
git.response.duration_ms=23
git.fetch.wants=da3ae34e0b63252c6787ef33723f5198a7f2e98f
git.fetch.haves.count=0
git.fetch.deepen=0
git.fetch.thin_pack=false
git.fetch.ofs_delta=true
git.protocol.version=2
git.pkt.frames=3
git.pkt.data=2
git.pkt.flush=1
git.pkt.delim=0
git.pkt.bytes=1734
git.pkt.payload.max=1713
git.sideband.band1.bytes=1712
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0

Each row is one HTTP round trip ply made to the git server for this page, on one timeline. discover asks what the server speaks, ls-refs lists branch tips, fetch brings objects by id. A hit was served by Workers Cache. Tap a row for its wire details.

Remote
https://5ad2236b39de4c8bd8f6270ea63f3ea9.artifacts.cloudflare.net/git/public-v0/curl.git
Ref
refs/heads/master
Commit
31c911efe5652725e930f4d2e60c9060e5f6646d
cf-ray
a5e2f94c9ed790c0
Request
b7b30700…
Protocol
v2 · sha1
Agent
gitty/1.0
Filter
advertised
Fetch
shallow filter sideband-all
Capabilities
agent ls-refs fetch object-format