From 5e527213a2430bb3018e5eebd909aef294edf9b5 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Fri, 18 Dec 2020 18:48:46 +0300 Subject: Switch to build2 --- examples/cxx/parser/performance/README | 42 ---- examples/cxx/parser/performance/driver.cxx | 341 --------------------------- examples/cxx/parser/performance/gen.cxx | 76 ------ examples/cxx/parser/performance/makefile | 108 --------- examples/cxx/parser/performance/test-50k.xml | 1 - examples/cxx/parser/performance/test.xsd | 49 ---- examples/cxx/parser/performance/time.cxx | 46 ---- examples/cxx/parser/performance/time.hxx | 110 --------- 8 files changed, 773 deletions(-) delete mode 100644 examples/cxx/parser/performance/README delete mode 100644 examples/cxx/parser/performance/driver.cxx delete mode 100644 examples/cxx/parser/performance/gen.cxx delete mode 100644 examples/cxx/parser/performance/makefile delete mode 100644 examples/cxx/parser/performance/test-50k.xml delete mode 100644 examples/cxx/parser/performance/test.xsd delete mode 100644 examples/cxx/parser/performance/time.cxx delete mode 100644 examples/cxx/parser/performance/time.hxx (limited to 'examples/cxx/parser/performance') diff --git a/examples/cxx/parser/performance/README b/examples/cxx/parser/performance/README deleted file mode 100644 index 39aecca..0000000 --- a/examples/cxx/parser/performance/README +++ /dev/null @@ -1,42 +0,0 @@ -This example measures the performance of XML parsing in the C++/Parser -mapping. It also shows how to structure your code to achieve the maximum -performance for this operation. - -The example consists of the following files: - -test.xsd - XML Schema which describes the test vocabulary. - -test-50k.xml - Test XML document. - -gen.cxx - Program to generate a test document of desired size. - -time.hxx -time.cxx - Class definition that represents time. - -test-pskel.hxx -test-pskel.ixx -test-pskel.cxx - Parser skeletons generated by the XSD compiler from test.xsd. - -driver.cxx - Driver for the example. It first parses the command line arguments - and reads the entire document into a memory buffer. It then creates - a SAX parser and pre-parses and caches the schema if validation is - enabled (Xerces-C++ only). Finally, it runs the performance - measurement loop which on each iteration parses the XML document - from the in-memory buffer. - -To run the example on a test XML document simply execute: - -$ ./driver test-50k.xml - -The -v option can be used to turn on validation in the underlying XML -parser (only makes sense for Xerces-C++, off by default). The -i option -can be used to specify the number of parsing iterations (1000 by default). -For example: - -$ ./driver -v -i 100 test-50k.xml diff --git a/examples/cxx/parser/performance/driver.cxx b/examples/cxx/parser/performance/driver.cxx deleted file mode 100644 index 302464e..0000000 --- a/examples/cxx/parser/performance/driver.cxx +++ /dev/null @@ -1,341 +0,0 @@ -// file : examples/cxx/parser/performance/driver.cxx -// copyright : not copyrighted - public domain - -#include -#include // std::auto_ptr -#include // std::size_t -#include -#include -#include - -#include "time.hxx" -#include "test-pskel.hxx" - -#ifdef _XERCES_VERSION -# include -# include -# include -# include -# include -# include - -# include -# include -#endif - -// No-op parser implementation. -// -namespace test -{ - struct enum_pimpl: enum_pskel, xml_schema::string_pimpl - { - virtual void - post_enum () - { - } - }; - - struct record_pimpl: record_pskel - { - virtual void - int_ (unsigned int) - { - } - - virtual void - double_ (double) - { - } - - virtual void - name (const std::string&) - { - } - - virtual void - string (const std::string&) - { - } - - virtual void - choice1 (const std::string&) - { - } - - virtual void - choice2 (const std::string&) - { - } - - virtual void - choice3 (const std::string&) - { - } - - virtual void - choice4 (const std::string&) - { - } - - virtual void - apple (bool) - { - } - - virtual void - orange (unsigned long long) - { - } - }; - - struct root_pimpl: root_pskel - { - }; -} - -using namespace std; - -int -main (int argc, char* argv[]) -{ - if (argc < 2) - { - cerr << "usage: " << argv[0] << " [-v] [-i ] test.xml" << endl - << "\t -v turn on validation (default is off)" << endl - << "\t -i number of iterations to perform (default is 1000)" << endl; - return 1; - } - - bool validate (false); - unsigned long iter (1000); - const char* file (0); - - // Parse command line arguments. - // - for (int i (1); i < argc; ++i) - { - string arg (argv[i]); - - if (arg == "-v") - { - validate = true; - } - else if (arg == "-i") - { - if (++i == argc) - { - cerr << "argument expected for the -i option" << endl; - return 1; - } - - iter = 0; - istringstream is (argv[i]); - is >> iter; - - if (iter == 0) - { - cerr << "invalid argument for the -i option" << endl; - return 1; - } - } - else - { - file = argv[i]; - break; - } - } - - if (file == 0) - { - cerr << "no input file specified" << endl; - return 1; - } - - try - { - // Instantiate and connect parsers. - // - xml_schema::unsigned_int_pimpl unsigned_int_p; - xml_schema::double_pimpl double_p; - xml_schema::ncname_pimpl ncname_p; - xml_schema::string_pimpl string_p; - xml_schema::boolean_pimpl boolean_p; - xml_schema::unsigned_long_pimpl unsigned_long_p; - - test::enum_pimpl enum_p; - test::record_pimpl record_p; - test::root_pimpl root_p; - - record_p.parsers (unsigned_int_p, - double_p, - ncname_p, - string_p, - string_p, - string_p, - string_p, - string_p, - enum_p, - boolean_p, - unsigned_long_p); - - root_p.parsers (record_p); - - // Read the fine into in-memory buffer. - // - ifstream ifs; - ifs.exceptions (ios_base::failbit); - ifs.open (file, ios::in | ios::ate); - - size_t size (ifs.tellg ()); - ifs.seekg (0, ios::beg); - - char* buf = new char[size]; - ifs.read (buf, size); - ifs.close (); - - cerr << "document size: " << size << " bytes" << endl - << "iterations: " << iter << endl; - - os::time time (0); - xml_schema::document doc (root_p, "test", "root"); - -#ifdef _XERCES_VERSION - - // Xerces-C++ as the underlying XML parser. - // - using namespace xercesc; - - namespace xml = xsd::cxx::xml; - namespace parser = xsd::cxx::parser; - - XMLPlatformUtils::Initialize (); - - { - MemBufInputSource is ( - reinterpret_cast (buf), size, file, false); - is.setCopyBufToStream (false); - - auto_ptr parser (XMLReaderFactory::createXMLReader ()); - - parser->setFeature (XMLUni::fgSAX2CoreNameSpaces, true); - parser->setFeature (XMLUni::fgSAX2CoreNameSpacePrefixes, true); - parser->setFeature (XMLUni::fgXercesValidationErrorAsFatal, true); - - if (validate) - { - parser->setFeature (XMLUni::fgSAX2CoreValidation, true); - parser->setFeature (XMLUni::fgXercesSchema, true); - parser->setFeature (XMLUni::fgXercesSchemaFullChecking, false); - - // Xerces-C++ 3.1.0 is the first version with working multi import - // support. - // -#if _XERCES_VERSION >= 30100 - parser->setFeature (XMLUni::fgXercesHandleMultipleImports, true); -#endif - - // Initialize the schema cache. To detect schema errors we will - // need an error handler. - // - parser::error_handler eh; - xml::sax::bits::error_handler_proxy ehp (eh); - parser->setErrorHandler (&ehp); - - if (!parser->loadGrammar ("test.xsd", Grammar::SchemaGrammarType, true)) - { - // In Xerces-C++ grammar loading failure results in just a warning. - // Make it a fatal error. - // - eh.handle ("test.xsd", 0, 0, - parser::error_handler::severity::fatal, - "unable to load schema"); - } - - eh.throw_if_failed (); - parser->setFeature (XMLUni::fgXercesUseCachedGrammarInParse, true); - -#if _XERCES_VERSION >= 30100 - parser->setFeature (XMLUni::fgXercesLoadSchema, false); -#endif - } - else - { - parser->setFeature (XMLUni::fgSAX2CoreValidation, false); - parser->setFeature (XMLUni::fgXercesSchema, false); - parser->setFeature (XMLUni::fgXercesSchemaFullChecking, false); - } - - os::time start; - - for (unsigned long i (0); i < iter; ++i) - { - root_p.pre (); - doc.parse (is, *parser); - root_p.post_root (); - } - - os::time end; - time = end - start; - } - - XMLPlatformUtils::Terminate (); - -#else - - // Expat as the underlying XML parser. - // - XML_Parser xml_parser (XML_ParserCreateNS (0, ' ')); - string public_id (file); - - os::time start; - - for (unsigned long i (0); i < iter; ++i) - { - // Using the low-level Expat-specific API to parse the memory - // buffer. - // - root_p.pre (); - doc.parse_begin (xml_parser, public_id); - - XML_Parse (xml_parser, buf, size, 1); - - doc.parse_end (); - root_p.post_root (); - - XML_ParserReset (xml_parser, 0); - } - - os::time end; - time = end - start; - - XML_ParserFree (xml_parser); - -#endif - - delete[] buf; - - cerr << "time: " << time << " sec" << endl; - - double ms (time.sec () * 1000000ULL + time.nsec () / 1000ULL); - - // Calculate throughput in documents/sec. - // - double tpd ((iter / ms) * 1000000); - cerr << "throughput: " << tpd << " documents/sec" << endl; - - // Calculate throughput in MBytes/sec. - // - double tpb (((size * iter) / ms) * 1000000/(1024*1024)); - cerr << "throughput: " << tpb << " MBytes/sec" << endl; - } - catch (const xml_schema::exception& e) - { - cerr << e << endl; - return 1; - } - catch (std::ios_base::failure const&) - { - cerr << "io failure" << endl; - return 1; - } -} diff --git a/examples/cxx/parser/performance/gen.cxx b/examples/cxx/parser/performance/gen.cxx deleted file mode 100644 index b6392c0..0000000 --- a/examples/cxx/parser/performance/gen.cxx +++ /dev/null @@ -1,76 +0,0 @@ -#include -#include -#include - -using namespace std; - -static const char* enums[] = -{ - "romance", - "fiction", - "horror", - "history", - "philosophy" -}; - -int -main (int argc, char* argv[]) -{ - if (argc != 3) - { - cerr << "usage: " << argv[0] << " " << endl; - return 1; - } - - unsigned long n (0); - istringstream is (argv[1]); - is >> n; - - if (n == 0) - { - cerr << "record count argument should be a positive number" << endl; - return 1; - } - - ofstream ofs (argv[2]); - - if (!ofs.is_open ()) - { - cerr << "unable to open '" << argv[2] << "' in write mode" << endl; - return 1; - } - - ofs << ""; - - unsigned short ch (1), en (0); - - for (unsigned long i (0); i < n; ++i) - { - ofs << "" - << "42" - << "42345.4232" - << "name123_45"; - - if (i % 2 == 1) - ofs << "one two three"; - - ofs << "" << ch << " choice" - << "" << enums[en] << "" - << ""; - - if (++ch > 4) - ch = 1; - - if (++en > 4) - en = 0; - } - - ofs << ""; -} diff --git a/examples/cxx/parser/performance/makefile b/examples/cxx/parser/performance/makefile deleted file mode 100644 index 9a7a26b..0000000 --- a/examples/cxx/parser/performance/makefile +++ /dev/null @@ -1,108 +0,0 @@ -# file : examples/cxx/parser/performance/makefile -# license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../../../build/bootstrap.make - -xsd := test.xsd -cxx := driver.cxx time.cxx - -obj := $(addprefix $(out_base)/,$(cxx:.cxx=.o) $(xsd:.xsd=-pskel.o)) -dep := $(obj:.o=.o.d) - -driver := $(out_base)/driver -install := $(out_base)/.install -dist := $(out_base)/.dist -dist-win := $(out_base)/.dist-win -clean := $(out_base)/.clean - - -# Import. -# -$(call import,\ - $(scf_root)/import/libxerces-c/stub.make,\ - l: xerces_c.l,cpp-options: xerces_c.l.cpp-options) - - -# Build. -# -$(driver): $(obj) $(xerces_c.l) - -$(obj) $(dep): cpp_options := -I$(out_base) -I$(src_base) -I$(src_root)/libxsd -$(obj) $(dep): $(xerces_c.l.cpp-options) - -genf := $(xsd:.xsd=-pskel.hxx) $(xsd:.xsd=-pskel.ixx) $(xsd:.xsd=-pskel.cxx) -gen := $(addprefix $(out_base)/,$(genf)) - -$(gen): xsd := $(out_root)/xsd/xsd -$(gen): xsd_options += --generate-inline -$(gen): $(out_root)/xsd/xsd - -$(call include-dep,$(dep),$(obj),$(gen)) - -# Convenience alias for default target. -# -$(out_base)/: $(driver) - - -# Install & Dist. -# -dist-common := $(out_base)/.dist-common - -$(install) $(dist) $(dist-win) $(dist-common): path := $(subst $(src_root)/,,$(src_base)) - -$(install): - $(call install-data,$(src_base)/README,$(install_doc_dir)/xsd/$(path)/README) - $(call install-data,$(src_base)/driver.cxx,$(install_doc_dir)/xsd/$(path)/driver.cxx) - $(call install-data,$(src_base)/test.xsd,$(install_doc_dir)/xsd/$(path)/test.xsd) - $(call install-data,$(src_base)/test-50k.xml,$(install_doc_dir)/xsd/$(path)/test-50k.xml) - $(call install-data,$(src_base)/time.hxx,$(install_doc_dir)/xsd/$(path)/time.hxx) - $(call install-data,$(src_base)/time.cxx,$(install_doc_dir)/xsd/$(path)/time.cxx) - $(call install-data,$(src_base)/gen.cxx,$(install_doc_dir)/xsd/$(path)/gen.cxx) - -$(dist-common): - $(call install-data,$(src_base)/driver.cxx,$(dist_prefix)/$(path)/driver.cxx) - $(call install-data,$(src_base)/test.xsd,$(dist_prefix)/$(path)/test.xsd) - $(call install-data,$(src_base)/test-50k.xml,$(dist_prefix)/$(path)/test-50k.xml) - $(call install-data,$(src_base)/time.hxx,$(dist_prefix)/$(path)/time.hxx) - $(call install-data,$(src_base)/time.cxx,$(dist_prefix)/$(path)/time.cxx) - $(call install-data,$(src_base)/gen.cxx,$(dist_prefix)/$(path)/gen.cxx) - -$(dist): $(dist-common) - $(call install-data,$(src_base)/README,$(dist_prefix)/$(path)/README) - -$(dist-win): $(dist-common) - $(call install-data,$(src_base)/README,$(dist_prefix)/$(path)/README.txt) - $(call message,,todos $(dist_prefix)/$(path)/README.txt) - - -# Clean. -# -$(clean): $(driver).o.clean \ - $(addsuffix .cxx.clean,$(obj)) \ - $(addsuffix .cxx.clean,$(dep)) \ - $(addprefix $(out_base)/,$(xsd:.xsd=-pskel.cxx.xsd.clean)) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(gen): | $(out_base)/.gitignore -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/cxx/o-e.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/install.make) -$(call include,$(scf_root)/xsd/parser/xsd-cxx.make) - - -# Dependencies. -# -$(call import,$(src_root)/xsd/makefile) diff --git a/examples/cxx/parser/performance/test-50k.xml b/examples/cxx/parser/performance/test-50k.xml deleted file mode 100644 index 42e22f3..0000000 --- a/examples/cxx/parser/performance/test-50k.xml +++ /dev/null @@ -1 +0,0 @@ -4242345.4232name123_451 choiceromance4242345.4232name123_45one two three2 choicefiction4242345.4232name123_453 choicehorror4242345.4232name123_45one two three4 choicehistory4242345.4232name123_451 choicephilosophy4242345.4232name123_45one two three2 choiceromance4242345.4232name123_453 choicefiction4242345.4232name123_45one two three4 choicehorror4242345.4232name123_451 choicehistory4242345.4232name123_45one two three2 choicephilosophy4242345.4232name123_453 choiceromance4242345.4232name123_45one two three4 choicefiction4242345.4232name123_451 choicehorror4242345.4232name123_45one two three2 choicehistory4242345.4232name123_453 choicephilosophy4242345.4232name123_45one two three4 choiceromance4242345.4232name123_451 choicefiction4242345.4232name123_45one two three2 choicehorror4242345.4232name123_453 choicehistory4242345.4232name123_45one two three4 choicephilosophy4242345.4232name123_451 choiceromance4242345.4232name123_45one two three2 choicefiction4242345.4232name123_453 choicehorror4242345.4232name123_45one two three4 choicehistory4242345.4232name123_451 choicephilosophy4242345.4232name123_45one two three2 choiceromance4242345.4232name123_453 choicefiction4242345.4232name123_45one two three4 choicehorror4242345.4232name123_451 choicehistory4242345.4232name123_45one two three2 choicephilosophy4242345.4232name123_453 choiceromance4242345.4232name123_45one two three4 choicefiction4242345.4232name123_451 choicehorror4242345.4232name123_45one two three2 choicehistory4242345.4232name123_453 choicephilosophy4242345.4232name123_45one two three4 choiceromance4242345.4232name123_451 choicefiction4242345.4232name123_45one two three2 choicehorror4242345.4232name123_453 choicehistory4242345.4232name123_45one two three4 choicephilosophy4242345.4232name123_451 choiceromance4242345.4232name123_45one two three2 choicefiction4242345.4232name123_453 choicehorror4242345.4232name123_45one two three4 choicehistory4242345.4232name123_451 choicephilosophy4242345.4232name123_45one two three2 choiceromance4242345.4232name123_453 choicefiction4242345.4232name123_45one two three4 choicehorror4242345.4232name123_451 choicehistory4242345.4232name123_45one two three2 choicephilosophy4242345.4232name123_453 choiceromance4242345.4232name123_45one two three4 choicefiction4242345.4232name123_451 choicehorror4242345.4232name123_45one two three2 choicehistory4242345.4232name123_453 choicephilosophy4242345.4232name123_45one two three4 choiceromance4242345.4232name123_451 choicefiction4242345.4232name123_45one two three2 choicehorror4242345.4232name123_453 choicehistory4242345.4232name123_45one two three4 choicephilosophy4242345.4232name123_451 choiceromance4242345.4232name123_45one two three2 choicefiction4242345.4232name123_453 choicehorror4242345.4232name123_45one two three4 choicehistory4242345.4232name123_451 choicephilosophy4242345.4232name123_45one two three2 choiceromance4242345.4232name123_453 choicefiction4242345.4232name123_45one two three4 choicehorror4242345.4232name123_451 choicehistory4242345.4232name123_45one two three2 choicephilosophy4242345.4232name123_453 choiceromance4242345.4232name123_45one two three4 choicefiction4242345.4232name123_451 choicehorror4242345.4232name123_45one two three2 choicehistory4242345.4232name123_453 choicephilosophy4242345.4232name123_45one two three4 choiceromance4242345.4232name123_451 choicefiction4242345.4232name123_45one two three2 choicehorror4242345.4232name123_453 choicehistory4242345.4232name123_45one two three4 choicephilosophy4242345.4232name123_451 choiceromance4242345.4232name123_45one two three2 choicefiction4242345.4232name123_453 choicehorror4242345.4232name123_45one two three4 choicehistory4242345.4232name123_451 choicephilosophy4242345.4232name123_45one two three2 choiceromance4242345.4232name123_453 choicefiction4242345.4232name123_45one two three4 choicehorror4242345.4232name123_451 choicehistory4242345.4232name123_45one two three2 choicephilosophy4242345.4232name123_453 choiceromance4242345.4232name123_45one two three4 choicefiction4242345.4232name123_451 choicehorror4242345.4232name123_45one two three2 choicehistory4242345.4232name123_453 choicephilosophy4242345.4232name123_45one two three4 choiceromance4242345.4232name123_451 choicefiction4242345.4232name123_45one two three2 choicehorror4242345.4232name123_453 choicehistory4242345.4232name123_45one two three4 choicephilosophy4242345.4232name123_451 choiceromance4242345.4232name123_45one two three2 choicefiction4242345.4232name123_453 choicehorror4242345.4232name123_45one two three4 choicehistory4242345.4232name123_451 choicephilosophy4242345.4232name123_45one two three2 choiceromance4242345.4232name123_453 choicefiction4242345.4232name123_45one two three4 choicehorror4242345.4232name123_451 choicehistory4242345.4232name123_45one two three2 choicephilosophy4242345.4232name123_453 choiceromance4242345.4232name123_45one two three4 choicefiction4242345.4232name123_451 choicehorror4242345.4232name123_45one two three2 choicehistory4242345.4232name123_453 choicephilosophy4242345.4232name123_45one two three4 choiceromance4242345.4232name123_451 choicefiction4242345.4232name123_45one two three2 choicehorror4242345.4232name123_453 choicehistory4242345.4232name123_45one two three4 choicephilosophy4242345.4232name123_451 choiceromance4242345.4232name123_45one two three2 choicefiction4242345.4232name123_453 choicehorror4242345.4232name123_45one two three4 choicehistory4242345.4232name123_451 choicephilosophy4242345.4232name123_45one two three2 choiceromance4242345.4232name123_453 choicefiction4242345.4232name123_45one two three4 choicehorror4242345.4232name123_451 choicehistory4242345.4232name123_45one two three2 choicephilosophy4242345.4232name123_453 choiceromance4242345.4232name123_45one two three4 choicefiction4242345.4232name123_451 choicehorror4242345.4232name123_45one two three2 choicehistory4242345.4232name123_453 choicephilosophy4242345.4232name123_45one two three4 choiceromance4242345.4232name123_451 choicefiction4242345.4232name123_45one two three2 choicehorror4242345.4232name123_453 choicehistory4242345.4232name123_45one two three4 choicephilosophy4242345.4232name123_451 choiceromance4242345.4232name123_45one two three2 choicefiction4242345.4232name123_453 choicehorror4242345.4232name123_45one two three4 choicehistory4242345.4232name123_451 choicephilosophy4242345.4232name123_45one two three2 choiceromance4242345.4232name123_453 choicefiction4242345.4232name123_45one two three4 choicehorror4242345.4232name123_451 choicehistory4242345.4232name123_45one two three2 choicephilosophy4242345.4232name123_453 choiceromance4242345.4232name123_45one two three4 choicefiction4242345.4232name123_451 choicehorror4242345.4232name123_45one two three2 choicehistory4242345.4232name123_453 choicephilosophy4242345.4232name123_45one two three4 choiceromance4242345.4232name123_451 choicefiction4242345.4232name123_45one two three2 choicehorror4242345.4232name123_453 choicehistory4242345.4232name123_45one two three4 choicephilosophy4242345.4232name123_451 choiceromance4242345.4232name123_45one two three2 choicefiction4242345.4232name123_453 choicehorror4242345.4232name123_45one two three4 choicehistory4242345.4232name123_451 choicephilosophy4242345.4232name123_45one two three2 choiceromance4242345.4232name123_453 choicefiction4242345.4232name123_45one two three4 choicehorror4242345.4232name123_451 choicehistory4242345.4232name123_45one two three2 choicephilosophy4242345.4232name123_453 choiceromance4242345.4232name123_45one two three4 choicefiction4242345.4232name123_451 choicehorror4242345.4232name123_45one two three2 choicehistory4242345.4232name123_453 choicephilosophy4242345.4232name123_45one two three4 choiceromance4242345.4232name123_451 choicefiction4242345.4232name123_45one two three2 choicehorror4242345.4232name123_453 choicehistory4242345.4232name123_45one two three4 choicephilosophy4242345.4232name123_451 choiceromance4242345.4232name123_45one two three2 choicefiction4242345.4232name123_453 choicehorror4242345.4232name123_45one two three4 choicehistory4242345.4232name123_451 choicephilosophy4242345.4232name123_45one two three2 choiceromance4242345.4232name123_453 choicefiction4242345.4232name123_45one two three4 choicehorror4242345.4232name123_451 choicehistory4242345.4232name123_45one two three2 choicephilosophy4242345.4232name123_453 choiceromance4242345.4232name123_45one two three4 choicefiction4242345.4232name123_451 choicehorror4242345.4232name123_45one two three2 choicehistory4242345.4232name123_453 choicephilosophy4242345.4232name123_45one two three4 choiceromance4242345.4232name123_451 choicefiction4242345.4232name123_45one two three2 choicehorror4242345.4232name123_453 choicehistory4242345.4232name123_45one two three4 choicephilosophy4242345.4232name123_451 choiceromance4242345.4232name123_45one two three2 choicefiction4242345.4232name123_453 choicehorror4242345.4232name123_45one two three4 choicehistory4242345.4232name123_451 choicephilosophy4242345.4232name123_45one two three2 choiceromance4242345.4232name123_453 choicefiction4242345.4232name123_45one two three4 choicehorror4242345.4232name123_451 choicehistory4242345.4232name123_45one two three2 choicephilosophy4242345.4232name123_453 choiceromance4242345.4232name123_45one two three4 choicefiction4242345.4232name123_451 choicehorror4242345.4232name123_45one two three2 choicehistory4242345.4232name123_453 choicephilosophy4242345.4232name123_45one two three4 choiceromance4242345.4232name123_451 choicefiction4242345.4232name123_45one two three2 choicehorror4242345.4232name123_453 choicehistory4242345.4232name123_45one two three4 choicephilosophy4242345.4232name123_451 choiceromance4242345.4232name123_45one two three2 choicefiction4242345.4232name123_453 choicehorror4242345.4232name123_45one two three4 choicehistory4242345.4232name123_451 choicephilosophy4242345.4232name123_45one two three2 choiceromance4242345.4232name123_453 choicefiction4242345.4232name123_45one two three4 choicehorror4242345.4232name123_451 choicehistory4242345.4232name123_45one two three2 choicephilosophy4242345.4232name123_453 choiceromance4242345.4232name123_45one two three4 choicefiction4242345.4232name123_451 choicehorror4242345.4232name123_45one two three2 choicehistory4242345.4232name123_453 choicephilosophy4242345.4232name123_45one two three4 choiceromance4242345.4232name123_451 choicefiction4242345.4232name123_45one two three2 choicehorror4242345.4232name123_453 choicehistory4242345.4232name123_45one two three4 choicephilosophy4242345.4232name123_451 choiceromance4242345.4232name123_45one two three2 choicefiction4242345.4232name123_453 choicehorror4242345.4232name123_45one two three4 choicehistory4242345.4232name123_451 choicephilosophy4242345.4232name123_45one two three2 choiceromance4242345.4232name123_453 choicefiction4242345.4232name123_45one two three4 choicehorror4242345.4232name123_451 choicehistory4242345.4232name123_45one two three2 choicephilosophy4242345.4232name123_453 choiceromance4242345.4232name123_45one two three4 choicefiction4242345.4232name123_451 choicehorror4242345.4232name123_45one two three2 choicehistory4242345.4232name123_453 choicephilosophy4242345.4232name123_45one two three4 choiceromance4242345.4232name123_451 choicefiction4242345.4232name123_45one two three2 choicehorror4242345.4232name123_453 choicehistory4242345.4232name123_45one two three4 choicephilosophy4242345.4232name123_451 choiceromance4242345.4232name123_45one two three2 choicefiction4242345.4232name123_453 choicehorror4242345.4232name123_45one two three4 choicehistory4242345.4232name123_451 choicephilosophy4242345.4232name123_45one two three2 choiceromance4242345.4232name123_453 choicefiction4242345.4232name123_45one two three4 choicehorror4242345.4232name123_451 choicehistory4242345.4232name123_45one two three2 choicephilosophy4242345.4232name123_453 choiceromance4242345.4232name123_45one two three4 choicefiction4242345.4232name123_451 choicehorror4242345.4232name123_45one two three2 choicehistory4242345.4232name123_453 choicephilosophy4242345.4232name123_45one two three4 choiceromance4242345.4232name123_451 choicefiction4242345.4232name123_45one two three2 choicehorror4242345.4232name123_453 choicehistory4242345.4232name123_45one two three4 choicephilosophy4242345.4232name123_451 choiceromance4242345.4232name123_45one two three2 choicefiction4242345.4232name123_453 choicehorror4242345.4232name123_45one two three4 choicehistory4242345.4232name123_451 choicephilosophy4242345.4232name123_45one two three2 choiceromance4242345.4232name123_453 choicefiction4242345.4232name123_45one two three4 choicehorror4242345.4232name123_451 choicehistory4242345.4232name123_45one two three2 choicephilosophy4242345.4232name123_453 choiceromance4242345.4232name123_45one two three4 choicefiction4242345.4232name123_451 choicehorror4242345.4232name123_45one two three2 choicehistory4242345.4232name123_453 choicephilosophy4242345.4232name123_45one two three4 choiceromance4242345.4232name123_451 choicefiction4242345.4232name123_45one two three2 choicehorror4242345.4232name123_453 choicehistory4242345.4232name123_45one two three4 choicephilosophy4242345.4232name123_451 choiceromance4242345.4232name123_45one two three2 choicefiction4242345.4232name123_453 choicehorror4242345.4232name123_45one two three4 choicehistory4242345.4232name123_451 choicephilosophy4242345.4232name123_45one two three2 choiceromance4242345.4232name123_453 choicefiction4242345.4232name123_45one two three4 choicehorror4242345.4232name123_451 choicehistory4242345.4232name123_45one two three2 choicephilosophy4242345.4232name123_453 choiceromance4242345.4232name123_45one two three4 choicefiction4242345.4232name123_451 choicehorror4242345.4232name123_45one two three2 choicehistory4242345.4232name123_453 choicephilosophy4242345.4232name123_45one two three4 choiceromance4242345.4232name123_451 choicefiction \ No newline at end of file diff --git a/examples/cxx/parser/performance/test.xsd b/examples/cxx/parser/performance/test.xsd deleted file mode 100644 index bb59c2a..0000000 --- a/examples/cxx/parser/performance/test.xsd +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/cxx/parser/performance/time.cxx b/examples/cxx/parser/performance/time.cxx deleted file mode 100644 index aca5c74..0000000 --- a/examples/cxx/parser/performance/time.cxx +++ /dev/null @@ -1,46 +0,0 @@ -// file : examples/cxx/parser/performance/time.cxx -// copyright : not copyrighted - public domain - -#include "time.hxx" - -#if defined (WIN32) || defined (__WIN32__) -# define WIN32_LEAN_AND_MEAN -# include // GetSystemTimeAsFileTime -#else -# include // gettimeofday -# include // timeval -#endif - -#include // std::ostream -#include // std::setfill, std::setw - -namespace os -{ - time:: - time () - { -#if defined (WIN32) || defined (__WIN32__) - FILETIME ft; - GetSystemTimeAsFileTime (&ft); - unsigned long long v ( - ((unsigned long long) (ft.dwHighDateTime) << 32) + ft.dwLowDateTime); - - sec_ = static_cast (v / 10000000ULL); - nsec_ = static_cast ((v % 10000000ULL) * 100); -#else - timeval tv; - if (gettimeofday(&tv, 0) != 0) - throw failed (); - - sec_ = static_cast (tv.tv_sec); - nsec_ = static_cast (tv.tv_usec * 1000); -#endif - } - - std::ostream& - operator<< (std::ostream& o, time const& t) - { - return o << t.sec () << '.' - << std::setfill ('0') << std::setw (9) << t.nsec (); - } -} diff --git a/examples/cxx/parser/performance/time.hxx b/examples/cxx/parser/performance/time.hxx deleted file mode 100644 index 3b2f040..0000000 --- a/examples/cxx/parser/performance/time.hxx +++ /dev/null @@ -1,110 +0,0 @@ -// file : examples/cxx/parser/performance/time.hxx -// copyright : not copyrighted - public domain - -#ifndef TIME_HXX -#define TIME_HXX - -#include // std::ostream& - -namespace os -{ - class time - { - public: - class failed {}; - - // Create a time object representing the current time. - // - time (); - - time (unsigned long long nsec) - { - sec_ = static_cast (nsec / 1000000000ULL); - nsec_ = static_cast (nsec % 1000000000ULL); - } - - time (unsigned long sec, unsigned long nsec) - { - sec_ = sec; - nsec_ = nsec; - } - - public: - unsigned long - sec () const - { - return sec_; - } - - unsigned long - nsec () const - { - return nsec_; - } - - public: - class overflow {}; - class underflow {}; - - time - operator+= (time const& b) - { - unsigned long long tmp = 0ULL + nsec_ + b.nsec_; - - sec_ += static_cast (b.sec_ + tmp / 1000000000ULL); - nsec_ = static_cast (tmp % 1000000000ULL); - - return *this; - } - - time - operator-= (time const& b) - { - if (*this < b) - throw underflow (); - - sec_ -= b.sec_; - - if (nsec_ < b.nsec_) - { - --sec_; - nsec_ += 1000000000ULL - b.nsec_; - } - else - nsec_ -= b.nsec_; - - return *this; - } - - friend time - operator+ (time const& a, time const& b) - { - time r (a); - r += b; - return r; - } - - friend time - operator- (time const& a, time const& b) - { - time r (a); - r -= b; - return r; - } - - friend bool - operator < (time const& a, time const& b) - { - return (a.sec_ < b.sec_) || (a.sec_ == b.sec_ && a.nsec_ < b.nsec_); - } - - private: - unsigned long sec_; - unsigned long nsec_; - }; - - std::ostream& - operator<< (std::ostream&, time const&); -} - -#endif // TIME_HXX -- cgit v1.1