Skip to content

json_BufferAppend replaced with clsStringAppend #82

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

json_BufferAppend replaced with clsStringAppend #82

wants to merge 1 commit into from

Conversation

PGS62
Copy link
Contributor

@PGS62 PGS62 commented Jan 26, 2018

Replaced calls to json_BufferAppend with simple class module clsStringAppend. Code is faster (x5), and is simpler (no Windows API calls), and simpler to call.

I have not tested my changes on Mac, but existing method json_BufferAppend does "naive" string appending on Mac and so will presumably have poor performance. In contrast clsStringAppend ought to have good performance.

Downside of my change is that users of the code have to import a class module (clsStringAppend) as well as the module JsonConverter. They should be OK with this surely? Though it will make the nifty training video a bit out-of-date. :-(

The module modTest1 is a test harness for json_BufferAppend versus clsStringAppend, and modTest2 is a really simple check that the changes I've made work. Neither of those modules need to be in the project.

Replaced calls to json_BufferAppend with simple class module clsStringAppend. Code is faster (x5), simpler and should work on Mac as well as Windows, though I have not tested that...
@timhall
Copy link
Member

timhall commented Apr 7, 2018

Hi @PGS62 thanks for the PR! Sorry it's taken me so long to respond. This is really attractive to me, don't like the dependence on Windows API calls and manually working with memory is always a little nerve-wracking. I'll make some tweaks and merge this soon. 👍

@PGS62
Copy link
Contributor Author

PGS62 commented Apr 7, 2018

Ah, glad you like the look of my change. It was my first pull request on GitHub!

@rachid-adf
Copy link

@PGS62 , good job, you saved me !

@wbhern
Copy link

wbhern commented Jun 2, 2018

Just wanted to add my thanks -- I endured some painful performance for a week until I had time to sit down to debug it and was delighted to see a fix here.

@abeenine
Copy link

abeenine commented Jun 3, 2018

@PGS62, thank you for this update

@timhall timhall mentioned this pull request Jun 7, 2018
@timhall timhall closed this in #101 Jun 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants