Skip to content

Instantly share code, notes, and snippets.

View daramkun's full-sized avatar
🐿️

진재연(Jin Jae-yeon) daramkun

🐿️
View GitHub Profile
@daramkun
daramkun / receiver.cs
Created July 5, 2023 16:54
Ping with UDP
using System.Net;
using System.Net.Sockets;
using System.Runtime.InteropServices;
using Udping.Base;
var pingStructSizeOf = Marshal.SizeOf<PingStruct>();
var portStr = args.FirstOrDefault(arg => arg.StartsWith("--port=", StringComparison.OrdinalIgnoreCase)) ?? "--port=16789";
var port = short.Parse(portStr["--port=".Length..]);
#include <intrin.h>
#include <immintrin.h>
#include <emmintrin.h>
#include <cstdio>
#include <cstdint>
#include <cmath>
#include <cfloat>
#include <Windows.h>
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Text;
namespace FilePerformanceTest
{
class Program
{
@daramkun
daramkun / memcpy_perf_measure.cpp
Created July 3, 2019 15:17
Memory Copy Performance Measure (memcpy, ID3D11DeviceContext::CopyResource)
#include <Windows.h>
#include <d3d11.h>
#include <atlbase.h>
#pragma comment (lib, "d3d11.lib")
#include <iostream>
#include <thread>
#include <chrono>
#include <memory>
#include <vector>
#include <Windows.h>
#include <string>
#include <sstream>
float g_angle = 0;
LRESULT CALLBACK WndProc ( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam )
{
switch ( uMsg )
{
#include <Windows.h>
#include <cstdio>
#include <cstdint>
#define LOOP_REPEAT 10
#define LOOP_COUNT 48000 * 6
int main()
{
int8_t buffer1 [ LOOP_COUNT ];
#include <Windows.h>
#include <memory>
#include <mmintrin.h>
#include <immintrin.h>
#include <xmmintrin.h>
#include <functional>
#include <cstdio>
class HeapMemory
{
@daramkun
daramkun / ssetest.cpp
Last active October 16, 2017 06:43
SSE Operation Test
////////////////////////////////////////////////////////////////////////////////////////////////////
// Some Source code from https://gist.github.com/rygorous/4172889/3aff2b797b9be7ac261115a95f8d6f6fa32ed54d
//
// You need Intel Haswell Architecture(only Core-i & Xeon) or AMD Piledriver Architecture Processor.
// Because there is no FMA 3 operator in earlier than those.
////////////////////////////////////////////////////////////////////////////////////////////////////
#pragma optimize ( "", off )
#include <cstdio>
@daramkun
daramkun / xaudio2_streaming_with_mediafoundation.cpp
Created September 7, 2017 07:37
XAudio2 Streaming with MediaFoundation
#include <Windows.h>
#include <atlbase.h>
#include <vector>
#include <functional>
#include <mfapi.h>
#include <mfidl.h>
#include <mfreadwrite.h>
#include <mfplay.h>
@daramkun
daramkun / openal_streaming_with_mediafoundation.cpp
Last active September 6, 2017 18:41
OpenAL Streaming with MediaFoundation
#include <Windows.h>
#include <atlbase.h>
#include <vector>
#include <mfapi.h>
#include <mfidl.h>
#include <mfreadwrite.h>
#include <mfplay.h>
#include <mftransform.h>