/
mariadavydova
/
Coursework_2026
Обзор
Документация
Войти
/
mariadavydova
/
Coursework_2026
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
ruby_vs_python_comparison.html
145 строк
5 KB
mariadavydova
загрузка файлов
30 апр 2026, 20:42
Верифицирован
30 апр 2026, 20:42
af72564
Код
Авторство
О чём код?
<!DOCTYPE html> <html> <head> <title>Ruby vs Python - Сравнение производительности</title> <script src="https://cdn.jsdelivr.net/npm/chart.js"></script> <style> body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; margin: 0; padding: 20px; background: linear-gradient(135deg, #cc3333 0%, #ff6b6b 100%); min-height: 100vh; } .container { max-width: 1200px; margin: 0 auto; background: white; padding: 30px; border-radius: 15px; box-shadow: 0 10px 40px rgba(0,0,0,0.2); } h1, h2 { text-align: center; color: #333; } .chart-container { margin: 30px 0; } table { width: 100%; border-collapse: collapse; margin: 20px 0; } thead tr { background: linear-gradient(90deg, #cc3333 0%, #ff6b6b 100%); color: white; } th, td { padding: 12px; text-align: center; border-bottom: 1px solid #ddd; } .ruby { background-color: #ffebee; } .python { background-color: #e8f5e9; } .conclusion { background: #f8f9fa; padding: 20px; border-radius: 10px; margin-top: 30px; } </style> </head> <body> <div class="container"> <h1>💎 Ruby vs 🐍 Python</h1> <h2>Сравнение производительности слепой подписи RSA</h2> <table> <thead> <tr><th>Размер ключа</th><th>Python (мс)</th><th>Ruby (мс)</th><th>Ruby быстрее в</th></tr> </thead> <tbody> <tr class="ruby"><td>RSA-1024</td><td class="python">8.80</td><td>2.44</td><td><strong>3.6x</strong></td></tr> <tr class="ruby"><td>RSA-2048</td><td class="python">55.00</td><td>8.93</td><td><strong>6.2x</strong></td></tr> <tr class="ruby"><td>RSA-4096</td><td class="python">375.00</td><td>46.61</td><td><strong>8.0x</strong></td></tr> </tbody> </table> <div class="chart-container"> <canvas id="timeChart" width="800" height="400"></canvas> </div> <div class="chart-container"> <canvas id="speedChart" width="800" height="400"></canvas> </div> </div> <script> const ctx1 = document.getElementById('timeChart').getContext('2d'); new Chart(ctx1, { type: 'bar', data: { labels: ['RSA-1024', 'RSA-2048', 'RSA-4096'], datasets: [ { label: 'Python', data: [8.80, 55.00, 375.00], backgroundColor: '#4CAF50', borderRadius: 8 }, { label: 'Ruby', data: [2.44, 8.93, 46.61], backgroundColor: '#f44336', borderRadius: 8 } ] }, options: { responsive: true, scales: { y: { title: { display: true, text: 'Время (мс)' }, beginAtZero: true } }, plugins: { tooltip: { callbacks: { label: (ctx) => `${ctx.dataset.label}: ${ctx.raw} мс` } } } } }); const ctx2 = document.getElementById('speedChart').getContext('2d'); new Chart(ctx2, { type: 'bar', data: { labels: ['RSA-1024', 'RSA-2048', 'RSA-4096'], datasets: [ { label: 'Python (подписей/сек)', data: [114, 18, 2.7], backgroundColor: '#4CAF50', borderRadius: 8 }, { label: 'Ruby (подписей/сек)', data: [410, 112, 21.5], backgroundColor: '#f44336', borderRadius: 8 } ] }, options: { responsive: true, scales: { y: { title: { display: true, text: 'Подписей в секунду' }, beginAtZero: true } }, plugins: { tooltip: { callbacks: { label: (ctx) => `${ctx.dataset.label}: ${ctx.raw}/сек` } } } } }); </script> </body> </html>