Skip to content

Commit

Permalink
added benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
venthur committed Oct 29, 2024
1 parent c4f3c09 commit a3da95e
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions tests/benchmark.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import os

import blag
from blag.blag import build


def test_performance(args) -> None:
# create 1000 random markdown files in the content directory
with open(os.path.join(blag.__path__[0], "content", "testpage.md")) as fh:
markdown = fh.read()
for i in range(10000):
with open(f"content/{i}.md", "w") as f:
f.write(markdown)
f.write(str(i))

from time import time

t = time()
build(args)
print(time() - t)

import cProfile

t = time()
#cProfile.run("build(args)")
build(args)
print(time() - t)


1 / 0

0 comments on commit a3da95e

Please sign in to comment.