Giter Site home page Giter Site logo

corejson's People

Contributors

mirek avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

corejson's Issues

Unable to duplicate claimed performance numbers

Unable to reproduce claimed performance numbers. Timing based on the twitter_public_timeline.json file in Sams json-benchmarks, using (approximately) gcc-4.2 -arch x86_64 -DNS_BLOCK_ASSERTIONS -Os:

JSONKit        | decode: min:      415.000 us, avg:      424.730 us, char/s:  57775527.98, decodes:   1000
json-framework | decode: min:     1675.000 us, avg:     1687.973 us, char/s:  14537554.81, decodes:   1000
CoreJSON       | decode: min:     1230.000 us, avg:     2641.324 us, char/s:   9290416.47, decodes:   1000

It's not clear to me how CoreJSON can significantly improve on the times turned in by YAJL-objc. After parsing overhead is accounted for (which libyajl handles), the next major contributor to overall parsing time is in object instantiation, which is fairly considerable. This primarily how JSONKit is able to turn in better times than the other major libraries- it has a recently instantiated object cache to significantly reduce this overhead.

Leaks like a sieve!

Using

NSError *error = NULL;
NSString *json = [NSString stringWithContentsOfFile:@"example.json" encoding:NSUTF8StringEncoding error:&error];
CoreJSONRef jsonRef = JSONCreateWithString(NULL, (CFStringRef)json);
CFTypeRef jsonObjectRef = JSONGetObject(jsonRef);
[(id)jsonObjectRef autorelease];
JSONRelease(jsonRef);

... leaks memory like a sieve!

shell% leaks -nocontext 20732 | more
 leaks Report Version:  2.0
 Process:         bench [20732]
 Path:            /Users/johne/projects/json/CoreJSON/build/Debug/bench
 Load Address:    0x100000000
 Identifier:      bench
 Version:         ??? (???)
 Code Type:       X86-64 (Native)
 Parent Process:  tcsh [504]
 
 Date/Time:       2011-02-17 12:59:23.723 -0500
 OS Version:      Mac OS X 10.6.6 (10J567)
 Report Version:  6
 
 Process 20732: 2158 nodes malloced for 383 KB
 Process 20732: 114 leaks for 80864 total leaked bytes.
 Leak: 0x100841800  size=1024  zone: DefaultMallocZone_0x100013000       
         Call stack: [thread 0x7fff700c3ca0]: | 0x2 | start | main | JSONCreateWithString | JSONParseWithString | yajl_do_parse | __JSONParserAppen dMapStart | __JSONStackEntryCreate | malloc_zone_malloc 
 Leak: 0x100841c00  size=1024  zone: DefaultMallocZone_0x100013000       
         Call stack: [thread 0x7fff700c3ca0]: | 0x2 | start | main | JSONCreateWithString | JSONParseWithString | yajl_do_parse | __JSONParserAppen dMapStart | __JSONStackEntryCreate | malloc_zone_malloc 
 Leak: 0x100842000  size=1024  zone: DefaultMallocZone_0x100013000       
         Call stack: [thread 0x7fff700c3ca0]: | 0x2 | start | main | JSONCreateWithString | JSONParseWithString | yajl_do_parse | __JSONParserAppen dMapStart | __JSONStackEntryCreate | malloc_zone_malloc 
... [snip] ...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.