Comments (5)
I did an experiment with zstr streams:
void get_root_elements(const char *filename){
pugi::xml_document doc;
pugi::xml_parse_result result;
std::string x(filename);
if(x.rfind(".") != std::string::npos && x.substr(x.rfind(".")+1) == "gz"){
std::ifstream F;
F.open(x);
zstr::istream Z(F);
result = doc.load(Z);
} else {
result = doc.load_file(filename);
}
if(!result)
throw std::runtime_error("Could not load XML file " + std::string(filename) + ".");
for(pugi::xml_node node= doc.first_child(); node; node = node.next_sibling()){
if(std::strcmp(node.name(), "rr_graph") == 0){
count_rr_graph(node);
alloc_arenas();
load_rr_graph(node, &rr_graph);
}
else throw std::runtime_error("Invalid root-level element " + std::string(node.name()));
}
}
Artix 7 rr_graph run with uncompressed file(922 MB)(without errno checking after strtol calls):
7.645 8.097 7.600 7.636 7.677
With gzip-compressed file:
11.34 11.15 11.10 11.29 11.13
from uxsdcxx.
Is that with or without a hot disk cache? Can you try flushing that?
from uxsdcxx.
It's with a hot disk cache. Without the file in the cache, the reading time can jump to 11 seconds or so.
from uxsdcxx.
@duck2 - How does the time between with gzip and without gzip compare without file in the disk cache?
from uxsdcxx.
Once SAX parsing support is complete (#3), a compressed one pass SAX parser may be a good compromise between CPU/disk/memory usage. Unclear if a two pass SAX + compression would have good numbers.
from uxsdcxx.
Related Issues (20)
- Convert comments into docstrings HOT 1
- Use sorted(set) when you need ordered output HOT 2
- Make uxsdcxx.py pep8 clean
- Generate sane default values HOT 2
- Figure out if we can use POD data structures HOT 4
- Create a Captain Proto schema generator HOT 1
- Sort struct declarations in dependency order HOT 1
- Make lexing ARM-friendly
- Add memory freeing functions HOT 1
- Make an XML writer HOT 1
- Write a useful README
- Create a boost PropertyTree generator
- sequences accept the wrong inputs
- Load xml into capnp HOT 1
- Support true/false for boolean values
- Cull unused complex types
- Unstable output order HOT 1
- Replace master with interface-consumer
- Transfer this repo to SymbiFlow organization HOT 3
- Add license checking github action HOT 2
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 uxsdcxx.