====== JSON Data Benchmark Testing ====== ===== PHP Stopwatch ===== [[https://www.dokuwiki.org/plugin:stopwatch|Stopwatch plugin]] measures execution time of PHP code: * ''%%%%'' - Resets stopwatch to zero. * ''%%%%'' - Show elapsed time in seconds since last reset. ===== Recursive JSON load ===== Here is JSON data with src attribute, which links to itself. So it is recursively loaded 30 times. { "name": "Butter cookie", "type": "cookie", "Ingredients": { "eggs": "3", "flour": "500 g", "sugar": "300 g", "butter": "250 g" } } Time elapsed: { "name": "Butter cookie", "type": "cookie", "Ingredients": { "eggs": "3", "flour": "500 g", "sugar": "300 g", "butter": "250 g" } } Time elapsed: ===== Load multiple files into JSON array ===== Here is one long JSON file with random data: [[.1000files:file1]]. For testing purposes it should be copied to different filenames 1000 times. Here is bash command for this: for i in {2..1000}; do cp file1.txt "file$i.txt"; done ==== Load one file ==== ''%%%%''\\ Time elapsed: ==== Load 112 files ==== ''%%%%''\\ Time elapsed: ==== Load 1000 files ==== ''%%%%''\\ Time elapsed: ==== Single item ==== ''%%%$stack2.55.0.friends.0.name%%%''\\ %$stack2.55.0.friends.0.name%\\ Time elapsed: ==== Table of 112 files ==== %$stack2[]{"Name0":0.friends.0.name, "Name1":1.friends.0.name, "Name2":2.friends.0.name, "Name3":3.friends.0.name, "Name4":4.friends.0.name, "Name5":5.friends.0.name, "Name6":6.friends.0.name, "Name7":7.friends.0.name, "Name8":8.friends.0.name}% %$stack2[]{"Name0":0.friends.0.name, "Name1":1.friends.0.name, "Name2":2.friends.0.name, "Name3":3.friends.0.name, "Name4":4.friends.0.name, "Name5":5.friends.0.name, "Name6":6.friends.0.name, "Name7":7.friends.0.name, "Name8":8.friends.0.name}%\\ Time elapsed: ==== Table of 1000 files ==== %$stack3[]{ ... }% %$stack3[]{"Name0":0.friends.0.name, "Name1":1.friends.0.name, "Name2":2.friends.0.name, "Name3":3.friends.0.name, "Name4":4.friends.0.name, "Name5":5.friends.0.name, "Name6":6.friends.0.name, "Name7":7.friends.0.name, "Name8":8.friends.0.name}%\\ Time elapsed: ==== Show JSON data of 112 files ==== This is most time consuming: %$stack2 #code#% %$stack2 #code#% Time elapsed: