4 ms·
Yes, last time I checked, Zig's comptime was 20x slower than interpreted Python. Parsing a non-trivial JSON file at comptime is excrutiatingly slow and can take
by Okx 1y ago
Yes, last time I checked, Zig's comptime was 20x slower than interpreted Python. Parsing a non-trivial JSON file at comptime is excrutiatingly slow and can take minutes.
- squeek502 1y agoRelevant: https://github.com/ziglang/zig/issues/4055#issuecomment-1646701374 https://github.com/ziglang/zig/issues/4055#issuecomment-1646...
- rurban 1y agoouch, that perf numbers do hurt
- fransje26 1y ago> Parsing a non-trivial JSON file at comptime is excrutiatingly slow Nevertheless, impressive that you can do so!
- Simran-B 1y agoI would argue that it's not meaningful to do so for larger files with comptime as there doesn't seem to be a need for parsing JSON like the target platform would (comptime emulates it) - I expect it to be independent. You're also not supposed to do I/O using comptime, and @embedFile kind of falls under that. I suppose it would be better to write a build.zig for this particularly use case, which I think would then also be able to run fast native code?