2026-08-28 08:28:39 -05:00 | | | //+------------------------------------------------------------------+
|
| | | //| 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
|
| | |
|
| | | //+------------------------------------------------------------------+
|
| | | //| |
|
| | | //+------------------------------------------------------------------+
|
2026-09-17 21:24:16 -05:00 | | | #ifndef JSONBENCH_RUN_PARSE
|
2026-10-09 13:42:42 -05:00 | | | #include <TSN\\Std\\MBen\\MBen.mqh>
|
2026-09-17 21:24:16 -05:00 | | | #include <TSN\\Random\\Base.mqh>
|
| | | #include <TSN\\Random\\Xoshiro256.mqh>
|
| | | #resource "test.json" as const string g_json_test_access;
|
2026-08-28 08:28:39 -05:00 | | |
|
| | | //+------------------------------------------------------------------+
|
| | | //| |
|
| | | //+------------------------------------------------------------------+
|
2026-08-28 08:36:08 -05:00 | | | #else // JSONBENCH_RUN_PARSE
|
| | | // Si cocremos el parsing
|
2026-10-18 17:51:52 -05:00 | | | #resource "twitter.json" as const uchar g_json_data[];
|
2026-08-28 08:36:08 -05:00 | | | #endif // JSONBENCH_RUN_PARSE
|
2026-08-28 08:28:39 -05:00 | | |
|
| | | //+------------------------------------------------------------------+
|
| | | //| 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"
|
2026-10-03 17:00:34 -05:00 | | | #define JSONBENCH_TAGOP_SERIALIZATION "serialization"
|
2026-08-28 08:28:39 -05:00 | | | #define JSONBENCH_ACCESO_XHOR_SEED (777)
|
| | | #define JSONBENCH_TAGDATASET_ACCES "test.json"
|
| | | #define JSONBENCH_TOTAL_ITER_ACCESO (1000)
|
| | |
|
2026-10-03 17:00:34 -05:00 | | | //---
|
| | | #define JSONBENCH_TOTAL_ITER_SER (100)
|
2026-08-28 08:28:39 -05:00 | | |
|
| | | //+------------------------------------------------------------------+
|
| | | //| Macros |
|
| | | //+------------------------------------------------------------------+
|
| | | //--- basicos
|
2026-08-28 09:42:51 -05:00 | | | #define JSONBENCH_FINISH TSN::CMultiBenchmark::Finish(JSONBENCH_DB_NAME, TimeToString(TimeLocal(),TIME_DATE), LIBNAME);
|
2026-08-28 08:28:39 -05:00 | | |
|
| | |
|
| | | //--- 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));
|
| | |
|
2026-10-03 17:00:34 -05:00 | | | //--- serilizacion
|
| | | #define JSONBENCH_SER \
|
| | | Print("[Serilization] Time: ", (b-a));\
|
| | | TSN::CMultiBenchmark::Add(JSONBENCH_TAGOP_SERIALIZATION,JSONBENCH_TAGDATASET_ACCES,JSONBENCH_TOTAL_ITER_SER, (b-a));
|
2026-08-28 08:28:39 -05:00 | | |
|
| | | #endif // JSONPARSERBYLEO_TEST_BEN_DEF_MQH
|