robertmrk / jmespath.cpp Goto Github PK
View Code? Open in Web Editor NEWC++ implementation of JMESPath, a query language for JSON http://jmespath.org
License: MIT License
C++ implementation of JMESPath, a query language for JSON http://jmespath.org
License: MIT License
This is really a great project. It is very convenient to use and the performance is very good.
But I'm having some problems with it and hope to get help here.
I have a large amount of geojson
object data in my program. In order to use jmespath for operation, I had to combine it into a large array.
Similar to the following code:
// These geojson object data are located in a large map, which is dynamically added and deleted
// std::map<std::string,jp::Json> mydata;
// When I need to perform jmespath operation
std::vector<jp::Json> vec;
vec.reserve( mydata.size() );
for( auto& kvpair : mydata ) {
vec.push_back(kvpair.second);
}
jp::Json data = {
{"data",std::move(vec)}
};
jp::Expression expr = "avg(data[properties.area<`100`].properties.area)"; // Simple example, not fixed
auto result = jp::search(expr, data);
I can change mydata
directly to use jp::Json
array object storage to avoid conversion every time.
However, I wonder if there is a better way?
Because I have a large number of data, I test the filtering operation of 10000 objects, it takes about 0.34 s.But I have more than 200,000 objects.
test environment:
OS : Linux x-mini 5.3.0-45-generic
CPU : Intel(R) Core(TM) i7-4500U CPU @ 1.80GHz x4
MEM : 8G ddr3 1333`
Compiler and compilation options: g++10.0 use -O2
I can use multi-threading for parallel filtering, but it will get multiple results, which requires secondary processing.
I want to know if there is any good way to do it without secondary processing? Tanks.
This is a really good project for JMESpath user on appliance.
I was wondering if you're going to support c++17? More and more projects move forward.
@robertmrk you might be interested in our initiative to ensure the future of JMESPath.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.