Skip to content

Commit

Permalink
replace Float with Double
Browse files Browse the repository at this point in the history
  • Loading branch information
li3zhen1 committed Oct 11, 2023
1 parent f765b06 commit b790a94
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ See [Example](https://github.com/li3zhen1/Grape/tree/main/Examples/GrapeView) fo

### Perfomance

Grape uses simd to calculate position and velocity. Currently it takes ~0.13 seconds to iterate 120 times over the example graph (with 77 vertices, 254 edges, with manybody, center, collide and link forces, release build, on a 32GB M1 Max).
Grape uses simd to calculate position and velocity. Currently it takes ~0.13 seconds to iterate 120 times over the example graph. (77 vertices, 254 edges, with manybody, center, collide and link forces. Release build on a M1 Max)
10 changes: 5 additions & 5 deletions Tests/ForceSimulationTests/MiserableGraphTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ final class MiserableGraphTest: XCTestCase {

let sim = Simulation(nodes: data.nodes)

let manybodyForce = sim.createManyBodyForce(strength: -30)


let linkForce = sim.createLinkForce(links: data.links.map({ l in
(l.source, l.target)
}))

let centerForce = sim.createCenterForce(center: .zero)
// let collideForce = sim.createCollideForce(radius: .constant(5))
let manybodyForce = sim.createManyBodyForce(strength: -30)

let centerForce = sim.createCenterForce(center: .zero)
let collideForce = sim.createCollideForce(radius: .constant(5))

// sim.tick()
measure {
for _ in 0..<120{
Expand Down

0 comments on commit b790a94

Please sign in to comment.