Skip to content

Commit

Permalink
removed a couple of boost dependencies, updated documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Andreas Grosam committed Dec 30, 2013
1 parent 531aa38 commit b973396
Show file tree
Hide file tree
Showing 98 changed files with 1,337 additions and 1,123 deletions.
6 changes: 4 additions & 2 deletions Bench/Bench.xcodeproj/project.pbxproj
Expand Up @@ -47,6 +47,7 @@
A1C05DB9178CC35000C7A117 /* update-center.json in CopyFiles */ = {isa = PBXBuildFile; fileRef = A1C05DAE178CC32100C7A117 /* update-center.json */; };
A1C9A5571541BD39004B4ED6 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A171E72413D4928400260A6B /* CoreFoundation.framework */; };
A1E9C4E516E643F200F04BB0 /* Test-UTF8.json in CopyFiles */ = {isa = PBXBuildFile; fileRef = A1A9D4DC157A063F00211F1B /* Test-UTF8.json */; };
A1EC302917C8F612006A08FC /* JPJson.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A16C49C317C774360061CC8B /* JPJson.framework */; };
A1EF0DA1142666BF0083221D /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A1EF0DA0142666BF0083221D /* main.cpp */; };
A1EF0DA814266A230083221D /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A171E72413D4928400260A6B /* CoreFoundation.framework */; };
A1FBA581157A0B030004204A /* Test-UTF8-esc.json in CopyFiles */ = {isa = PBXBuildFile; fileRef = A1A9D4DB157A063F00211F1B /* Test-UTF8-esc.json */; };
Expand Down Expand Up @@ -260,6 +261,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
A1EC302917C8F612006A08FC /* JPJson.framework in Frameworks */,
A1977E4C156CBE920074D9B2 /* Foundation.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -830,6 +832,7 @@
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
GCC_PREPROCESSOR_DEFINITIONS = "$(inherited)";
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
LLVM_LTO = NO;
MACOSX_DEPLOYMENT_TARGET = 10.7;
PRODUCT_NAME = "$(TARGET_NAME)";
};
Expand Down Expand Up @@ -868,7 +871,6 @@
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_DYNAMIC_NO_PIC = YES;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
GCC_OPTIMIZATION_LEVEL = fast;
GCC_PREPROCESSOR_DEFINITIONS = "$(inherited)";
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
LLVM_LTO = YES;
Expand Down Expand Up @@ -908,6 +910,7 @@
buildSettings = {
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_OPTIMIZATION_LEVEL = 3;
GCC_PREPROCESSOR_DEFINITIONS = "$(BENCH_GCC_PREPROCESSOR_DEFINITIONS)";
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
Expand Down Expand Up @@ -1043,7 +1046,6 @@
GCC_DYNAMIC_NO_PIC = YES;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
GCC_INPUT_FILETYPE = sourcecode.cpp.objcpp;
GCC_OPTIMIZATION_LEVEL = 3;
GCC_PREPROCESSOR_DEFINITIONS = (
"$(inherited)",
"$(ICU_GCC_PREPROCESSOR_DEFINITIONS)",
Expand Down
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0460"
LastUpgradeVersion = "0500"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0460"
LastUpgradeVersion = "0500"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0460"
LastUpgradeVersion = "0500"
version = "1.8">
<BuildAction
parallelizeBuildables = "NO"
Expand Down Expand Up @@ -30,7 +30,7 @@
displayScale = "1.00"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
buildConfiguration = "Release"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
Expand Down
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0460"
LastUpgradeVersion = "0500"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0460"
LastUpgradeVersion = "0500"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0460"
LastUpgradeVersion = "0500"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0460"
LastUpgradeVersion = "0500"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0460"
LastUpgradeVersion = "0500"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0460"
LastUpgradeVersion = "0500"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0460"
LastUpgradeVersion = "0500"
version = "1.8">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
94 changes: 42 additions & 52 deletions Bench/JPJsonParser/main.mm
Expand Up @@ -97,20 +97,20 @@
return "none";
}
std::string result;
if (opt & JPJsonParserSignalErrorOnNoncharacter) {
result += "JPJsonParserSignalErrorOnNoncharacter ";
if (opt & JPJsonParserSignalErrorOnUnicodeNoncharacter) {
result += "JPJsonParserSignalErrorOnUnicodeNoncharacter ";
}
if (opt & JPJsonParserSignalErrorOnNoncharacter) {
result += "JPJsonParserSignalErrorOnNoncharacter ";
if (opt & JPJsonParserSignalErrorOnUnicodeNoncharacter) {
result += "JPJsonParserSignalErrorOnUnicodeNoncharacter ";
}
if (opt & JPJsonParserSubstituteUnicodeNoncharacter) {
result += "JPJsonParserSubstituteUnicodeNoncharacter ";
}
if (opt & JPJsonParserRemoveUnicodeNoncharacter) {
result += "JPJsonParserRemoveUnicodeNoncharacter ";
}
if (opt & JPJsonParserSignalErrorOnNULLCharacter) {
result += "JPJsonParserSignalErrorOnNULLCharacter ";
if (opt & JPJsonParserSignalErrorOnUnicodeNULLCharacter) {
result += "JPJsonParserSignalErrorOnUnicodeNULLCharacter ";
}
if (opt & JPJsonParserSubstituteUnicodeNULLCharacter) {
result += "JPJsonParserSubstituteUnicodeNULLCharacter ";
Expand Down Expand Up @@ -543,8 +543,8 @@ void bench_JPJsonParserSAXStyle(JPJsonParserOptions opt, NSString* file, const i
// instance.

JPStreamSemanticActions* sa = [[JPStreamSemanticActions alloc] initWithHandlerDispatchQueue:NULL];
success = [JPJsonParser parseData:data semanticActions:sa];
[sa configureWithOptions:opt];
success = [JPJsonParser parseData:data semanticActions:sa];
t.stop();
te.set(t.seconds());
t.reset();
Expand Down Expand Up @@ -1099,56 +1099,46 @@ int main (int argc, const char * argv[])
// -------------------------------------------------------------------------

NSArray* testFiles = @[
// @"apache_builds.json",
// @"github_events.json",
// @"instruments.json",
// @"mesh.json",
@"mesh.pretty.json"
// @"nested.json",
// @"random.json",
// @"repeat.json",
// @"truenull.json",
// @"twitter_timeline.json",
// @"update-center.json",
// @"sample.json",
// @"Test-UTF8-esc.json",
// @"Test-UTF8.json"
@"apache_builds.json",
@"github_events.json",
@"instruments.json",
@"mesh.json",
@"mesh.pretty.json",
@"nested.json",
@"random.json",
@"repeat.json",
@"truenull.json",
@"twitter_timeline.json",
@"update-center.json",
@"sample.json",
@"Test-UTF8-esc.json",
@"Test-UTF8.json"
];

for (id testFile in testFiles) {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];

//bench_JPJsonParserWithNSData(JPJsonParserOptions(JPJsonParserLogLevelError), testFile, N);
// bench_JPJsonParserWithNSData(JPJsonParserOptions(JPJsonParserLogLevelError | JPJsonParserGeneratorUseArenaAllocator), testFile, N);
// bench_JPJsonParserSAXStyle1x(testFile, N);
// bench_JPJsonParserWithNSData1(testFile, N);
// bench_JPJsonParserWithNSData1m(testFile, N);
// bench_JPJsonParserWithNSDataReuseSemanticActionsObject(testFile, N);
// bench_JPJsonParserWithNSString1(testFile,N);
// bench_JPJsonParser1d(testFile, N);
// bench_JPJsonParser2(testFile, N);
// bench_JPAsyncJsonParser(testFile, N);
#if 1
bench_NSJSONSerialization(NSJSONReadingOptions(0), testFile, N);
// bench_NSJSONSerialization1m(testFile, N);
#endif
//
//#if defined (USE_JSONKit)
// bench_JSONKitWithNSData(JKParseOptionFlags(0), testFile, N);
// bench_JSONKitWithNSData(JKParseOptionFlags(0), testFile, N);
// bench_JSONKitWithNSData(JKParseOptionFlags(0), testFile, N);
// bench_JSONKitWithNSData(JKParseOptionFlags(0), testFile, N);
// bench_JSONKit2(testFile, N);
// bench_JSONKitString1(testFile, N);
//#endif

[pool drain];
}



{
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
bench_JPJsonParserSAXStyle(JPJsonParserOptions(JPJsonParserAllowUnicodeNoncharacter | JPJsonParserAllowUnicodeNULLCharacter), testFile, N);
[pool drain];
}
{
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
bench_JPJsonParserWithNSData(JPJsonParserOptions(JPJsonParserAllowUnicodeNoncharacter | JPJsonParserAllowUnicodeNULLCharacter), testFile, N);
[pool drain];
}
{
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
bench_NSJSONSerialization(NSJSONReadingOptions(0), testFile, N);
[pool drain];
}
{
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
bench_JSONKitWithNSData(JKParseOptionFlags(0), testFile, N);
[pool drain];
}


}

NSLog(@"\nFinished Bench");
[pool drain];
Expand Down
22 changes: 17 additions & 5 deletions Bench/json_parser/main.cpp
Expand Up @@ -19,6 +19,7 @@
//

#include <boost/config.hpp>
#include <boost/version.hpp>

#include <iostream>
#include <fstream>
Expand All @@ -43,8 +44,9 @@
namespace {


const char* TEST_JSON = "mesh.json";
//const char* TEST_JSON = "mesh.json";
//const char* TEST_JSON = "sample.json";
const char* TEST_JSON = "TEST-UTF8-esc.json";

std::vector<char> loadFileFromResourceFolder(const char* fileName)
{
Expand Down Expand Up @@ -76,6 +78,19 @@ namespace {

namespace test {

inline void printSystemInfo(std::ostream& os) {
time_t time_info;
std::time(&time_info);
os << ctime(&time_info) << "\n";
os << BOOST_COMPILER << "\n";

os << "Using Boost "
<< BOOST_VERSION / 100000 << "." // major version
<< BOOST_VERSION / 100 % 1000 << "." // minior version
<< BOOST_VERSION % 100 // patch level
<< std::endl;
}

#if defined (DEBUG)
constexpr int N = 1;
#else
Expand Down Expand Up @@ -548,10 +563,7 @@ int main ()
std::cout << "===============================\n";
std::cout << "Parser Benchmark\n";
std::cout << "===============================\n";
time_t time_info;
std::time(&time_info);
std::cout << ctime(&time_info) << "\n";
std::cout << BOOST_COMPILER << "\n";
test::printSystemInfo(std::cout);

try {
bench_validating_parser();
Expand Down
6 changes: 3 additions & 3 deletions Bench/unicode_conversion/main.cpp
Expand Up @@ -1673,9 +1673,9 @@ int main (int argc, const char * argv[])

//profile();

bench_UTF8_to_codepoint(1000*1000, 10);
bench_UTF16_to_codepoint();
bench_UTF32_to_codepoint();
// bench_UTF8_to_codepoint(1000*1000, 10);
// bench_UTF16_to_codepoint();
// bench_UTF32_to_codepoint();

// bench_codepoint_to_UTF8();
// bench_codepoint_to_UTF16();
Expand Down
14 changes: 13 additions & 1 deletion CHANGES.md
Expand Up @@ -64,7 +64,7 @@

* JPJsonWriter: fixed a memory leak in JPJsonWriter (now uses NSDataStreambuf class internally)

* JPJsonWriter: fixed a bug in converting NSNumber objects whose underlaying type equals BOOL and whose address is not equal `kCFBooleanTrue` or not equal `kCFBooleanFalse`.
* JPJsonWriter: fixed a bug in converting NSNumber objects whose underlying type equals BOOL and whose address is not equal `kCFBooleanTrue` or not equal `kCFBooleanFalse`.



Expand Down Expand Up @@ -120,6 +120,18 @@

### Version 0.7 beta

* API Changes

Parser options (JPJsonParserOptions) have been changed. Please read the documentation.


* Unicode Noncharacher and Unicode 'NULL' Behavior and Options

JPJsonParser now can be configured in detail how to handle Unicode noncharacters and Unicode 'NULL' characters in JSON Strings.
Please consult the documentation for a detailed description.


* The Documentation now is more complete



Expand Down
Expand Up @@ -21,7 +21,7 @@
/* End PBXAggregateTarget section */

/* Begin PBXFileReference section */
A15D892B146592250001E08D /* CreateDoc.rb */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.ruby; lineEnding = 0; path = CreateDoc.rb; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.ruby; };
A15D892B146592250001E08D /* CreateDoc.rb */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.ruby; lineEnding = 0; path = CreateDoc.rb; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXGroup section */
Expand All @@ -46,7 +46,7 @@
A1D1C05814652D9B000C145F /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0420;
LastUpgradeCheck = 0500;
};
buildConfigurationList = A1D1C05B14652D9B000C145F /* Build configuration list for PBXProject "Documentation" */;
compatibilityVersion = "Xcode 3.2";
Expand Down Expand Up @@ -86,6 +86,7 @@
isa = XCBuildConfiguration;
buildSettings = {
JPSOURCE_ROOT = "$(SRCROOT)/../../Source";
ONLY_ACTIVE_ARCH = YES;
};
name = Debug;
};
Expand Down
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0460"
LastUpgradeVersion = "0500"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down

0 comments on commit b973396

Please sign in to comment.