Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F7450884
AccessEdge.java
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
AccessEdge.java
View Options
package
org.softwareheritage.graph.benchmark
;
import
com.martiansoftware.jsap.JSAPException
;
import
it.unimi.dsi.big.webgraph.LazyLongIterator
;
import
org.softwareheritage.graph.Graph
;
import
org.softwareheritage.graph.benchmark.utils.Statistics
;
import
org.softwareheritage.graph.benchmark.utils.Timing
;
import
java.io.IOException
;
import
java.util.ArrayList
;
/**
* Benchmark to time edge access time.
*
* @author The Software Heritage developers
*/
public
class
AccessEdge
{
/**
* Main entrypoint.
*
* @param args command line arguments
*/
public
static
void
main
(
String
[]
args
)
throws
IOException
,
JSAPException
{
Benchmark
bench
=
new
Benchmark
();
bench
.
parseCommandLineArgs
(
args
);
Graph
graph
=
new
Graph
(
bench
.
args
.
graphPath
);
long
[]
nodeIds
=
bench
.
args
.
random
.
generateNodeIds
(
graph
,
bench
.
args
.
nbNodes
);
ArrayList
<
Double
>
timings
=
new
ArrayList
<>();
for
(
long
nodeId
:
nodeIds
)
{
long
startTime
=
Timing
.
start
();
LazyLongIterator
neighbors
=
graph
.
successors
(
nodeId
);
long
firstNeighbor
=
neighbors
.
nextLong
();
double
duration
=
Timing
.
stop
(
startTime
);
timings
.
add
(
duration
);
}
System
.
out
.
println
(
"Used "
+
bench
.
args
.
nbNodes
+
" random edges (results are in seconds):"
);
Statistics
stats
=
new
Statistics
(
timings
);
stats
.
printAll
();
}
}
File Metadata
Details
Attached
Mime Type
text/x-c
Expires
Thu, Apr 17, 9:02 AM (6 h, 35 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3287719
Attached To
rDGRPH Compressed graph representation
Event Timeline
Log In to Comment