Comments (9)
Hello,
your query and how you execute it is fine.
And unfortunately yes, there is quite a big overhead from BoltSips.
We will investigate to understand where this comes from and fix it. It can take some time as it can deeply impact the internals of bolt sips.
A quick workaround for your problem is to narrow your query to only what you need, i.e instead of
MATCH (p:Place) RETURN p AS place
, you can use MATCH (p:Place) RETURN p.name
.
This way, instead of retrieving something like this:
Bolt.Sips.Response{
bookmark: "neo4j:bookmark:v1:tx4",
fields: ["p"],
notifications: [],
plan: nil,
profile: nil,
records: [
[
%Bolt.Sips.Types.Node{
id: 0,
labels: ["Place"],
properties: %{"name" => "place_1"}
}
],
[
%Bolt.Sips.Types.Node{
id: 1,
labels: ["Place"],
properties: %{"name" => "place_2"}
}
]
],
results: [
%{
"p" => %Bolt.Sips.Types.Node{
id: 0,
labels: ["Place"],
properties: %{"name" => "place_1"}
}
},
%{
"p" => %Bolt.Sips.Types.Node{
id: 1,
labels: ["Place"],
properties: %{"name" => "place_2"}
}
}
],
stats: [],
type: "r"
}
you retrieve something like this:
%Bolt.Sips.Response{
bookmark: "neo4j:bookmark:v1:tx4",
fields: ["p.name"],
notifications: [],
plan: nil,
profile: nil,
records: [["place_1"], ["place_2"]],
results: [%{"p.name" => "place_1"}, %{"p.name" => "place_2"}],
stats: [],
type: "r"
}
And query time will be divied by 3...
from bolt_sips.
Ok, found something with Code.ensure_loaded
called too many times....
The test runs on 1000 nodes.
First, it was
Name ips average deviation median 99th %
run 0.152 6.59 s ±1.41% 6.62 s 6.66 s
After change, it becames:
Name ips average deviation median 99th %
run 8.53 117.28 ms ±5.42% 116.77 ms 140.41 ms
And if logs are disabled, it is:
Name ips average deviation median 99th %
run 32.82 30.47 ms ±4.95% 30.20 ms 35.21 ms
It's a little bit faster ;)
I've just have to check one other thing and then I'll commit.
from bolt_sips.
W⦿‿⦿t!
We’ll have the 2.0 release this week ❤️
from bolt_sips.
Hello all! I was on a trip last week so I didn't have time to answer 😆
I have just tested here, and it's f***** awesome!
Testing with 100 nodes, it became from 1s to 50ms.
Thanks all for your hard work!
I hope that I can contribute in the future, as I am still learning elixir 😍
@dominique-vassard Okay, thank you! I will see and try it 😄
from bolt_sips.
Hmm okay, thanks!
I will try your suggestions, and if I have some time, I will try to investigate where is the bottleneck (although I'm just an amateur in elixir).
Cheers.
from bolt_sips.
Just a quick ad: @marcosmko if you're using Ecto, https://github.com/dominique-vassard/ecto_neo4j may interest you.
Current available version on hex is crap but as soon as bolt_sips 2.0 is available, the new nice version will be released :)
from bolt_sips.
(if we have travis fixed and passing, then we'll push 2.0 tonight :) )
from bolt_sips.
and we're 2.0.2 =)
https://hexdocs.pm/bolt_sips/getting-started.html#content
Thank you all for your patience, feedback and code contributions!
You're awesome!
❤️
from bolt_sips.
Haha, noiceee 😀 Thank you, for confirming the changes had a positive impact ❤️
from bolt_sips.
Related Issues (20)
- Config field for `timeout` not reflected in query timeouts HOT 12
- Just need some clarity about Bolt.Sips.conn
- Connection difficulty -- Bolt.Sips.Internals.Error Port #Port<0.n> is closed HOT 7
- Connection loses after a while: ** (Bolt.Sips.Exception) Port {:sslsocket, {:gen_tcp, #Port<0.25>, :tls_connection, :undefined}, [#PID<0.2789.0>, #PID<0.2786.0>]} is closed HOT 5
- Is routing mode enabled with neo4j+s protocol? HOT 6
- Prepared statements for queries when not possible to use parameters HOT 3
- Looking for new maintainers HOT 10
- Neo4j version 4 support HOT 5
- Going forward HOT 5
- Consistent bad connection state after malformed query: "... You need to\n`ACK_FAILURE` or `RESET` ..." HOT 7
- Road to neo4j 4 and streaming HOT 5
- Bolt.Sips.Protocol disconnected: ** (DBConnection.ConnectionError) HOT 13
- Unable to connect when using authentication HOT 14
- No write operations are allowed directly on this database. Writes must pass through the leader. The role of this server is: FOLLOWER HOT 3
- Hiding credentials in `Bolt.Sips.info`? HOT 3
- Request: guidance on parameterized queries HOT 4
- Response.profile is empty with a query with "PROFILE"
- (Bolt.Sips.Exception) unable to encode value: -128 HOT 1
- Outgoing SSL connection hangs, cannot be dropped and re-established HOT 2
- Feature request: auto reconnect HOT 1
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 bolt_sips.