-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
38 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,12 @@ | ||
from asv_samples.benchme import add_arr | ||
|
||
|
||
class TimeSuite: | ||
""" | ||
Benchmark that times various operations, including custom summation of | ||
lists. | ||
""" | ||
|
||
def setup(self): | ||
self.list1 = [i for i in range(500)] | ||
self.list2 = [i for i in range(500, 1000)] | ||
|
||
def time_add_arr(self): | ||
""" | ||
Time the add_arr function with two lists of numbers. | ||
""" | ||
add_arr(self.list1, self.list2) | ||
from asv_runner.benchmarks.mark import SkipNotImplemented | ||
|
||
class MemrayBenchmarks: | ||
params = [10, int(2e4)] | ||
|
||
def ray_sum(self, n): | ||
try: | ||
import numpy as np | ||
except ImportError: | ||
raise SkipNotImplemented("Can't run without NumPy") | ||
self.data = np.random.rand(n) | ||
np.sum(self.data) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
[build-system] | ||
build-backend = "hatchling.build" | ||
requires = [ "hatch-vcs", "hatchling" ] | ||
|
||
[tool.hatch.build.hooks.vcs] | ||
version-file = "_version.py" | ||
|
||
[tool.hatch.build] | ||
include = [ "asv_samples/**/*.py", "asv_samples/*.py" ] | ||
|
||
[project] | ||
name = "asv_samples" | ||
version = "0.1.0" | ||
description = "A set of asv samples" | ||
authors = [ | ||
{name = "Rohit Goswami", email = "[email protected]"}, | ||
] | ||
license = {file = "LICENSE"} | ||
readme = "readme.md" | ||
|
||
[project.urls] | ||
repository = "https://github.com/HaoZeke/asv_samples" |