Skip to content

Instantly share code, notes, and snippets.

View CandyMi's full-sized avatar

CandyMi CandyMi

View GitHub Profile
@CandyMi
CandyMi / uuid.c
Last active October 20, 2022 15:08
UUID 1-5 实现
/*
** LICENSE: BSD
** Author: CandyMi[https://github.com/candymi]
*/
#include "lcrypto.h"
#define GUID_LENGTH 35
int lguid(lua_State *L) {
const uint8_t* hash = (const uint8_t*)luaL_checkstring(L, 1);
message("======================================")
message("Project Name : HashMap")
message("Author Name : CandyMi")
message("Author Email : [email protected]")
message("Author Github : github.com/CandyMi")
message("======================================")
# 最低版本号
cmake_minimum_required(VERSION 2.8...3.13)
@CandyMi
CandyMi / coro.c
Created March 4, 2023 09:11
libcoro
/*
* Copyright (c) 2001-2011 Marc Alexander Lehmann <[email protected]>
*
* Redistribution and use in source and binary forms, with or without modifica-
* tion, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
@CandyMi
CandyMi / README.md
Last active June 1, 2023 02:54
js vs lua in fannkuch test case from https://sabotage-linux.neocities.org/blog/9/

测试 fannkuch

名称 指标
操作系统 Debian 11 (bullseye) GNU/Linux
CPU I5-10400 2.9GHz
MEM 32G(16x2) DDR3 2667MHZ

Lua 5.4.4

@CandyMi
CandyMi / README.md
Last active September 26, 2024 08:58
GPT4All Performance Benchmarks

GPT4All Performance Benchmarks

Model BoolQ PIQA HellaSwag WinoGrande ARC-e ARC-c OBQA Avg
GPT4All-J 6B v1.0 73.4 74.8 63.4 64.7 54.9 36 40.2 58.2
GPT4All-J v1.1-breezy 74 75.1 63.2 63.6 55.4 34.9 38.4 57.8
GPT4All-J v1.2-jazzy 74.8 74.9 63.6 63.8 56.6 35.3 41 58.6
GPT4All-J v1.3-groovy 73.6 74.3 63.8 63.5 57.7 35 38.8 58.1
GPT4All-J Lora 6B 68.6 75.8 66.2 63.5 56.4 35.7 40.2 58.1
GPT4All LLaMa Lora 7B 73.1 77.6 72.1 67.8 51.1 40.4 40.2 60.3
@CandyMi
CandyMi / README.md
Last active June 7, 2024 08:50
zlib vs lz4 vs snappy

测试描述

本次对比常用库包括:

  • zlib
  • lz4
  • snappy

压缩测试

@CandyMi
CandyMi / README.md
Last active December 8, 2023 03:47
json 测试代码

结果

json.encode 100 万次, 耗时: 0.766102
json.decode 100 万次, 耗时: 1.504399
@CandyMi
CandyMi / README.md
Last active December 8, 2023 03:47
AES GCM 与 CCM 测试用例
@CandyMi
CandyMi / README.md
Created October 24, 2023 09:16
Map vs Unordered_map

结果

c++ -o main main.cc -std=c++11 -O0 -g && ./main 
 ** Integer Keys ** 
 unordered:      250      74
   ordered:      475     238
 ** Random String Keys ** 
 unordered:      104      98
 ordered: 85 82
@CandyMi
CandyMi / README.md
Last active October 26, 2023 10:17
一些API的兼容实现

介绍

一些API的兼容实现