Rewrote many parts of library(json) to leave no choicepoints when generating JSON. However, the generating performance actually worsened slightly...
This commit is contained in:
@@ -1,13 +1,38 @@
|
||||
## Benchmarks
|
||||
|
||||
### With CLP(Z):
|
||||
### Read
|
||||
|
||||
With CLP(Z):
|
||||
|
||||
```
|
||||
?- test_json_read.
|
||||
?- test_json:test_json_read.
|
||||
% CPU time: 41.522 seconds
|
||||
```
|
||||
|
||||
### After removing CLP(Z):
|
||||
After removing CLP(Z):
|
||||
|
||||
```
|
||||
?- test_json_read.
|
||||
?- test_json:test_json_read.
|
||||
% CPU time: 0.444 seconds
|
||||
```
|
||||
|
||||
With first argument indexing optimizations:
|
||||
```
|
||||
?- test_json:test_json_read.
|
||||
% CPU time: 0.310 seconds
|
||||
```
|
||||
|
||||
### Write
|
||||
|
||||
Without first argument indexing optimizations:
|
||||
```
|
||||
?- test_json:test_json_minify.
|
||||
% CPU time: 0.014 seconds
|
||||
```
|
||||
|
||||
With first argument indexing optimizations:
|
||||
|
||||
```
|
||||
?- test_json:test_json_minify.
|
||||
% CPU time: 0.015 seconds
|
||||
```
|
||||
|
||||
@@ -34,7 +34,7 @@ test_json_minify :-
|
||||
read_line_to_chars(RefMin, RefChars, []),
|
||||
close(RefMin),
|
||||
name_parse("pass_everything.json", Json),
|
||||
time(once(phrase(json_chars(Json), MinChars))),
|
||||
time(phrase(json_chars(Json), MinChars)),
|
||||
RefChars = MinChars.
|
||||
|
||||
test_json_int_float :-
|
||||
|
||||
Reference in New Issue
Block a user