├── backend ├── app │ ├── __init__.py │ ├── routers │ │ ├── __init__.py │ │ ├── health.py │ │ ├── environments.py │ │ ├── public.py │ │ ├── commits.py │ │ └── binaries.py │ ├── main.py │ └── auth.py ├── scripts │ └── __init__.py ├── Procfile ├── requirements.txt ├── .dockerignore ├── Dockerfile.dev ├── Dockerfile └── .env.example ├── frontend ├── Procfile ├── src │ ├── app │ │ ├── favicon.ico │ │ ├── icon.svg │ │ └── layout.tsx │ ├── lib │ │ ├── utils.ts │ │ ├── constants.ts │ │ └── icons.ts │ ├── providers │ │ └── ThemeProvider.tsx │ ├── components │ │ ├── ui │ │ │ ├── collapsible.tsx │ │ │ ├── label.tsx │ │ │ ├── textarea.tsx │ │ │ ├── input.tsx │ │ │ ├── toaster.tsx │ │ │ ├── checkbox.tsx │ │ │ ├── slider.tsx │ │ │ ├── badge.tsx │ │ │ ├── tooltip.tsx │ │ │ ├── alert.tsx │ │ │ ├── scroll-area.tsx │ │ │ ├── tabs.tsx │ │ │ ├── button.tsx │ │ │ ├── card.tsx │ │ │ ├── dropdown-menu.tsx │ │ │ └── table.tsx │ │ └── diff │ │ │ └── CommitTooltipContent.tsx │ ├── hooks │ │ ├── useDebounce.ts │ │ ├── use-memray-status.ts │ │ └── useChartData.ts │ └── types │ │ └── components.ts ├── public │ └── memray-logo.png ├── scripts │ └── start-frontend ├── .prettierrc ├── postcss.config.mjs ├── .dockerignore ├── .eslintrc.json ├── components.json ├── next.config.ts ├── tsconfig.json ├── package.json ├── docs │ └── blueprint.md └── Dockerfile ├── worker ├── src │ └── memory_tracker_worker │ │ ├── benchmarks │ │ ├── telco_data │ │ │ └── telco-bench.b │ │ ├── list_operations.py │ │ ├── pprint_format_base.py │ │ ├── json_dumps_base.py │ │ ├── fannkuch_base.py │ │ ├── sqlite_synth_base.py │ │ ├── spectral_norm_base.py │ │ ├── nqueens_base.py │ │ ├── telco_base.py │ │ └── json_loads_base.py │ │ ├── cli.py │ │ └── validation.py ├── pyproject.toml └── README.md ├── benchmark_results ├── 13cac833471885564cbfde72a4cbac64ade3137a │ ├── dict_operations.bin │ ├── list_operations.bin │ ├── string_operations.bin │ ├── dict_operations_stats.json │ ├── list_operations_stats.json │ └── string_operations_stats.json ├── 3fb6cfe7a95081e6775ad2dca845713a3ea4c799 │ ├── dict_operations.bin │ ├── list_operations.bin │ ├── string_operations.bin │ ├── dict_operations_stats.json │ ├── list_operations_stats.json │ └── string_operations_stats.json ├── 4ddf505d9982dc8afead8f52f5754eea5ebde623 │ ├── dict_operations.bin │ ├── list_operations.bin │ ├── string_operations.bin │ ├── dict_operations_stats.json │ ├── list_operations_stats.json │ └── string_operations_stats.json ├── 6a16b3c440cf9ecabecd3e90f44310e3b0765780 │ ├── dict_operations.bin │ ├── list_operations.bin │ ├── string_operations.bin │ ├── list_operations_stats.json │ ├── dict_operations_stats.json │ └── string_operations_stats.json ├── 7c4361564c3881946a5eca677607b4ffec0a566d │ ├── dict_operations.bin │ ├── list_operations.bin │ ├── string_operations.bin │ ├── dict_operations_stats.json │ ├── list_operations_stats.json │ └── string_operations_stats.json ├── 8ca1e4d846e868a20834cf442c48a3648b558bbe │ ├── dict_operations.bin │ ├── list_operations.bin │ ├── string_operations.bin │ ├── dict_operations_stats.json │ ├── list_operations_stats.json │ └── string_operations_stats.json ├── a8ec511900d0d84cffbb4ee6419c9a790d131129 │ ├── dict_operations.bin │ ├── list_operations.bin │ ├── string_operations.bin │ ├── dict_operations_stats.json │ ├── list_operations_stats.json │ └── string_operations_stats.json ├── c5ea8e8e8fc725f39ed23ff6259b3cc157a0785f │ ├── dict_operations.bin │ ├── list_operations.bin │ ├── string_operations.bin │ ├── dict_operations_stats.json │ ├── list_operations_stats.json │ └── string_operations_stats.json ├── d08b4b2333d28403633f9ceb86a3a5fab011d8a1 │ ├── dict_operations.bin │ ├── list_operations.bin │ ├── string_operations.bin │ ├── dict_operations_stats.json │ ├── list_operations_stats.json │ └── string_operations_stats.json └── f4911258a80409cb641f13578137475204ab43b5 │ ├── dict_operations.bin │ ├── list_operations.bin │ ├── string_operations.bin │ ├── list_operations_stats.json │ ├── dict_operations_stats.json │ └── string_operations_stats.json ├── .github └── workflows │ └── ci.yml ├── LICENSE ├── .gitignore ├── docker-compose.yml ├── docker-compose.dev.yml ├── Makefile └── .env.example /backend/app/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /backend/scripts/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /backend/app/routers/__init__.py: -------------------------------------------------------------------------------- 1 | # Routers module for the Memory Tracker API 2 | -------------------------------------------------------------------------------- /frontend/Procfile: -------------------------------------------------------------------------------- 1 | web: ./scripts/start-frontend 2 | release: echo 'doin deploy things' 3 | -------------------------------------------------------------------------------- /frontend/src/app/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/python/memory.python.org/main/frontend/src/app/favicon.ico -------------------------------------------------------------------------------- /frontend/public/memray-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/python/memory.python.org/main/frontend/public/memray-logo.png -------------------------------------------------------------------------------- /backend/Procfile: -------------------------------------------------------------------------------- 1 | web: python -m uvicorn app.main:app --uds /var/run/cabotage/cabotage.sock 2 | release: echo 'doin deploy things' 3 | -------------------------------------------------------------------------------- /frontend/scripts/start-frontend: -------------------------------------------------------------------------------- 1 | #!/usr/bin/dumb-init /bin/sh 2 | 3 | socat UNIX-LISTEN:/var/run/cabotage/cabotage.sock,fork TCP:127.0.0.1:3000 & 4 | node server.js 5 | -------------------------------------------------------------------------------- /frontend/.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "semi": true, 3 | "trailingComma": "es5", 4 | "singleQuote": true, 5 | "printWidth": 80, 6 | "tabWidth": 2, 7 | "useTabs": false 8 | } -------------------------------------------------------------------------------- /frontend/postcss.config.mjs: -------------------------------------------------------------------------------- 1 | /** @type {import('postcss-load-config').Config} */ 2 | const config = { 3 | plugins: { 4 | tailwindcss: {}, 5 | }, 6 | }; 7 | 8 | export default config; 9 | -------------------------------------------------------------------------------- /worker/src/memory_tracker_worker/benchmarks/telco_data/telco-bench.b: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/python/memory.python.org/main/worker/src/memory_tracker_worker/benchmarks/telco_data/telco-bench.b -------------------------------------------------------------------------------- /benchmark_results/13cac833471885564cbfde72a4cbac64ade3137a/dict_operations.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/python/memory.python.org/main/benchmark_results/13cac833471885564cbfde72a4cbac64ade3137a/dict_operations.bin -------------------------------------------------------------------------------- /benchmark_results/13cac833471885564cbfde72a4cbac64ade3137a/list_operations.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/python/memory.python.org/main/benchmark_results/13cac833471885564cbfde72a4cbac64ade3137a/list_operations.bin -------------------------------------------------------------------------------- /benchmark_results/3fb6cfe7a95081e6775ad2dca845713a3ea4c799/dict_operations.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/python/memory.python.org/main/benchmark_results/3fb6cfe7a95081e6775ad2dca845713a3ea4c799/dict_operations.bin -------------------------------------------------------------------------------- /benchmark_results/3fb6cfe7a95081e6775ad2dca845713a3ea4c799/list_operations.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/python/memory.python.org/main/benchmark_results/3fb6cfe7a95081e6775ad2dca845713a3ea4c799/list_operations.bin -------------------------------------------------------------------------------- /benchmark_results/4ddf505d9982dc8afead8f52f5754eea5ebde623/dict_operations.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/python/memory.python.org/main/benchmark_results/4ddf505d9982dc8afead8f52f5754eea5ebde623/dict_operations.bin -------------------------------------------------------------------------------- /benchmark_results/4ddf505d9982dc8afead8f52f5754eea5ebde623/list_operations.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/python/memory.python.org/main/benchmark_results/4ddf505d9982dc8afead8f52f5754eea5ebde623/list_operations.bin -------------------------------------------------------------------------------- /benchmark_results/6a16b3c440cf9ecabecd3e90f44310e3b0765780/dict_operations.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/python/memory.python.org/main/benchmark_results/6a16b3c440cf9ecabecd3e90f44310e3b0765780/dict_operations.bin -------------------------------------------------------------------------------- /benchmark_results/6a16b3c440cf9ecabecd3e90f44310e3b0765780/list_operations.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/python/memory.python.org/main/benchmark_results/6a16b3c440cf9ecabecd3e90f44310e3b0765780/list_operations.bin -------------------------------------------------------------------------------- /benchmark_results/7c4361564c3881946a5eca677607b4ffec0a566d/dict_operations.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/python/memory.python.org/main/benchmark_results/7c4361564c3881946a5eca677607b4ffec0a566d/dict_operations.bin -------------------------------------------------------------------------------- /benchmark_results/7c4361564c3881946a5eca677607b4ffec0a566d/list_operations.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/python/memory.python.org/main/benchmark_results/7c4361564c3881946a5eca677607b4ffec0a566d/list_operations.bin -------------------------------------------------------------------------------- /benchmark_results/8ca1e4d846e868a20834cf442c48a3648b558bbe/dict_operations.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/python/memory.python.org/main/benchmark_results/8ca1e4d846e868a20834cf442c48a3648b558bbe/dict_operations.bin -------------------------------------------------------------------------------- /benchmark_results/8ca1e4d846e868a20834cf442c48a3648b558bbe/list_operations.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/python/memory.python.org/main/benchmark_results/8ca1e4d846e868a20834cf442c48a3648b558bbe/list_operations.bin -------------------------------------------------------------------------------- /benchmark_results/a8ec511900d0d84cffbb4ee6419c9a790d131129/dict_operations.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/python/memory.python.org/main/benchmark_results/a8ec511900d0d84cffbb4ee6419c9a790d131129/dict_operations.bin -------------------------------------------------------------------------------- /benchmark_results/a8ec511900d0d84cffbb4ee6419c9a790d131129/list_operations.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/python/memory.python.org/main/benchmark_results/a8ec511900d0d84cffbb4ee6419c9a790d131129/list_operations.bin -------------------------------------------------------------------------------- /benchmark_results/c5ea8e8e8fc725f39ed23ff6259b3cc157a0785f/dict_operations.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/python/memory.python.org/main/benchmark_results/c5ea8e8e8fc725f39ed23ff6259b3cc157a0785f/dict_operations.bin -------------------------------------------------------------------------------- /benchmark_results/c5ea8e8e8fc725f39ed23ff6259b3cc157a0785f/list_operations.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/python/memory.python.org/main/benchmark_results/c5ea8e8e8fc725f39ed23ff6259b3cc157a0785f/list_operations.bin -------------------------------------------------------------------------------- /benchmark_results/d08b4b2333d28403633f9ceb86a3a5fab011d8a1/dict_operations.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/python/memory.python.org/main/benchmark_results/d08b4b2333d28403633f9ceb86a3a5fab011d8a1/dict_operations.bin -------------------------------------------------------------------------------- /benchmark_results/d08b4b2333d28403633f9ceb86a3a5fab011d8a1/list_operations.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/python/memory.python.org/main/benchmark_results/d08b4b2333d28403633f9ceb86a3a5fab011d8a1/list_operations.bin -------------------------------------------------------------------------------- /benchmark_results/f4911258a80409cb641f13578137475204ab43b5/dict_operations.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/python/memory.python.org/main/benchmark_results/f4911258a80409cb641f13578137475204ab43b5/dict_operations.bin -------------------------------------------------------------------------------- /benchmark_results/f4911258a80409cb641f13578137475204ab43b5/list_operations.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/python/memory.python.org/main/benchmark_results/f4911258a80409cb641f13578137475204ab43b5/list_operations.bin -------------------------------------------------------------------------------- /frontend/src/lib/utils.ts: -------------------------------------------------------------------------------- 1 | import { type ClassValue, clsx } from 'clsx'; 2 | import { twMerge } from 'tailwind-merge'; 3 | 4 | export function cn(...inputs: ClassValue[]) { 5 | return twMerge(clsx(inputs)); 6 | } 7 | -------------------------------------------------------------------------------- /benchmark_results/13cac833471885564cbfde72a4cbac64ade3137a/string_operations.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/python/memory.python.org/main/benchmark_results/13cac833471885564cbfde72a4cbac64ade3137a/string_operations.bin -------------------------------------------------------------------------------- /benchmark_results/3fb6cfe7a95081e6775ad2dca845713a3ea4c799/string_operations.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/python/memory.python.org/main/benchmark_results/3fb6cfe7a95081e6775ad2dca845713a3ea4c799/string_operations.bin -------------------------------------------------------------------------------- /benchmark_results/4ddf505d9982dc8afead8f52f5754eea5ebde623/string_operations.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/python/memory.python.org/main/benchmark_results/4ddf505d9982dc8afead8f52f5754eea5ebde623/string_operations.bin -------------------------------------------------------------------------------- /benchmark_results/6a16b3c440cf9ecabecd3e90f44310e3b0765780/string_operations.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/python/memory.python.org/main/benchmark_results/6a16b3c440cf9ecabecd3e90f44310e3b0765780/string_operations.bin -------------------------------------------------------------------------------- /benchmark_results/7c4361564c3881946a5eca677607b4ffec0a566d/string_operations.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/python/memory.python.org/main/benchmark_results/7c4361564c3881946a5eca677607b4ffec0a566d/string_operations.bin -------------------------------------------------------------------------------- /benchmark_results/8ca1e4d846e868a20834cf442c48a3648b558bbe/string_operations.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/python/memory.python.org/main/benchmark_results/8ca1e4d846e868a20834cf442c48a3648b558bbe/string_operations.bin -------------------------------------------------------------------------------- /benchmark_results/a8ec511900d0d84cffbb4ee6419c9a790d131129/string_operations.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/python/memory.python.org/main/benchmark_results/a8ec511900d0d84cffbb4ee6419c9a790d131129/string_operations.bin -------------------------------------------------------------------------------- /benchmark_results/c5ea8e8e8fc725f39ed23ff6259b3cc157a0785f/string_operations.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/python/memory.python.org/main/benchmark_results/c5ea8e8e8fc725f39ed23ff6259b3cc157a0785f/string_operations.bin -------------------------------------------------------------------------------- /benchmark_results/d08b4b2333d28403633f9ceb86a3a5fab011d8a1/string_operations.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/python/memory.python.org/main/benchmark_results/d08b4b2333d28403633f9ceb86a3a5fab011d8a1/string_operations.bin -------------------------------------------------------------------------------- /benchmark_results/f4911258a80409cb641f13578137475204ab43b5/string_operations.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/python/memory.python.org/main/benchmark_results/f4911258a80409cb641f13578137475204ab43b5/string_operations.bin -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: Dummy-CI 2 | 3 | on: [push] 4 | 5 | jobs: 6 | build: 7 | runs-on: ubuntu-latest 8 | steps: 9 | - uses: actions/checkout@v1 10 | - name: Pass 11 | run: echo Success! 12 | -------------------------------------------------------------------------------- /frontend/.dockerignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | .next/ 3 | .git/ 4 | .gitignore 5 | README.md 6 | Dockerfile 7 | .dockerignore 8 | npm-debug.log* 9 | yarn-debug.log* 10 | yarn-error.log* 11 | .env*.local 12 | coverage/ 13 | .nyc_output 14 | .DS_Store 15 | *.tsbuildinfo -------------------------------------------------------------------------------- /backend/requirements.txt: -------------------------------------------------------------------------------- 1 | fastapi==0.104.1 2 | uvicorn[standard]==0.24.0 3 | pydantic 4 | pydantic-settings 5 | sqlalchemy 6 | aiosqlite 7 | asyncpg 8 | python-multipart 9 | python-dateutil 10 | pytest 11 | pytest-asyncio 12 | httpx 13 | authlib>=1.2.0 14 | sqlparse 15 | -------------------------------------------------------------------------------- /frontend/src/app/icon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /backend/.dockerignore: -------------------------------------------------------------------------------- 1 | __pycache__/ 2 | *.pyc 3 | *.pyo 4 | *.pyd 5 | .Python 6 | *.so 7 | .pytest_cache/ 8 | .coverage 9 | htmlcov/ 10 | .env 11 | .venv 12 | env/ 13 | venv/ 14 | ENV/ 15 | .git/ 16 | .gitignore 17 | README.md 18 | Dockerfile 19 | .dockerignore 20 | memory_tracker.db 21 | memory_trackers.db 22 | output/ 23 | tests/ -------------------------------------------------------------------------------- /frontend/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": [ 3 | "next/core-web-vitals", 4 | "next/typescript" 5 | ], 6 | "rules": { 7 | "@typescript-eslint/no-unused-vars": ["error", { "argsIgnorePattern": "^_" }], 8 | "@typescript-eslint/no-explicit-any": "warn", 9 | "prefer-const": "error", 10 | "no-var": "error" 11 | } 12 | } -------------------------------------------------------------------------------- /frontend/src/providers/ThemeProvider.tsx: -------------------------------------------------------------------------------- 1 | 'use client'; 2 | 3 | import * as React from 'react'; 4 | import { ThemeProvider as NextThemesProvider } from 'next-themes'; 5 | import type { ThemeProviderProps } from 'next-themes/dist/types'; 6 | 7 | export function ThemeProvider({ children, ...props }: ThemeProviderProps) { 8 | return {children}; 9 | } 10 | -------------------------------------------------------------------------------- /frontend/src/components/ui/collapsible.tsx: -------------------------------------------------------------------------------- 1 | 'use client'; 2 | 3 | import * as React from 'react'; 4 | import * as CollapsiblePrimitive from '@radix-ui/react-collapsible'; 5 | 6 | const Collapsible = CollapsiblePrimitive.Root; 7 | 8 | const CollapsibleTrigger = CollapsiblePrimitive.CollapsibleTrigger; 9 | 10 | const CollapsibleContent = CollapsiblePrimitive.CollapsibleContent; 11 | 12 | export { Collapsible, CollapsibleTrigger, CollapsibleContent }; 13 | -------------------------------------------------------------------------------- /frontend/src/hooks/useDebounce.ts: -------------------------------------------------------------------------------- 1 | 'use client'; 2 | 3 | import { useState, useEffect } from 'react'; 4 | 5 | export function useDebounce(value: T, delay: number): T { 6 | const [debouncedValue, setDebouncedValue] = useState(value); 7 | 8 | useEffect(() => { 9 | const handler = setTimeout(() => { 10 | setDebouncedValue(value); 11 | }, delay); 12 | 13 | return () => { 14 | clearTimeout(handler); 15 | }; 16 | }, [value, delay]); 17 | 18 | return debouncedValue; 19 | } 20 | -------------------------------------------------------------------------------- /worker/src/memory_tracker_worker/cli.py: -------------------------------------------------------------------------------- 1 | """Main CLI entry point.""" 2 | 3 | import sys 4 | from .args import parse_args 5 | 6 | 7 | def main(): 8 | """Main entry point for the CLI.""" 9 | args = parse_args() 10 | 11 | # Check if a command was provided 12 | if not hasattr(args, "func"): 13 | print("Error: No command specified. Use --help for usage information.") 14 | sys.exit(1) 15 | 16 | # Execute the command function 17 | args.func(args) 18 | 19 | 20 | if __name__ == "__main__": 21 | main() 22 | -------------------------------------------------------------------------------- /frontend/components.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://ui.shadcn.com/schema.json", 3 | "style": "default", 4 | "rsc": true, 5 | "tsx": true, 6 | "tailwind": { 7 | "config": "tailwind.config.ts", 8 | "css": "src/app/globals.css", 9 | "baseColor": "neutral", 10 | "cssVariables": true, 11 | "prefix": "" 12 | }, 13 | "aliases": { 14 | "components": "@/components", 15 | "utils": "@/lib/utils", 16 | "ui": "@/components/ui", 17 | "lib": "@/lib", 18 | "hooks": "@/hooks" 19 | }, 20 | "iconLibrary": "lucide" 21 | } -------------------------------------------------------------------------------- /worker/src/memory_tracker_worker/benchmarks/list_operations.py: -------------------------------------------------------------------------------- 1 | """Benchmark for list operations.""" 2 | 3 | 4 | def main(): 5 | # Create a large list 6 | lst = [] 7 | for i in range(1_000_000): 8 | lst.append(i) 9 | 10 | # List comprehension 11 | squares = [x * x for x in lst] 12 | 13 | # List filtering 14 | evens = [x for x in lst if x % 2 == 0] 15 | 16 | # List sorting 17 | lst.sort() 18 | 19 | # List slicing 20 | middle = lst[len(lst) // 2 : len(lst) // 2 + 1000] 21 | 22 | 23 | if __name__ == "__main__": 24 | main() 25 | -------------------------------------------------------------------------------- /backend/Dockerfile.dev: -------------------------------------------------------------------------------- 1 | FROM python:3.11-slim 2 | 3 | WORKDIR /app 4 | 5 | # Install system dependencies 6 | RUN apt-get update && apt-get install -y \ 7 | gcc \ 8 | && rm -rf /var/lib/apt/lists/* 9 | 10 | COPY requirements.txt . 11 | 12 | # Install Python dependencies 13 | RUN pip install --no-cache-dir -r requirements.txt 14 | 15 | # The source code will be mounted as a volume, so we don't copy it here 16 | 17 | # Expose port 18 | EXPOSE 8000 19 | 20 | # Default command (can be overridden in docker-compose) 21 | CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000", "--reload"] -------------------------------------------------------------------------------- /worker/src/memory_tracker_worker/benchmarks/pprint_format_base.py: -------------------------------------------------------------------------------- 1 | """Test the performance of pprint.PrettyPrinter. 2 | 3 | This benchmark was available as `python -m pprint` until Python 3.12. 4 | 5 | Authors: Fred Drake (original), Oleg Iarygin (pyperformance port). 6 | """ 7 | 8 | from pprint import PrettyPrinter 9 | 10 | printable = [("string", (1, 2), [3, 4], {5: 6, 7: 8})] * 100_000 11 | p = PrettyPrinter() 12 | 13 | 14 | def run_benchmark(): 15 | if hasattr(p, "_safe_repr"): 16 | p._safe_repr(printable, {}, None, 0) 17 | p.pformat(printable) 18 | 19 | 20 | if __name__ == "__main__": 21 | run_benchmark() 22 | -------------------------------------------------------------------------------- /frontend/next.config.ts: -------------------------------------------------------------------------------- 1 | import type {NextConfig} from 'next'; 2 | 3 | const nextConfig: NextConfig = { 4 | /* config options here */ 5 | typescript: { 6 | ignoreBuildErrors: true, 7 | }, 8 | eslint: { 9 | ignoreDuringBuilds: true, 10 | }, 11 | images: { 12 | unoptimized: true, 13 | remotePatterns: [ 14 | { 15 | protocol: 'https', 16 | hostname: 'placehold.co', 17 | port: '', 18 | pathname: '/**', 19 | }, 20 | { 21 | protocol: 'https', 22 | hostname: 'github.com', 23 | port: '', 24 | pathname: '/**', 25 | }, 26 | ], 27 | }, 28 | output: 'standalone', 29 | }; 30 | 31 | export default nextConfig; 32 | -------------------------------------------------------------------------------- /frontend/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ES2017", 4 | "lib": ["dom", "dom.iterable", "esnext"], 5 | "allowJs": true, 6 | "skipLibCheck": true, 7 | "strict": true, 8 | "noEmit": true, 9 | "esModuleInterop": true, 10 | "module": "esnext", 11 | "moduleResolution": "bundler", 12 | "resolveJsonModule": true, 13 | "isolatedModules": true, 14 | "jsx": "preserve", 15 | "incremental": true, 16 | "plugins": [ 17 | { 18 | "name": "next" 19 | } 20 | ], 21 | "paths": { 22 | "@/*": ["./src/*"] 23 | } 24 | }, 25 | "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"], 26 | "exclude": ["node_modules"] 27 | } 28 | -------------------------------------------------------------------------------- /frontend/src/components/ui/label.tsx: -------------------------------------------------------------------------------- 1 | 'use client'; 2 | 3 | import * as React from 'react'; 4 | import * as LabelPrimitive from '@radix-ui/react-label'; 5 | import { cva, type VariantProps } from 'class-variance-authority'; 6 | 7 | import { cn } from '@/lib/utils'; 8 | 9 | const labelVariants = cva( 10 | 'text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70' 11 | ); 12 | 13 | const Label = React.forwardRef< 14 | React.ElementRef, 15 | React.ComponentPropsWithoutRef & 16 | VariantProps 17 | >(({ className, ...props }, ref) => ( 18 | 23 | )); 24 | Label.displayName = LabelPrimitive.Root.displayName; 25 | 26 | export { Label }; 27 | -------------------------------------------------------------------------------- /worker/pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["hatchling"] 3 | build-backend = "hatchling.build" 4 | 5 | [project] 6 | name = "memory-tracker-worker" 7 | version = "0.1.0" 8 | description = "A tool to run memory benchmarks on CPython commits" 9 | readme = "README.md" 10 | requires-python = ">=3.8" 11 | license = "MIT" 12 | authors = [ 13 | { name = "Your Name", email = "your.email@example.com" } 14 | ] 15 | dependencies = [ 16 | "click>=8.0.0", 17 | "memray>=1.0.0", 18 | "gitpython>=3.1.0", 19 | "rich>=10.0.0", 20 | "pyyaml>=6.0.0", 21 | "requests>=2.25.0", 22 | ] 23 | 24 | [project.scripts] 25 | memory-tracker = "memory_tracker_worker.cli:main" 26 | 27 | [tool.hatch.build.targets.wheel] 28 | packages = ["src/memory_tracker_worker"] 29 | 30 | [tool.pytest.ini_options] 31 | testpaths = ["tests"] 32 | python_files = ["test_*.py"] 33 | addopts = "-ra -q" 34 | -------------------------------------------------------------------------------- /frontend/src/components/ui/textarea.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | 3 | import { cn } from '@/lib/utils'; 4 | 5 | export interface TextareaProps 6 | extends React.TextareaHTMLAttributes {} 7 | 8 | const Textarea = React.forwardRef( 9 | ({ className, ...props }, ref) => { 10 | return ( 11 |