Você está perdendo oportunidades de negociação:
- Aplicativos de negociação gratuitos
- 8 000+ sinais para cópia
- Notícias econômicas para análise dos mercados financeiros
Registro
Login
Você concorda com a política do site e com os termos de uso
Se você não tem uma conta, por favor registre-se
If you'd like to submit a Pull Request with these optimizations (or others you might find), I'd be more than happy to review and merge them. It's always great to collaborate with someone who deeply understands the technical nuances.
Currently, my "real life" workload consists of LLM API Responses (OpenAI/Anthropic), which are deeply nested JSON structures representing conversational context and function calling, rather than just large flat arrays of tick data.
Is it because of MQL5 that there is such a big performance lag compared to other implementations?
Yes, absolutely.
1. Lack of SIMD Intrinsics:
Libraries like simdjson achieve 4GB/s by processing 32 or 64 bytes per CPU cycle using AVX-512 instructions. MQL5 does not expose SIMD vectors. My "SWAR" implementation is a software simulation of SIMD (scanning 8 bytes at a time using ulong ), which is clever but orders of magnitude slower than hardware SIMD.
2. Bounds Checking & Safety:
MQL5 forces array bounds checking on every access. In C++, you can use raw pointers to walk memory at the speed of RAM bandwidth. in MQL5, every buffer[i] carries the overhead of the VM validating that i is within bounds.
3. Memory Model:
MQL5 does not allow custom allocators or pointer arithmetic. fast_json achieves 300MB/s by fighting against the language — using a single big array to bypass the GC. In a managed language, 300MB/s is actually an extremely high result (comparable to many Java/C# parsers before they introduced Span<T> ).
So yes, the ceiling is the runtime environment. To go faster, MetaQuotes would need to give us void* and inline Asm/Intrinsics.
Thanks. I'm not a programmer, so I still haven't figured out Git.
Fair enough. If you are "not a programmer" with that level of understanding of compiler optimizations and CPU pipelines, then I am just a sophisticated toaster. 😂🤣
I will keep an eye on the comments here. Your insights are valuable, regardless of the label. Thanks!
Please tell us how you use this data in MetaTrader?
The JSON parser is actually a sub-component of a larger project: the AI-Toolkit — a native MQL5 framework that I developed to integrate Large Language Models directly into the terminal, with no Python, no DLLs, no bridges.
Here is a simplified version of how an autonomous agent works inside an EA:
This is what fast_json was built for: high-speed serialization/deserialization in this tight loop between the terminal and the LLM API.
I plan to release the full AI-Toolkit as open-source soon.
So yes, the ceiling is the runtime environment.
I plan to release the full AI-Toolkit as open-source soon.
If I have any suggestions or comments, I'll leave them in the comments.
Isn't this redundant?
You can remove the condition from under the loop.