Skip to content

Commit

Permalink
parse: stop using (match) for performance reasons
Browse files Browse the repository at this point in the history
  • Loading branch information
aconchillo committed May 3, 2020
1 parent 4fecb09 commit ad4b06d
Show file tree
Hide file tree
Showing 2 changed files with 161 additions and 146 deletions.
15 changes: 8 additions & 7 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@

* Version 4.0.0 (??, 2020)

- Go back to using (cond) instead of (match) since (match) reduces
performance.

- The json-parser record type has been removed as the record only contained
the port. Removing the need to access records also had a lsight
the port. Removing the need to access records also had a slight
performance increase.

- Don't use map to parse expected string, simply use (string-ref).
(thanks to Linus Björnstam)

- Don't use string ports when reading string, just use a plain old list
instead. The initial iteration used string ports instead of appending
strings, this was suggested by Linus Björnstam.
- Use a plain list to read strings.

- Use string ports to parse numbers.
(suggested by Linus Björnstam)

- Don't need to use character-sets to detect whitespaces. JSON only defines
four possible types of whitespaces: space, linefeed, carriage return and
horizontal tab.
(suggested by Linus Björnstam)

- Increase performance by defining (parser-peek-char) and (parser-read-char)
as macros.

- Replace `display` with `put-string` on JSON builder.


Expand Down
Loading

0 comments on commit ad4b06d

Please sign in to comment.