Giter VIP home page Giter VIP logo

Comments (23)

yuyang-ok avatar yuyang-ok commented on August 18, 2024

executor-fabric-flamegraph
the flame graph file

from geo.

lnicola avatar lnicola commented on August 18, 2024

core::clone::impls::<impl core::clone::Clone for f64>::clone (600 samples, 1.19%)

You're building with --release, right?

core::option::Option<&T>::cloned (12,376 samples, 24.59%)

Wat

from geo.

yuyang-ok avatar yuyang-ok commented on August 18, 2024

@lnicola I am building release version,otherwise all operation should slow

from geo.

lnicola avatar lnicola commented on August 18, 2024

That flamegraph makes no sense to me. get_bounding_rect is pretty simple, and we don't capture stack traces (backtrace::backtrace::trace_unsynchronized) there, it can't even panic.

from geo.

lnicola avatar lnicola commented on August 18, 2024

That's Linux, right? How did you get the flamegraph? Are you using -Z build-std or any profile overrides ([profile.dev.*] etc.)?

from geo.

yuyang-ok avatar yuyang-ok commented on August 18, 2024

yes it's linux, I am using https://crates.io/crates/pprof to pprof

from geo.

lnicola avatar lnicola commented on August 18, 2024

Maybe this?

Note: If you're using lld or mold on Linux, you must use the --no-rosegment flag. Otherwise perf will not be able to generate accurate stack traces (explanation).

from geo.

yuyang-ok avatar yuyang-ok commented on August 18, 2024

I change the config still the same result.

[build]
linker = "clang"
rustflags = [ "-C", "link-arg=-fuse-ld=mold" ,  "-Clink-arg=-Wl,--no-rosegment"]
jobs = 4
incremental = false

from geo.

lnicola avatar lnicola commented on August 18, 2024

Maybe you can give cargo-flamegraph a try? I don't have other ideas right now.

from geo.

yuyang-ok avatar yuyang-ok commented on August 18, 2024

@lnicola yes ,still installing toolchain.

from geo.

yuyang-ok avatar yuyang-ok commented on August 18, 2024

I run twice I get the same error

2024-07-17T07:14:52.627767Z  INFO          task_runner ThreadId(297) gis::st_intersects2: index filter out is 3836,still need full intersects is 4
[ perf record: Woken up 25358 times to write data ]

Warning:
Processed 482187 events and lost 42 chunks!

Check IO/CPU overload!

Warning:
1 out of order events recorded.

[ perf record: Captured and wrote 6761.545 MB perf.data (425990 samples) ]
failed to sample program

from geo.

lnicola avatar lnicola commented on August 18, 2024

Hmm, that's normally just a warning, and it does produce a perf.data file, which you can process. But you can use something like -F 498 to reduce the sampling frequency.

from geo.

yuyang-ok avatar yuyang-ok commented on August 18, 2024

I think capture pprof succeeful.

executor

from geo.

yuyang-ok avatar yuyang-ok commented on August 18, 2024

cargo-flamegraph capture less stack frame??

from geo.

lnicola avatar lnicola commented on August 18, 2024

I'm still confused about the flame graph, TBH.

Maybe it just gets called too many times? See https://docs.rs/rstar/latest/rstar/primitives/struct.CachedEnvelope.html, if rstar calls envelope a lot of times, and your polygons are large, I can see get_bounding_rect becoming a bottleneck.

We could also do .copied() here, but there's no reason for clone() to be slow.

from geo.

yuyang-ok avatar yuyang-ok commented on August 18, 2024

Yes , I think envelope need called 2 million times.

from geo.

lnicola avatar lnicola commented on August 18, 2024

Can you try to insert CachedEnvelope<Geometry<f64>> into your rstar tree?

2M times isn't even a lot...

from geo.

yuyang-ok avatar yuyang-ok commented on August 18, 2024

let me see

from geo.

yuyang-ok avatar yuyang-ok commented on August 18, 2024

No I don't think so.

from geo.

lnicola avatar lnicola commented on August 18, 2024

Unless you can produce a test case I can run, I'll leave this for someone who actually managed to use rstar šŸ˜….

from geo.

yuyang-ok avatar yuyang-ok commented on August 18, 2024

@lnicola thanks I will try

from geo.

yuyang-ok avatar yuyang-ok commented on August 18, 2024

I use this code to run https://github.com/yuyang-ok/geo_parse_bounding_performance.
run quit fast.

warning: unused config key `build.linker` in `/home/yuyang/.cargo/config`
   Compiling geo_bounding_rect_performance v0.1.0 (/home/yuyang/geo_parse_bounding_performance)
    Finished `release` profile [optimized] target(s) in 1.35s
     Running `target/release/geo_bounding_rect_performance`
parse geometry and bounding_rect 10s total run:3022800
bounding_rect 1s total run:3022800

from geo.

lnicola avatar lnicola commented on August 18, 2024

Hmm, it might look different if you include the tree building.

from geo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    šŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ā¤ļø Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.