Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
gm_strategy_cvr
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
rank
gm_strategy_cvr
Commits
30c48f55
Commit
30c48f55
authored
Jul 21, 2020
by
赵威
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update timer
parent
e9340e07
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
5 deletions
+0
-5
main.py
src/main.py
+0
-5
No files found.
src/main.py
View file @
30c48f55
...
...
@@ -85,7 +85,6 @@ def main():
device_ids
=
list
(
redis_device_df
[
"device_id"
]
.
values
)[:
20
]
diary_ids
=
list
(
redis_diary_df
[
"card_id"
]
.
values
)
@time_cost
def
test1
():
time_1
=
timeit
.
default_timer
()
user1
=
join_device_diary
(
random
.
sample
(
device_ids
,
1
)[
0
],
random
.
sample
(
diary_ids
,
300
),
redis_device_df
,
redis_diary_df
)
...
...
@@ -97,7 +96,6 @@ def main():
total_1
=
(
timeit
.
default_timer
()
-
time_1
)
print
(
"total prediction cost {:.5f}s"
.
format
(
total_1
))
@time_cost
def
test2
():
time_1
=
timeit
.
default_timer
()
user1
=
join_device_diary
(
random
.
sample
(
device_ids
,
1
)[
0
],
random
.
sample
(
diary_ids
,
300
),
redis_device_df
,
redis_diary_df
)
...
...
@@ -109,7 +107,6 @@ def main():
total_1
=
(
timeit
.
default_timer
()
-
time_1
)
print
(
"total prediction cost {:.5f}s"
.
format
(
total_1
))
@time_cost
def
test3
():
time_1
=
timeit
.
default_timer
()
user1
=
join_device_diary
(
random
.
sample
(
device_ids
,
1
)[
0
],
random
.
sample
(
diary_ids
,
300
),
redis_device_df
,
redis_diary_df
)
...
...
@@ -121,7 +118,6 @@ def main():
total_1
=
(
timeit
.
default_timer
()
-
time_1
)
print
(
"total prediction cost {:.5f}s"
.
format
(
total_1
))
@time_cost
def
test4
():
time_1
=
timeit
.
default_timer
()
user1
=
join_device_diary
(
random
.
sample
(
device_ids
,
1
)[
0
],
random
.
sample
(
diary_ids
,
300
),
redis_device_df
,
redis_diary_df
)
...
...
@@ -133,7 +129,6 @@ def main():
total_1
=
(
timeit
.
default_timer
()
-
time_1
)
print
(
"total prediction cost {:.5f}s"
.
format
(
total_1
))
@time_cost
def
test5
():
time_1
=
timeit
.
default_timer
()
user1
=
join_device_diary
(
random
.
sample
(
device_ids
,
1
)[
0
],
random
.
sample
(
diary_ids
,
300
),
redis_device_df
,
redis_diary_df
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment