MCPcopy Create free account
hub / github.com/segmentio/encoding / BenchmarkTokenizer

Function BenchmarkTokenizer

json/token_test.go:233–333  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

231}
232
233func BenchmarkTokenizer(b *testing.B) {
234 values := []struct {
235 scenario string
236 payload []byte
237 }{
238 {
239 scenario: "null",
240 payload: []byte(`null`),
241 },
242
243 {
244 scenario: "true",
245 payload: []byte(`true`),
246 },
247
248 {
249 scenario: "false",
250 payload: []byte(`false`),
251 },
252
253 {
254 scenario: "number",
255 payload: []byte(`-1.23456789`),
256 },
257
258 {
259 scenario: "string",
260 payload: []byte(`"1234567890"`),
261 },
262
263 {
264 scenario: "object",
265 payload: []byte(`{
266 "timestamp": "2019-01-09T18:59:57.456Z",
267 "channel": "server",
268 "type": "track",
269 "event": "Test",
270 "userId": "test-user-whatever",
271 "messageId": "test-message-whatever",
272 "integrations": {
273 "whatever": {
274 "debugMode": false
275 },
276 "myIntegration": {
277 "debugMode": true
278 }
279 },
280 "properties": {
281 "trait1": 1,
282 "trait2": "test",
283 "trait3": true
284 },
285 "settings": {
286 "apiKey": "1234567890",
287 "debugMode": false,
288 "directChannels": [
289 "server",
290 "client"

Callers

nothing calls this directly

Calls 4

ResetMethod · 0.95
NextMethod · 0.95
NewTokenizerFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…