| //+------------------------------------------------------------------+
|
| //| Def.mqh |
|
| //| Copyright 2026, Niquel Mendoza |
|
| //| https://www.mql5.com |
|
| //+------------------------------------------------------------------+
|
| #property copyright "Copyright 2026, Niquel Mendoza"
|
| #property link "https://www.mql5.com"
|
| #property strict
|
|
|
| #ifndef JSONPARSERBYLEO_TEST_BEN_DEF_MQH
|
| #define JSONPARSERBYLEO_TEST_BEN_DEF_MQH
|
|
|
| //+------------------------------------------------------------------+
|
| //| |
|
| //+------------------------------------------------------------------+
|
| #ifndef JSONBENCH_RUN_PARSE
|
| #include <TSN\\Std\\MBen\\MBen.mqh>
|
| #include <TSN\\Random\\Base.mqh>
|
| #include <TSN\\Random\\Xoshiro256.mqh>
|
| #resource "test.json" as const string g_json_test_access;
|
|
|
| //+------------------------------------------------------------------+
|
| //| |
|
| //+------------------------------------------------------------------+
|
| #else // JSONBENCH_RUN_PARSE
|
| // Si cocremos el parsing
|
| #resource "twitter.json" as const uchar g_json_data[];
|
| #endif // JSONBENCH_RUN_PARSE
|
|
|
| //+------------------------------------------------------------------+
|
| //| Generales |
|
| //+------------------------------------------------------------------+
|
| //---
|
| #define JSONBENCH_DB_NAME ("JsonBenchMql\\data.db")
|
| #define JSONBENCH_PREFIX ("JsonBenchMql")
|
|
|
|
|
| //+------------------------------------------------------------------+
|
| //| Parseo |
|
| //+------------------------------------------------------------------+
|
| //---
|
| #define JSONBENCH_TAGOP_PARSE "parse"
|
| #define JSONBENCH_TAGDATASET_PARSE "twitter.json"
|
| #define JSONBENCH_TOTAL_ITER_PARSE (1000)
|
|
|
| //+------------------------------------------------------------------+
|
| //| Acceso |
|
| //+------------------------------------------------------------------+
|
| // acceso
|
| #define JSONBENCH_TAGOP_ACCESO_WIDE "acceso-wide"
|
| #define JSONBENCH_TAGOP_ACCESO_DEEP "acceso-deep"
|
| #define JSONBENCH_TAGOP_ACCESO_LARGE_ARR "acceso-array-large"
|
| #define JSONBENCH_TAGOP_ACCESO_MIX "acceso-mixed-trading"
|
| #define JSONBENCH_TAGOP_SERIALIZATION "serialization"
|
| #define JSONBENCH_ACCESO_XHOR_SEED (777)
|
| #define JSONBENCH_TAGDATASET_ACCES "test.json"
|
| #define JSONBENCH_TOTAL_ITER_ACCESO (1000)
|
|
|
| //---
|
| #define JSONBENCH_TOTAL_ITER_SER (100)
|
|
|
| //+------------------------------------------------------------------+
|
| //| Macros |
|
| //+------------------------------------------------------------------+
|
| //--- basicos
|
| #define JSONBENCH_FINISH TSN::CMultiBenchmark::Finish(JSONBENCH_DB_NAME, TimeToString(TimeLocal(),TIME_DATE), LIBNAME);
|
|
|
|
|
| //--- funcion easy para acceso
|
| #define JSONBENCH_ACCES_CALL(TAG) \
|
| Print("[",TAG,"] Time: ", (b-a));\
|
| TSN::CMultiBenchmark::Add(TAG,JSONBENCH_TAGDATASET_ACCES,JSONBENCH_TOTAL_ITER_ACCESO, (b-a));
|
|
|
| //--- serilizacion
|
| #define JSONBENCH_SER \
|
| Print("[Serilization] Time: ", (b-a));\
|
| TSN::CMultiBenchmark::Add(JSONBENCH_TAGOP_SERIALIZATION,JSONBENCH_TAGDATASET_ACCES,JSONBENCH_TOTAL_ITER_SER, (b-a));
|
|
|
| #endif // JSONPARSERBYLEO_TEST_BEN_DEF_MQH
|