Age | Commit message (Collapse) | Author |
|
Since xml_node/attribute are pointer wrappers it's cheaper to pass them by
value. This makes XPath evaluation 4% faster and node printing 2% faster.
git-svn-id: https://pugixml.googlecode.com/svn/trunk@1029 99668b35-9821-0410-8761-19e4c4f06640
|
|
This makes node copying 6% faster, prevents it from ever running out of
stack space and makes the profiling results more actionable for profilers
that can't merge information from recursive calls.
git-svn-id: https://pugixml.googlecode.com/svn/trunk@1027 99668b35-9821-0410-8761-19e4c4f06640
|
|
Renames write to write_string and write_buffer to make it easier to
distinguish between them in profiling runs and commit messages...
git-svn-id: https://pugixml.googlecode.com/svn/trunk@1025 99668b35-9821-0410-8761-19e4c4f06640
|
|
Make it easier for the compiler to generate good code by loading bufsize
into a local once and returning new offset from flush(). This results in
7% performance gain.
git-svn-id: https://pugixml.googlecode.com/svn/trunk@1024 99668b35-9821-0410-8761-19e4c4f06640
|
|
Instead of computing the length and doing memcpy we now copy the head of
the string into the buffer (like strcpy) and then use memcpy for tail if
necessary. This results in 10-15% speedup for writing typical documents with
a mix of short and long strings.
git-svn-id: https://pugixml.googlecode.com/svn/trunk@1023 99668b35-9821-0410-8761-19e4c4f06640
|
|
//name means /descendant-or-self::node()/child::name, but we frequently
can replace it with /descendant::name. This means we do not have to build
up a temporary node set with all descendants that can lead to 3x speedups.
git-svn-id: https://pugixml.googlecode.com/svn/trunk@1021 99668b35-9821-0410-8761-19e4c4f06640
|
|
git-svn-id: https://pugixml.googlecode.com/svn/trunk@1019 99668b35-9821-0410-8761-19e4c4f06640
|
|
We now precompute indent length and have a fast path for lengths 0..4 that
avoids calling memcpy in a tight loop. This makes node output 20-30%
faster if indentation is enabled.
git-svn-id: https://pugixml.googlecode.com/svn/trunk@1018 99668b35-9821-0410-8761-19e4c4f06640
|
|
This makes node output 3% faster, prevents it from ever running out of
stack space and makes the profiling results more actionable for profilers
that can't merge information from recursive calls.
git-svn-id: https://pugixml.googlecode.com/svn/trunk@1014 99668b35-9821-0410-8761-19e4c4f06640
|
|
Fixes C4458: declaration of 'var' hides class member
git-svn-id: https://pugixml.googlecode.com/svn/trunk@1011 99668b35-9821-0410-8761-19e4c4f06640
|
|
Use a special macro that unrolls the loop body and uses static branch prediction
to improve code generation.
This increases performance across all data sets from benchmark; clang x64 is 10%-40%
faster, clang x86 is 5%-20% faster, msvc is 5%-10% faster.
git-svn-id: https://pugixml.googlecode.com/svn/trunk@1008 99668b35-9821-0410-8761-19e4c4f06640
|
|
This makes it easier to optimize strconv. For consistency move all definitions of parser-internal macros to one place.
git-svn-id: https://pugixml.googlecode.com/svn/trunk@1007 99668b35-9821-0410-8761-19e4c4f06640
|
|
Also add it to #undef list at the end to avoid conflicts
git-svn-id: https://pugixml.googlecode.com/svn/trunk@1006 99668b35-9821-0410-8761-19e4c4f06640
|
|
git-svn-id: https://pugixml.googlecode.com/svn/trunk@1005 99668b35-9821-0410-8761-19e4c4f06640
|
|
The operations itself are O(1) since they just rearrange pointers.
However, the validation step is O(logN) due to a sanity check to prevent recursive trees.
git-svn-id: https://pugixml.googlecode.com/svn/trunk@1002 99668b35-9821-0410-8761-19e4c4f06640
|
|
This should make moving implementation easier.
git-svn-id: https://pugixml.googlecode.com/svn/trunk@1001 99668b35-9821-0410-8761-19e4c4f06640
|
|
When allocating new pages, make sure that the page has at least 1/4 of the
base page size free. This makes sure that we can do small allocations after
big allocations (i.e. huge node lists) without doing a heap alloc.
This is important because XPath stack code always reclaims extra pages after
evaluating sub-expressions, so allocating a small chunk of memory and then
rolling the state back is a common case (filtering a node list using a
predicate usually does this).
A better solution involves smarter allocation rollback strategy, but the
implemented solution is simple and practical.
git-svn-id: https://pugixml.googlecode.com/svn/trunk@999 99668b35-9821-0410-8761-19e4c4f06640
|
|
Exposing true mutable iterators allows the user to violate sorting order
contract. However, some generic algorithms (i.e. Boost ForEach) require
iterator methods to be present.
git-svn-id: https://pugixml.googlecode.com/svn/trunk@998 99668b35-9821-0410-8761-19e4c4f06640
|
|
qmake.
Qmake treats all files that are #include-d as header files, even if the #include is
guarded by an #ifdef. It looks like the only solution that allows for transparent
header-only support based on preprocessor define involves moving the actual source
into a separate header file and including this file in pugixml.cpp.
Let's not do it yet.
git-svn-id: https://pugixml.googlecode.com/svn/trunk@990 99668b35-9821-0410-8761-19e4c4f06640
|
|
git-svn-id: https://pugixml.googlecode.com/svn/trunk@987 99668b35-9821-0410-8761-19e4c4f06640
|
|
git-svn-id: https://pugixml.googlecode.com/svn/trunk@985 99668b35-9821-0410-8761-19e4c4f06640
|
|
git-svn-id: https://pugixml.googlecode.com/svn/trunk@983 99668b35-9821-0410-8761-19e4c4f06640
|
|
Introduce a notable behavior change in default parsing mode: documents without a
document element node are now considered invalid. This is technically a breaking change,
however the amount of documents it affects is very small, all parsed data still persists,
and lack of this check results in very confusing behavior in a number of cases.
In order to be able to parse documents without an element node, a fragment parsing flag is
introduced.
Parsing a buffer in fragment mode treats the buffer as a fragment of a valid XML.
As a consequence, top-level PCDATA is added to the tree; additionally, there are no
restrictions on the number of nodes -- so documents without a document element are considered
valid.
Due to the way parsing works internally, load_buffer_inplace occasionally can not preserve
the document contents if it's parsed in a fragment mode. While unfortunate, this problem is
fundamental; since the use case is relatively obscure, hopefully documenting this shortcoming
will be enough.
git-svn-id: https://pugixml.googlecode.com/svn/trunk@980 99668b35-9821-0410-8761-19e4c4f06640
|
|
Parsing used to work on a non null-terminated buffer, inserting a fake null terminator to increase performance.
This makes it impossible to implement fragment parsing that preserves PCDATA contents (as witnessed by some
tests for boundary conditions that actually depended on this behavior).
Since almost all uses result in us allocating an internal buffer anyway, the new policy is to make sure all buffers
that are allocated by pugixml are null-terminated - the only exception now is external calls to load_buffer_inplace
that don't trigger encoding conversion.
git-svn-id: https://pugixml.googlecode.com/svn/trunk@977 99668b35-9821-0410-8761-19e4c4f06640
|
|
reduce overloading.
git-svn-id: https://pugixml.googlecode.com/svn/trunk@975 99668b35-9821-0410-8761-19e4c4f06640
|
|
git-svn-id: https://pugixml.googlecode.com/svn/trunk@973 99668b35-9821-0410-8761-19e4c4f06640
|
|
Add tentative changelog for 1.4 to the documentation.
Since Google Code no longer allows file upload, replace download links with GitHub release links.
git-svn-id: http://pugixml.googlecode.com/svn/trunk@968 99668b35-9821-0410-8761-19e4c4f06640
|
|
git-svn-id: http://pugixml.googlecode.com/svn/trunk@967 99668b35-9821-0410-8761-19e4c4f06640
|
|
git-svn-id: http://pugixml.googlecode.com/svn/trunk@965 99668b35-9821-0410-8761-19e4c4f06640
|
|
PUGIXML_HEADER_ONLY anywhere now, source is automatically included
git-svn-id: http://pugixml.googlecode.com/svn/trunk@964 99668b35-9821-0410-8761-19e4c4f06640
|
|
(autodetection is not implemented yet)
git-svn-id: http://pugixml.googlecode.com/svn/trunk@962 99668b35-9821-0410-8761-19e4c4f06640
|
|
git-svn-id: http://pugixml.googlecode.com/svn/trunk@961 99668b35-9821-0410-8761-19e4c4f06640
|
|
xml_node_iterator in terms of internals
git-svn-id: http://pugixml.googlecode.com/svn/trunk@960 99668b35-9821-0410-8761-19e4c4f06640
|
|
as a compile-time constant expression
git-svn-id: http://pugixml.googlecode.com/svn/trunk@959 99668b35-9821-0410-8761-19e4c4f06640
|
|
xml_text::as_int. This is effectively a form of strtol with base 0, but without octal support.
git-svn-id: http://pugixml.googlecode.com/svn/trunk@958 99668b35-9821-0410-8761-19e4c4f06640
|
|
git-svn-id: http://pugixml.googlecode.com/svn/trunk@957 99668b35-9821-0410-8761-19e4c4f06640
|
|
git-svn-id: http://pugixml.googlecode.com/svn/trunk@956 99668b35-9821-0410-8761-19e4c4f06640
|
|
git-svn-id: http://pugixml.googlecode.com/svn/trunk@955 99668b35-9821-0410-8761-19e4c4f06640
|
|
value vs child_value confusion.
git-svn-id: http://pugixml.googlecode.com/svn/trunk@954 99668b35-9821-0410-8761-19e4c4f06640
|
|
of the same size due to pointer-sized alignment
git-svn-id: http://pugixml.googlecode.com/svn/trunk@946 99668b35-9821-0410-8761-19e4c4f06640
|
|
git-svn-id: http://pugixml.googlecode.com/svn/trunk@944 99668b35-9821-0410-8761-19e4c4f06640
|
|
git-svn-id: http://pugixml.googlecode.com/svn/trunk@943 99668b35-9821-0410-8761-19e4c4f06640
|
|
wcslen in case there is no wide character support.
git-svn-id: http://pugixml.googlecode.com/svn/trunk@942 99668b35-9821-0410-8761-19e4c4f06640
|
|
due to buffer copy allocation
git-svn-id: http://pugixml.googlecode.com/svn/trunk@941 99668b35-9821-0410-8761-19e4c4f06640
|
|
msvc6)
git-svn-id: http://pugixml.googlecode.com/svn/trunk@939 99668b35-9821-0410-8761-19e4c4f06640
|
|
documents from fragments (compared to parse & clone)
git-svn-id: http://pugixml.googlecode.com/svn/trunk@936 99668b35-9821-0410-8761-19e4c4f06640
|
|
reducing mantissa_buffer size and filling resulting string on heap without an extra copy from stack.
git-svn-id: http://pugixml.googlecode.com/svn/trunk@933 99668b35-9821-0410-8761-19e4c4f06640
|
|
git-svn-id: http://pugixml.googlecode.com/svn/trunk@932 99668b35-9821-0410-8761-19e4c4f06640
|
|
precedence climbing to reduce stack usage
git-svn-id: http://pugixml.googlecode.com/svn/trunk@931 99668b35-9821-0410-8761-19e4c4f06640
|
|
scratch buffer for variable/number parsing (we only need one per parser)
git-svn-id: http://pugixml.googlecode.com/svn/trunk@928 99668b35-9821-0410-8761-19e4c4f06640
|