Comments (4)
Hi,
Thanks for your suggestion.
Could you show a simple example simulating McJSON as if it had this feature?
Also, does the current version of Tostring() have any performance issues?
Regards,
Marcelo.
from mcjson.
Hi,
For a large JSON Document, using string concatenation would have impact on performance because of string memory allocation.
String Buffering would be implemented as:
procedure TMcJsonItem.InternalToString(Stream:TStringStream;aHuman,aIndent:string;JsonItem:TMcJsonItem);
begin
...
for i := 0 to len do
begin
Stream.WriteString(JsonItem...);
...
end;
...
end;
function TMcJsonItem.Stringify(aHuman:Boolean=False;const aIndent:string=''):string;
var
Stream : TStringStream;
begin
Stream := TStringStream.Create;
InternalToString(Stream,aHuman,aIndent,Self);
Result := Stream.DataString;
Stream.Free;
end;
Best regards.
from mcjson.
Hi Hafedh,
Nice suggestion!
I'll try it, just let me finish an update about better Exception handling and descriptions.
Thanks,
Marcelo.
from mcjson.
Hi Hafedh,
The last commit uses TStringStream as buffer with ToString().
Thanks,
Marcelo.
from mcjson.
Related Issues (20)
- Improve test case HOT 2
- Invalid char at pos 1 (UTF8 BOM support) HOT 6
- Excepted got "/" (Comment support) HOT 11
- Unknown escape at pos (escpaing support) HOT 15
- McJsonEscapeString (overzealous) HOT 17
- Slow json generation speed HOT 5
- MCJsonUnEscapeString "/" and "\" missing after unescape HOT 3
- HasKey exception HOT 11
- New empty key destroys the json structure HOT 10
- Check function does not return the wrong position HOT 7
- Check function speed problem HOT 10
- Slower shortener operation (but I realized this is normal because of the AddOrSet search) HOT 7
- McJSONEscapeString TAB problem HOT 3
- how to get int64 value ? HOT 2
- When value is a json string, tostring does not handle escaping HOT 5
- Range check error HOT 9
- PrjTestMcJSON - many exception HOT 5
- Shorteners self-test result HOT 7
- Test #13 failed in Main branch (trunk rev. #94) HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mcjson.