Last active
September 28, 2021 00:14
-
-
Save GeorgeHahn/c427bc0a051956a31956f5da1070ef0a to your computer and use it in GitHub Desktop.
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
[package] | |
name = "min" | |
version = "0.1.0" | |
edition = "2018" | |
[dependencies] | |
serde = { version = "=1.0.130", features = ["derive"] } | |
serde_json = "=1.0.68" |
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
#![feature(bench_black_box)] | |
use std::hint::black_box; | |
pub fn deserialize_big_struct(val: &str) -> Result<BigStruct, ()> { | |
serde_json::from_str(val).map_err(|_e| ()) | |
} | |
pub fn main() { | |
let val = deserialize_big_struct("{ }").unwrap(); | |
black_box(val); | |
} | |
#[derive(serde::Deserialize)] | |
pub struct BigStruct { | |
pub val_001: bool, | |
pub val_002: i32, | |
pub val_003: Vec<String>, | |
pub val_004: String, | |
pub val_005: String, | |
pub val_006: String, | |
pub val_007: String, | |
pub val_008: String, | |
pub val_009: String, | |
pub val_010: String, | |
pub val_011: String, | |
pub val_012: bool, | |
pub val_013: String, | |
pub val_014: String, | |
pub val_015: String, | |
pub val_016: bool, | |
pub val_017: String, | |
pub val_018: i32, | |
pub val_019: i32, | |
pub val_020: i32, | |
pub val_021: i32, | |
pub val_022: i32, | |
pub val_023: String, | |
pub val_024: String, | |
pub val_025: String, | |
pub val_026: String, | |
pub val_027: String, | |
pub val_028: String, | |
pub val_029: String, | |
pub val_030: i32, | |
pub val_031: i32, | |
pub val_032: i32, | |
pub val_033: Vec<String>, | |
pub val_034: String, | |
pub val_035: String, | |
pub val_036: String, | |
pub val_037: i32, | |
pub val_038: i32, | |
pub val_039: i32, | |
pub val_040: i32, | |
pub val_041: Vec<String>, | |
pub val_042: i32, | |
pub val_043: i32, | |
pub val_044: i32, | |
pub val_045: i32, | |
pub val_046: i32, | |
pub val_047: i32, | |
pub val_048: i32, | |
pub val_049: i32, | |
pub val_050: i32, | |
pub val_051: i32, | |
pub val_052: String, | |
pub val_053: String, | |
pub val_054: String, | |
pub val_055: i32, | |
pub val_056: i32, | |
pub val_057: i32, | |
pub val_058: i32, | |
pub val_059: i32, | |
pub val_060: i32, | |
pub val_061: i32, | |
pub val_062: String, | |
pub val_063: bool, | |
pub val_064: String, | |
pub val_065: i32, | |
pub val_066: String, | |
pub val_067: String, | |
pub val_068: String, | |
pub val_069: String, | |
pub val_070: String, | |
pub val_071: String, | |
pub val_072: String, | |
pub val_073: String, | |
pub val_074: String, | |
pub val_075: String, | |
pub val_076: String, | |
pub val_077: String, | |
pub val_078: String, | |
pub val_079: String, | |
pub val_080: String, | |
pub val_081: String, | |
pub val_082: String, | |
pub val_083: String, | |
pub val_084: String, | |
pub val_085: String, | |
pub val_086: String, | |
pub val_087: i32, | |
pub val_088: i32, | |
pub val_089: String, | |
pub val_090: String, | |
pub val_091: String, | |
pub val_092: String, | |
pub val_093: String, | |
pub val_094: String, | |
pub val_095: String, | |
pub val_096: String, | |
pub val_097: String, | |
pub val_098: String, | |
pub val_099: String, | |
pub val_100: String, | |
pub val_101: String, | |
pub val_102: String, | |
pub val_103: bool, | |
pub val_104: String, | |
pub val_105: String, | |
pub val_106: bool, | |
pub val_107: bool, | |
pub val_108: bool, | |
pub val_109: String, | |
pub val_110: bool, | |
pub val_111: String, | |
pub val_112: bool, | |
pub val_113: String, | |
pub val_114: String, | |
pub val_115: i32, | |
pub val_116: i32, | |
pub val_117: i32, | |
pub val_118: bool, | |
pub val_119: bool, | |
pub val_120: bool, | |
pub val_121: i32, | |
pub val_122: i32, | |
pub val_123: i32, | |
pub val_124: i32, | |
pub val_125: i32, | |
pub val_126: i32, | |
pub val_127: i32, | |
pub val_128: i32, | |
pub val_129: i32, | |
pub val_130: i32, | |
pub val_131: i32, | |
pub val_132: i32, | |
pub val_133: bool, | |
pub val_134: bool, | |
pub val_135: bool, | |
pub val_136: bool, | |
pub val_137: String, | |
pub val_138: i32, | |
pub val_139: bool, | |
pub val_140: String, | |
pub val_141: bool, | |
pub val_142: Vec<String>, | |
pub val_143: Vec<String>, | |
pub val_144: bool, | |
pub val_145: String, | |
pub val_146: String, | |
pub val_147: bool, | |
pub val_148: bool, | |
pub val_149: bool, | |
pub val_150: bool, | |
pub val_151: bool, | |
pub val_152: bool, | |
pub val_153: bool, | |
pub val_154: bool, | |
pub val_155: bool, | |
pub val_156: String, | |
pub val_157: bool, | |
pub val_158: String, | |
pub val_159: i32, | |
pub val_160: i32, | |
pub val_161: i32, | |
pub val_162: i32, | |
pub val_163: i32, | |
pub val_164: i32, | |
pub val_165: i32, | |
pub val_166: i32, | |
pub val_167: bool, | |
pub val_168: bool, | |
pub val_169: bool, | |
pub val_170: bool, | |
pub val_171: bool, | |
pub val_172: String, | |
pub val_173: String, | |
pub val_174: i32, | |
pub val_175: i32, | |
pub val_176: i32, | |
pub val_177: i32, | |
pub val_178: i32, | |
pub val_179: i32, | |
pub val_180: bool, | |
pub val_181: String, | |
pub val_182: i32, | |
pub val_183: i32, | |
pub val_184: i32, | |
pub val_185: i32, | |
pub val_186: i32, | |
pub val_187: bool, | |
pub val_188: String, | |
pub val_189: bool, | |
pub val_190: bool, | |
pub val_191: bool, | |
pub val_192: bool, | |
pub val_193: i32, | |
pub val_194: bool, | |
pub val_195: String, | |
pub val_196: String, | |
pub val_197: bool, | |
pub val_198: String, | |
pub val_199: String, | |
pub val_200: i32, | |
pub val_201: i32, | |
pub val_202: i32, | |
pub val_203: i32, | |
pub val_204: i32, | |
pub val_205: i32, | |
pub val_206: String, | |
pub val_207: i32, | |
pub val_208: i32, | |
pub val_209: i32, | |
pub val_210: i32, | |
pub val_211: i32, | |
pub val_212: bool, | |
pub val_213: i32, | |
pub val_214: bool, | |
pub val_215: i32, | |
pub val_216: i32, | |
pub val_217: i32, | |
pub val_218: i32, | |
pub val_219: String, | |
pub val_220: String, | |
pub val_221: i32, | |
pub val_222: i32, | |
pub val_223: i32, | |
pub val_224: i32, | |
pub val_225: bool, | |
pub val_226: bool, | |
pub val_227: bool, | |
pub val_228: bool, | |
pub val_229: bool, | |
pub val_230: bool, | |
pub val_231: bool, | |
pub val_232: bool, | |
pub val_233: bool, | |
pub val_234: String, | |
pub val_235: String, | |
pub val_236: String, | |
pub val_237: String, | |
pub val_238: bool, | |
pub val_239: i32, | |
pub val_240: i32, | |
pub val_241: i32, | |
pub val_242: i32, | |
pub val_243: String, | |
pub val_244: String, | |
pub val_245: String, | |
pub val_246: i32, | |
pub val_247: i32, | |
pub val_248: i32, | |
pub val_249: i32, | |
pub val_250: bool, | |
pub val_251: bool, | |
pub val_252: bool, | |
pub val_253: bool, | |
pub val_254: bool, | |
pub val_255: i32, | |
pub val_256: i32, | |
pub val_257: i32, | |
pub val_258: i32, | |
pub val_259: i32, | |
pub val_260: bool, | |
pub val_261: bool, | |
pub val_262: bool, | |
pub val_263: bool, | |
pub val_264: bool, | |
pub val_265: i32, | |
pub val_266: bool, | |
pub val_267: bool, | |
pub val_268: String, | |
pub val_269: bool, | |
pub val_270: bool, | |
pub val_271: bool, | |
pub val_272: bool, | |
pub val_273: bool, | |
pub val_274: String, | |
pub val_275: bool, | |
pub val_276: bool, | |
pub val_277: bool, | |
pub val_278: bool, | |
pub val_279: bool, | |
pub val_280: bool, | |
pub val_281: String, | |
pub val_282: bool, | |
pub val_283: String, | |
pub val_284: String, | |
pub val_285: i32, | |
pub val_286: i32, | |
pub val_287: i32, | |
pub val_288: i32, | |
pub val_289: i32, | |
pub val_290: i32, | |
pub val_291: i32, | |
pub val_292: i32, | |
pub val_293: bool, | |
pub val_294: bool, | |
pub val_295: bool, | |
pub val_296: bool, | |
pub val_297: bool, | |
pub val_298: String, | |
pub val_299: String, | |
pub val_300: i32, | |
pub val_301: i32, | |
pub val_302: i32, | |
pub val_303: i32, | |
pub val_304: i32, | |
pub val_305: bool, | |
pub val_306: String, | |
pub val_307: bool, | |
pub val_308: bool, | |
pub val_309: bool, | |
pub val_310: bool, | |
pub val_311: i32, | |
pub val_312: bool, | |
pub val_313: i32, | |
pub val_314: i32, | |
pub val_315: bool, | |
pub val_316: i32, | |
pub val_317: i32, | |
pub val_318: i32, | |
pub val_319: i32, | |
pub val_320: i32, | |
pub val_321: bool, | |
pub val_322: i32, | |
pub val_323: i32, | |
pub val_324: i32, | |
pub val_325: String, | |
pub val_326: bool, | |
pub val_327: bool, | |
pub val_328: bool, | |
pub val_329: bool, | |
pub val_330: String, | |
pub val_331: i32, | |
pub val_332: String, | |
pub val_333: String, | |
pub val_334: String, | |
pub val_335: String, | |
pub val_336: String, | |
pub val_337: String, | |
pub val_338: bool, | |
pub val_339: i32, | |
pub val_340: bool, | |
pub val_341: String, | |
pub val_342: String, | |
pub val_343: String, | |
pub val_344: String, | |
pub val_345: String, | |
pub val_346: String, | |
pub val_347: String, | |
pub val_348: String, | |
pub val_349: String, | |
pub val_350: bool, | |
pub val_351: bool, | |
pub val_352: i32, | |
pub val_353: String, | |
pub val_354: String, | |
pub val_355: String, | |
pub val_356: String, | |
pub val_357: String, | |
pub val_358: String, | |
pub val_359: String, | |
pub val_360: bool, | |
pub val_361: String, | |
pub val_362: bool, | |
pub val_363: bool, | |
pub val_364: bool, | |
pub val_365: bool, | |
pub val_366: i32, | |
pub val_367: f64, | |
pub val_368: Vec<String>, | |
pub val_369: f64, | |
pub val_370: Vec<String>, | |
pub val_371: i32, | |
pub val_372: bool, | |
pub val_373: bool, | |
pub val_374: bool, | |
pub val_375: bool, | |
pub val_376: bool, | |
pub val_377: bool, | |
pub val_378: bool, | |
pub val_379: Vec<String>, | |
pub val_380: bool, | |
pub val_381: Vec<String>, | |
pub val_382: String, | |
pub val_383: i32, | |
pub val_384: i32, | |
pub val_385: bool, | |
pub val_386: bool, | |
pub val_387: bool, | |
pub val_388: i32, | |
pub val_389: String, | |
pub val_390: bool, | |
pub val_391: i32, | |
pub val_392: String, | |
pub val_393: bool, | |
pub val_394: Vec<String>, | |
pub val_395: bool, | |
pub val_396: i32, | |
pub val_397: bool, | |
pub val_398: String, | |
pub val_399: bool, | |
pub val_400: bool, | |
pub val_401: bool, | |
pub val_402: bool, | |
pub val_403: bool, | |
pub val_404: bool, | |
pub val_405: bool, | |
pub val_406: bool, | |
pub val_407: bool, | |
pub val_408: bool, | |
pub val_409: bool, | |
pub val_410: bool, | |
pub val_411: bool, | |
pub val_412: bool, | |
pub val_413: bool, | |
pub val_414: bool, | |
pub val_415: i32, | |
pub val_416: bool, | |
pub val_417: bool, | |
pub val_418: bool, | |
pub val_419: bool, | |
pub val_420: bool, | |
pub val_421: Vec<String>, | |
pub val_422: bool, | |
pub val_423: Vec<String>, | |
pub val_424: bool, | |
pub val_425: Vec<String>, | |
pub val_426: bool, | |
pub val_427: Vec<String>, | |
pub val_428: bool, | |
pub val_429: bool, | |
pub val_430: bool, | |
pub val_431: bool, | |
pub val_432: Vec<String>, | |
pub val_433: bool, | |
pub val_434: bool, | |
pub val_435: i32, | |
pub val_436: i32, | |
pub val_437: bool, | |
pub val_438: bool, | |
pub val_439: String, | |
pub val_440: bool, | |
pub val_441: bool, | |
pub val_442: bool, | |
pub val_443: bool, | |
pub val_444: bool, | |
pub val_445: bool, | |
pub val_446: i32, | |
pub val_447: bool, | |
pub val_448: bool, | |
pub val_449: bool, | |
pub val_450: i32, | |
pub val_451: i32, | |
pub val_452: bool, | |
pub val_453: bool, | |
pub val_454: String, | |
pub val_455: String, | |
pub val_456: Vec<String>, | |
pub val_457: Vec<String>, | |
pub val_458: Vec<String>, | |
pub val_459: Vec<String>, | |
pub val_460: Vec<String>, | |
pub val_461: Vec<String>, | |
pub val_462: Vec<String>, | |
pub val_463: Vec<String>, | |
pub val_464: Vec<String>, | |
pub val_465: String, | |
pub val_466: String, | |
pub val_467: String, | |
pub val_468: String, | |
pub val_469: String, | |
pub val_470: String, | |
pub val_471: String, | |
pub val_472: String, | |
pub val_473: String, | |
pub val_474: String, | |
pub val_475: String, | |
pub val_476: String, | |
pub val_477: String, | |
pub val_478: String, | |
pub val_479: String, | |
pub val_480: String, | |
pub val_481: i32, | |
pub val_482: Vec<String>, | |
pub val_483: i32, | |
pub val_484: String, | |
pub val_485: i32, | |
pub val_486: String, | |
pub val_487: bool, | |
pub val_488: i32, | |
pub val_489: String, | |
pub val_490: String, | |
pub val_491: String, | |
pub val_492: Vec<String>, | |
pub val_493: i32, | |
pub val_494: i32, | |
pub val_495: i32, | |
pub val_496: i32, | |
pub val_497: bool, | |
pub val_498: Vec<String>, | |
pub val_499: i32, | |
pub val_500: String, | |
pub val_501: i32, | |
pub val_502: bool, | |
pub val_503: bool, | |
pub val_504: i32, | |
pub val_505: String, | |
pub val_506: bool, | |
pub val_507: bool, | |
pub val_508: i32, | |
pub val_509: bool, | |
pub val_510: i32, | |
pub val_511: bool, | |
pub val_512: bool, | |
pub val_513: Vec<String>, | |
pub val_514: String, | |
pub val_515: i32, | |
pub val_516: String, | |
pub val_517: String, | |
pub val_518: String, | |
pub val_519: String, | |
pub val_520: String, | |
pub val_521: bool, | |
pub val_522: i32, | |
pub val_523: f64, | |
pub val_524: f64, | |
pub val_525: String, | |
pub val_526: String, | |
pub val_527: Vec<String>, | |
pub val_528: Vec<String>, | |
pub val_529: String, | |
pub val_530: String, | |
pub val_531: String, | |
pub val_532: String, | |
pub val_533: Vec<String>, | |
pub val_534: bool, | |
pub val_535: bool, | |
pub val_536: bool, | |
pub val_537: String, | |
pub val_538: String, | |
pub val_539: String, | |
pub val_540: String, | |
pub val_541: String, | |
pub val_542: String, | |
pub val_543: String, | |
pub val_544: String, | |
pub val_545: String, | |
pub val_546: f64, | |
pub val_547: String, | |
pub val_548: String, | |
pub val_549: String, | |
pub val_550: String, | |
pub val_551: String, | |
pub val_552: String, | |
pub val_553: String, | |
pub val_554: String, | |
pub val_555: String, | |
pub val_556: String, | |
pub val_557: String, | |
pub val_558: bool, | |
pub val_559: Vec<String>, | |
pub val_560: i32, | |
pub val_561: i32, | |
pub val_562: bool, | |
pub val_563: i32, | |
pub val_564: String, | |
pub val_565: String, | |
pub val_566: Vec<String>, | |
pub val_567: Vec<String>, | |
pub val_568: i32, | |
pub val_569: i32, | |
pub val_570: String, | |
pub val_571: i32, | |
pub val_572: bool, | |
pub val_573: String, | |
pub val_574: String, | |
pub val_575: String, | |
pub val_576: String, | |
pub val_577: String, | |
pub val_578: bool, | |
pub val_579: bool, | |
pub val_580: bool, | |
pub val_581: i32, | |
pub val_582: i32, | |
pub val_583: i32, | |
pub val_584: i32, | |
pub val_585: Vec<String>, | |
pub val_586: bool, | |
pub val_587: String, | |
pub val_588: String, | |
pub val_589: String, | |
pub val_590: String, | |
pub val_591: String, | |
pub val_592: String, | |
pub val_593: String, | |
pub val_594: String, | |
pub val_595: String, | |
pub val_596: String, | |
pub val_597: String, | |
pub val_598: String, | |
pub val_599: String, | |
pub val_600: String, | |
pub val_601: String, | |
pub val_602: String, | |
pub val_603: String, | |
pub val_604: String, | |
pub val_605: String, | |
pub val_606: String, | |
pub val_607: String, | |
pub val_608: String, | |
pub val_609: bool, | |
pub val_610: i32, | |
pub val_611: bool, | |
pub val_612: bool, | |
pub val_613: bool, | |
pub val_614: bool, | |
pub val_615: String, | |
pub val_616: String, | |
pub val_617: String, | |
pub val_618: i32, | |
pub val_619: i32, | |
pub val_620: i32, | |
pub val_621: i32, | |
pub val_622: i32, | |
pub val_623: i32, | |
pub val_624: i32, | |
pub val_625: i32, | |
pub val_626: i32, | |
pub val_627: i32, | |
pub val_628: i32, | |
pub val_629: i32, | |
pub val_630: i32, | |
pub val_631: i32, | |
pub val_632: i32, | |
pub val_633: i32, | |
pub val_634: String, | |
pub val_635: i32, | |
pub val_636: i32, | |
pub val_637: i32, | |
pub val_638: i32, | |
pub val_639: i32, | |
pub val_640: i32, | |
pub val_641: i32, | |
pub val_642: i32, | |
pub val_643: i32, | |
pub val_644: i32, | |
pub val_645: i32, | |
pub val_646: i32, | |
pub val_647: i32, | |
pub val_648: i32, | |
pub val_649: i32, | |
pub val_650: i32, | |
pub val_651: i32, | |
pub val_652: i32, | |
pub val_653: i32, | |
pub val_654: i32, | |
pub val_655: String, | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Rust
1.51
takes 3 minutesRust
1.52.1
takes 30 minutes