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

1.20-pre1 vs 1.20-pre2

benchmark 1.20-pre1 1.20-pre2
baseline 263.479460184556 ± 55.44590623221055 [ns/op] 262.6772200457718 ± 55.05785493224197 [ns/op]
data_get_byte 433.98316762350913 ± 7.444825260824145 [ns/op] 391.87628185594724 ± 18.936628742014072 [ns/op]
data_get_byte_1 740.4393732769925 ± 20.93953249166631 [ns/op] 456.17101920010447 ± 8.630503299692144 [ns/op]
data_get_int 412.08435852317024 ± 4.056129450233465 [ns/op] 374.34500487014526 ± 2.435684193080521 [ns/op]
data_get_int_1 737.7503310023358 ± 13.85836437954026 [ns/op] 423.18244626398047 ± 1.329924149473285 [ns/op]
data_get_list_0 406.8077717359254 ± 13.273700931499596 [ns/op] 380.8705782109833 ± 18.39461975718555 [ns/op]
data remove storage _ _
data modify storage _ _[] set value 0
data remove storage _ a
data remove storage _ b
function ite
@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
@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[]
@kennytv
kennytv / readme.md
Last active May 8, 2024 06:32
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

  • MinecraftServer::tickServer
    • ServerFunctionManager::tick
      • Run command functions
        • Trigger inventory_changed (loot, give, clear commands)
        • Trigger recipe_unlocked (recipe command)
        • Trigger effects_changed (effect command)
        • Trigger changed_dimension (teleport command)
    • ServerLevel::tick (per dimension)
      • ServerLevel::tickTime (overworld only)
  • Increment game time

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

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

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

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

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

1. 마크다운에 관하여

@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