Skip to content

Commit

Permalink
Improved serialization performance (kgabis#156)
Browse files Browse the repository at this point in the history
* Update parson.c

Get objects by index instead of key in json_serialize_to_buffer_r().

* Increments version and updates licence date.

Co-authored-by: Krzysztof Gabis <[email protected]>
  • Loading branch information
benswick and kgabis authored Apr 7, 2021
1 parent 8beeb5e commit 60b2c69
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ project(parson C)

include (GNUInstallDirs)

set(PARSON_VERSION 1.1.0)
set(PARSON_VERSION 1.1.1)
add_library(parson parson.c)
target_include_directories(parson PUBLIC $<INSTALL_INTERFACE:include>)

Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2012 - 2020 Krzysztof Gabis
Copyright (c) 2012 - 2021 Krzysztof Gabis

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "parson",
"version": "1.1.0",
"version": "1.1.1",
"repo": "kgabis/parson",
"description": "Small json parser and reader",
"keywords": [ "json", "parser" ],
Expand Down
6 changes: 3 additions & 3 deletions parson.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/*
SPDX-License-Identifier: MIT
Parson 1.1.0 ( http://kgabis.github.com/parson/ )
Copyright (c) 2012 - 2020 Krzysztof Gabis
Parson 1.1.1 ( http://kgabis.github.com/parson/ )
Copyright (c) 2012 - 2021 Krzysztof Gabis
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -960,7 +960,7 @@ static int json_serialize_to_buffer_r(const JSON_Value *value, char *buf, int le
if (is_pretty) {
APPEND_STRING(" ");
}
temp_value = json_object_get_value(object, key);
temp_value = json_object_get_value_at(object, i);
written = json_serialize_to_buffer_r(temp_value, buf, level+1, is_pretty, num_buf);
if (written < 0) {
return -1;
Expand Down
4 changes: 2 additions & 2 deletions parson.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/*
SPDX-License-Identifier: MIT
Parson 1.1.0 ( http://kgabis.github.com/parson/ )
Copyright (c) 2012 - 2020 Krzysztof Gabis
Parson 1.1.1 ( http://kgabis.github.com/parson/ )
Copyright (c) 2012 - 2021 Krzysztof Gabis
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion tests.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
SPDX-License-Identifier: MIT
Parson ( http://kgabis.github.com/parson/ )
Copyright (c) 2012 - 2020 Krzysztof Gabis
Copyright (c) 2012 - 2021 Krzysztof Gabis
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down

0 comments on commit 60b2c69

Please sign in to comment.