Skip to content

Instantly share code, notes, and snippets.

View QUAM-12's full-sized avatar
🏠
Working from home

QUAM12 QUAM-12

🏠
Working from home
View GitHub Profile
@hellerbarde
hellerbarde / latency.markdown
Created May 31, 2012 13:16 — forked from jboner/latency.txt
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs

@ihoneymon
ihoneymon / how-to-write-by-markdown.md
Last active December 2, 2024 05:55
마크다운(Markdown) 사용법

[공통] 마크다운 markdown 작성법

영어지만, 조금 더 상세하게 마크다운 사용법을 안내하고 있는
"Markdown Guide (https://www.markdownguide.org/)" 를 보시는 것을 추천합니다. ^^

아, 그리고 마크다운만으로 표현이 부족하다고 느끼신다면, HTML 태그를 활용하시는 것도 좋습니다.

1. 마크다운에 관하여

⚡ = Advancement trigger
✨ = Enchantment effect
▶️ = Commands run

  • MinecraftServer::tickServer
    • 🕑 Update /tick rate manager
    • ServerFunctionManager::tick
      • ▶️ Run #load function tag if a reload happened
      • ▶️ Run #tick function tag
    • ServerLevel::tick (per dimension)
tick
commandFunctions
minecraft:tick -> (Server)
minecraft:load -> (Server)
levels
$level
timeSync
tick
world border
weather
@tryashtar
tryashtar / selectors.md
Last active September 10, 2024 12:38
Code analysis of target selectors

Requirements

Selector arguments can optionally have two requirements: requiring only players, and requiring only a single target. Here are some examples of arguments of each type:

  • Only players: /give <targets>
  • Only a single target: /damage <target>
  • Only a single player: /xp query <targets>
  • Any number of any entities: /kill <targets>

As is well-known, each selector type has default "implicit" arguments. All behavior below will be described in terms of these arguments, not the base selectors themselves.

  • @p, @a, and @r have an implicit type=player, and will fail to parse if given a different type.
@kennytv
kennytv / readme.md
Last active September 7, 2024 18:09
Signed Chat and Chat Types

Signed chat

This gist intends on clearing up some of the misinformation surrounding signed chat/the reporting feature Mojang has added to Minecraft 1.19.1. Here you can find both technical information as well as a general explanation of how these work.

Profile keys

After joining a server, clients now send a profile key used for verifying a message's authenticity. This key and thus the whole signing process is optional, but by default, servers enforce secure profiles for clients to send chat messages. Whenever the player sends a chat message and has a key associated, the message will be signed using their own private key, which the server then verifies using the public key sent after join. Assuming signature, timestamp, and message contents line up, the message goes through.

On the other end, clients can also require all broadcasted player messages to be signed, disregarding the ones without sender verified signatures.

Message signatures

Minecraft commands benchmarks

Each test ranks a list of possible commands from best (most efficient) to worst (least efficient). Lower percentages are better. You can only compare the percentages between the commands in the same test.

These tests were done in a superflat world with no entities except for the player. The only commands running are the ones from the test.

1 Running commands for every player

1.1 All players

@intsuc
intsuc / .md
Created December 1, 2022 15:58

Benchmarks

  • init.mcfunction
    data modify storage 0 0 set value {a: [], b: 0}
    
    data modify storage 1 0 set value {a: [0, 0], b: 0}
    data modify storage 1 0.a append from storage 1 0.a[]
    data modify storage 1 0.a append from storage 1 0.a[]
    data modify storage 1 0.a append from storage 1 0.a[]
@intsuc
intsuc / .md
Created February 9, 2023 14:07

Benchmarks

  • summon-1.mcfunction
summon marker
kill @e
  • execute-1.mcfunction
execute summon marker run kill @e
data remove storage _ a
data remove storage _ b
function ite