Skip to content
This repository has been archived by the owner on Feb 3, 2025. It is now read-only.

Commit

Permalink
save
Browse files Browse the repository at this point in the history
  • Loading branch information
jcbhmr authored Jan 9, 2024
1 parent c3cafdf commit 754098d
Show file tree
Hide file tree
Showing 18 changed files with 1,889 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/deploy-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: deploy-pages
on:
push:
branches: "main"
paths-ignore:
- README.md
- CONTRIBUTING.md
- LICENSE
- .gitignore
- .github/**
- "!.github/workflows/deploy-pages.yml"
workflow_dispatch:
concurrency: ${{ github.workflow }}
jobs:
deploy-pages:
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deploy-pages.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20"
cache: npm
- run: npm ci
- id: configure-pages
uses: actions/configure-pages@v4
- run: npm run build
env:
BASE_URL: ${{ steps.configure-pages.outputs.base_url }}/
- uses: actions/upload-pages-artifact@v3
with:
path: .vitepress/dist
- id: deploy-pages
uses: actions/deploy-pages@v4
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# https://vitepress.dev/
**/.vitepress/dist
**/.vitepress/cache

#region https://github.com/github/gitignore/blob/main/Node.gitignore
# Logs
logs
*.log
Expand Down Expand Up @@ -128,3 +133,4 @@ dist
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
#endregion
27 changes: 27 additions & 0 deletions .vitepress/components/HomeContent.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<template>
<div class="vp-doc container">
<slot></slot>
</div>
</template>

<style scoped>
.container {
margin: auto;
width: 100%;
max-width: 1280px;
padding: 0 24px;
}
@media (min-width: 640px) {
.container {
padding: 0 48px;
}
}
@media (min-width: 960px) {
.container {
width: 100%;
padding: 0 64px;
}
}
</style>
28 changes: 28 additions & 0 deletions .vitepress/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { defineConfig } from "vitepress";

// https://vitepress.dev/reference/site-config
export default defineConfig({
title: "1BRC",
description: "1 Billion Row Challenge",
themeConfig: {
// https://vitepress.dev/reference/default-theme-config
nav: [
// { text: 'Home', link: '/' },
// { text: 'Examples', link: '/markdown-examples' }
],

sidebar: [
// {
// text: 'Examples',
// items: [
// { text: 'Markdown Examples', link: '/markdown-examples' },
// { text: 'Runtime API Examples', link: '/api-examples' }
// ]
// }
],

socialLinks: [
{ icon: "github", link: "https://github.com/1brc/1brc.github.io" },
],
},
});
17 changes: 17 additions & 0 deletions .vitepress/theme/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// https://vitepress.dev/guide/custom-theme
import { h } from 'vue'
import type { Theme } from 'vitepress'
import DefaultTheme from 'vitepress/theme'
import './style.css'

export default {
extends: DefaultTheme,
Layout: () => {
return h(DefaultTheme.Layout, null, {
// https://vitepress.dev/guide/extending-default-theme#layout-slots
})
},
enhanceApp({ app, router, siteData }) {
// ...
}
} satisfies Theme
138 changes: 138 additions & 0 deletions .vitepress/theme/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
/**
* Customize default theme styling by overriding CSS variables:
* https://github.com/vuejs/vitepress/blob/main/src/client/theme-default/styles/vars.css
*/

/**
* Colors
*
* Each colors have exact same color scale system with 3 levels of solid
* colors with different brightness, and 1 soft color.
*
* - `XXX-1`: The most solid color used mainly for colored text. It must
* satisfy the contrast ratio against when used on top of `XXX-soft`.
*
* - `XXX-2`: The color used mainly for hover state of the button.
*
* - `XXX-3`: The color for solid background, such as bg color of the button.
* It must satisfy the contrast ratio with pure white (#ffffff) text on
* top of it.
*
* - `XXX-soft`: The color used for subtle background such as custom container
* or badges. It must satisfy the contrast ratio when putting `XXX-1` colors
* on top of it.
*
* The soft color must be semi transparent alpha channel. This is crucial
* because it allows adding multiple "soft" colors on top of each other
* to create a accent, such as when having inline code block inside
* custom containers.
*
* - `default`: The color used purely for subtle indication without any
* special meanings attched to it such as bg color for menu hover state.
*
* - `brand`: Used for primary brand colors, such as link text, button with
* brand theme, etc.
*
* - `tip`: Used to indicate useful information. The default theme uses the
* brand color for this by default.
*
* - `warning`: Used to indicate warning to the users. Used in custom
* container, badges, etc.
*
* - `danger`: Used to show error, or dangerous message to the users. Used
* in custom container, badges, etc.
* -------------------------------------------------------------------------- */

:root {
--vp-c-default-1: var(--vp-c-gray-1);
--vp-c-default-2: var(--vp-c-gray-2);
--vp-c-default-3: var(--vp-c-gray-3);
--vp-c-default-soft: var(--vp-c-gray-soft);

--vp-c-brand-1: var(--vp-c-indigo-1);
--vp-c-brand-2: var(--vp-c-indigo-2);
--vp-c-brand-3: var(--vp-c-indigo-3);
--vp-c-brand-soft: var(--vp-c-indigo-soft);

--vp-c-tip-1: var(--vp-c-brand-1);
--vp-c-tip-2: var(--vp-c-brand-2);
--vp-c-tip-3: var(--vp-c-brand-3);
--vp-c-tip-soft: var(--vp-c-brand-soft);

--vp-c-warning-1: var(--vp-c-yellow-1);
--vp-c-warning-2: var(--vp-c-yellow-2);
--vp-c-warning-3: var(--vp-c-yellow-3);
--vp-c-warning-soft: var(--vp-c-yellow-soft);

--vp-c-danger-1: var(--vp-c-red-1);
--vp-c-danger-2: var(--vp-c-red-2);
--vp-c-danger-3: var(--vp-c-red-3);
--vp-c-danger-soft: var(--vp-c-red-soft);
}

/**
* Component: Button
* -------------------------------------------------------------------------- */

:root {
--vp-button-brand-border: transparent;
--vp-button-brand-text: var(--vp-c-white);
--vp-button-brand-bg: var(--vp-c-brand-3);
--vp-button-brand-hover-border: transparent;
--vp-button-brand-hover-text: var(--vp-c-white);
--vp-button-brand-hover-bg: var(--vp-c-brand-2);
--vp-button-brand-active-border: transparent;
--vp-button-brand-active-text: var(--vp-c-white);
--vp-button-brand-active-bg: var(--vp-c-brand-1);
}

/**
* Component: Home
* -------------------------------------------------------------------------- */

:root {
--vp-home-hero-name-color: transparent;
--vp-home-hero-name-background: -webkit-linear-gradient(
120deg,
#fe3434 50%,
#ff417a
);

--vp-home-hero-image-background-image: linear-gradient(
-45deg,
#fe7434 50%,
#ffb547 50%
);
--vp-home-hero-image-filter: blur(44px);
}

@media (min-width: 640px) {
:root {
--vp-home-hero-image-filter: blur(56px);
}
}

@media (min-width: 960px) {
:root {
--vp-home-hero-image-filter: blur(68px);
}
}

/**
* Component: Custom Block
* -------------------------------------------------------------------------- */

:root {
--vp-custom-block-tip-border: transparent;
--vp-custom-block-tip-text: var(--vp-c-text-1);
--vp-custom-block-tip-bg: var(--vp-c-brand-soft);
--vp-custom-block-tip-code-bg: var(--vp-c-brand-soft);
}

/**
* Component: Algolia
* -------------------------------------------------------------------------- */

.DocSearch {
--docsearch-primary-color: var(--vp-c-brand-1) !important;
}
Binary file added assets/c.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/go.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/hero.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/java.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/javascript.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/python.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/rust.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/zig.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
100 changes: 100 additions & 0 deletions index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
---
# https://vitepress.dev/reference/default-theme-home-page
layout: home

hero:
name: "1BRC"
text: "1 Billion Row Challenge"
tagline: Calculate the min, max, and average of <b>1 billion</b> measurements
image: ./assets/hero.png
actions:
- theme: brand
text: Choose a language πŸ‘‡
- theme: alt
text: Original blog post
link: https://www.morling.dev/blog/one-billion-row-challenge/

features:
- icon:
src: ./assets/java.png
title: 1BRC in Java
details: The original 1BRC language! πŸŽ‰
link: https://github.com/gunnarmorling/1brc#submitting
linkText: Submit your solution!
- icon:
src: ./assets/c.png
title: 1BRC in C/C++
details: Try your hand at processing 12 GB of text using low-level C code! ⚑
link: https://github.com/dannyvankooten/1brc#submitting
linkText: Submit your solution!
- icon:
src: ./assets/python.png
title: 1BRC in Python
details: Use the power of snakes to read 1 billion lines of text! 🐍
link: https://github.com/ifnesi/1brc#submitting
linkText: Submit your solution!
- icon:
src: ./assets/go.png
title: 1BRC in Go
details: Go get started to see if you can average 1B measurements in Go! 🐹
link: https://github.com/AlexanderYastrebov/1brc#submitting
linkText: Submit your solution!
- icon:
src: ./assets/javascript.png
title: 1BRC in JavaScript
details: Wrangle with the world's most popular programming language to process 1B rows! πŸ’»
link: https://github.com/Edgar-P-yan/1brc-nodejs-bun#submitting
linkText: Submit your solution!
- icon:
src: ./assets/rust.png
title: 1BRC in Rust
details: Embrace your inner iron crab and read a ginormous file in Rust! πŸ¦€
link: https://github.com/tumdum/1brc#submitting
linkText: Submit your solution!
- icon:
src: ./assets/zig.png
title: 1BRC in Zig
details: Use this new language to process 1B rows of text! 🧩
link: https://github.com/candrewlee14/1brc-zig#submitting
linkText: Submit your solution!
---

<script setup>
import HomeContent from './.vitepress/components/HomeContent.vue'
</script>

<style>
/* First action button has no action! Remove its button-like style. */
.VPHomeHero .actions .action:first-of-type .VPButton {
background-color: transparent;
}
</style>

<HomeContent>

<small>Don't see your favorite language listed above? [Open an Issue to add it!](https://github.com/1brc/1brc.github.io/issues/new)</small>

**πŸŽ‰ Open for submissions!** \
πŸ“† Challenge runs from **Jan 1, 2024** to **Jan 31, 2024**

Choose one of the languages listed above to see the language-specific leaderboard and instructions for submitting your solution to that language's repository.

## Global leaderboard

| | Time | Solution | Language | Author |
| --- | ---------: | ---------------------------------------------------------------------------------------------------------------------------- | -------- | -------------------------------------------------- |
| 1. | 6.159s | [link](https://github.com/gunnarmorling/1brc/blob/main/src/main/java/dev/morling/onebrc/CalculateAverage_royvanrijn.java) | [Java] | [royvanrijn](https://github.com/royvanrijn) |
| 2. | 6.532s | [link](https://github.com/gunnarmorling/1brc/blob/main/src/main/java/dev/morling/onebrc/CalculateAverage_thomaswue.java) | [Java] | [Thomas Wuerthinger](https://github.com/thomaswue) |
| 3. | 7.620s | [link](https://github.com/gunnarmorling/1brc/blob/main/src/main/java/dev/morling/onebrc/CalculateAverage_merykitty.java) | [Java] | [Quan Anh Mai](https://github.com/merykitty) |
| 4. | 9.062s | [link](https://github.com/gunnarmorling/1brc/blob/main/src/main/java/dev/morling/onebrc/CalculateAverage_obourgain.java) | [Java] | [obourgain](https://github.com/obourgain) |
| 5. | 9.338s | [link](https://github.com/gunnarmorling/1brc/blob/main/src/main/java/dev/morling/onebrc/CalculateAverage_ebarlas.java) | [Java] | [Elliot Barlas](https://github.com/ebarlas) |
| 6. | 10.589s | [link](https://github.com/gunnarmorling/1brc/blob/main/src/main/java/dev/morling/onebrc/CalculateAverage_artsiomkorzun.java) | [Java] | [Artsiom Korzun](https://github.com/artsiomkorzun) |
| 7. | 10.613s | [link](https://github.com/gunnarmorling/1brc/blob/main/src/main/java/dev/morling/onebrc/CalculateAverage_spullara.java) | [Java] | [Sam Pullara](https://github.com/spullara) |
| 8. | 11.038s | [link](https://github.com/gunnarmorling/1brc/blob/main/src/main/java/dev/morling/onebrc/CalculateAverage_asun.java) | [Java] | [Andrew Sun](https://github.com/as-com) |
| 9. | 11.222s | [link](https://github.com/gunnarmorling/1brc/blob/main/src/main/java/dev/morling/onebrc/CalculateAverage_isolgpus.java) | [Java] | [Jamie Stansfield](https://github.com/isolgpus) |
| 10. | 13.277s | [link](https://github.com/gunnarmorling/1brc/blob/main/src/main/java/dev/morling/onebrc/CalculateAverage_yavuztas.java) | [Java] | [Yavuz Tas](https://github.com/yavuztas) |
| | 4m 13.449s | [link](https://github.com/gunnarmorling/onebrc/blob/main/src/main/java/dev/morling/onebrc/CalculateAverage.java) | [Java] | _Reference implementation_ |

[Java]: https://github.com/gunnarmorling/1brc

</HomeContent>
Loading

0 comments on commit 754098d

Please sign in to comment.