Skip to content

Instantly share code, notes, and snippets.

View serkan-ozal's full-sized avatar

Serkan ÖZAL serkan-ozal

View GitHub Profile
Algorithm / OS Ubuntu Window MacOS
Dot Product 750,622.625 ops/s 760,163.774 ops/s 961,366.490 ops/s
Cosine Similarity 586,113.920 ops/s 705,148.739 ops/s 892,124.358 ops/s
Manhattan Distance 793,538.457 ops/s 717,150.911 ops/s 1,156,442.603 ops/s
Euclidean Distance 760,819.826 ops/s 748,286.320 ops/s 1,012,210.232 ops/s
Runtime JDK 21, Java HotSpot(TM) 64-Bit Server VM, 21+35-LTS-2513
Benchmark tool JMH (version 1.37)
Benchmark mode Throughput, ops/time
Warmup iteration 3
Warmup time 5 seconds (for each warmup iteration)
Measurement iteration 10
Measurement time 30 seconds (for each measurement iteration)
Vector length 1000
Runner OS Processor (CPU) Memory (RAM)
ubuntu-latest Ubuntu - 22.04 Model: Intel Xeon E5-2673 v4 @ 2.30GHz # of cores: 2 7 GB
windows-latest Windows - 2022 Model: Xeon® Platinum 8272CL # of cores: 2 7 GB
macos-latest MacOS - 12 Model: Intel Xeon E5-1650 v2 @ 3.50GHz # of cores: 3 14 GB
Runner OS Processor (CPU) Memory (RAM)
ubuntu-latest Ubuntu - 22.04 - Model: Intel Xeon E5-2673 v4 @ 2.30GHz
- # of cores: 2
7 GB
windows-latest Windows - 2022 - Model: Xeon® Platinum 8272CL
- # of cores: 2
7 GB
macos-latest MacOS - 12 - Model: Intel Xeon E5-1650 v2 @ 3.50GHz
- # of cores: 3
14 GB
const AWS = require('aws-sdk');
const dynamodb = new AWS.DynamoDB();
exports.hello = async (event, context) => {
const promises = [];
for (let i = 0; i < 1000; i++) {
const params = {
TableName: 'books',
Item: {
'id': {S: i.toString()},
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonStreamContext;
import com.fasterxml.jackson.databind.*;
import com.fasterxml.jackson.databind.module.SimpleModule;
import com.fasterxml.jackson.databind.ser.BeanSerializerModifier;
import com.fasterxml.jackson.databind.ser.PropertyWriter;
import com.fasterxml.jackson.databind.ser.impl.SimpleBeanPropertyFilter;
import com.fasterxml.jackson.databind.ser.impl.SimpleFilterProvider;
import com.fasterxml.jackson.databind.type.*;

How to setup AWS lambda function to talk to the internet and VPC

I'm going to walk you through the steps for setting up a AWS Lambda to talk to the internet and a VPC. Let's dive in.

So it might be really unintuitive at first but lambda functions have three states.

  1. No VPC, where it can talk openly to the web, but can't talk to any of your AWS services.
  2. VPC, the default setting where the lambda function can talk to your AWS services but can't talk to the web.
  3. VPC with NAT, The best of both worlds, AWS services and web.
@serkan-ozal
serkan-ozal / TransformableClassLoaderWhisperer.java
Created July 12, 2017 04:43
TransformableClassLoaderWhisperer - Add `ClassFileTransformer`s on the fly without Java agent
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.lang.instrument.ClassFileTransformer;
import java.lang.instrument.IllegalClassFormatException;
import java.lang.reflect.Field;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.Enumeration;
import java.util.List;
@serkan-ozal
serkan-ozal / JMM_Memory_Barriers.md
Last active February 10, 2017 17:03
JMM Memory Barriers
[StoreStore]
<volatile_store>
[StoreLoad]
<volatile_load>
[LoadLoad|LoadStore]
{
"env": [
"+ env",
"AWS_LAMBDA_FUNCTION_VERSION=$LATEST",
"AWS_SESSION_TOKEN=**************",
"AWS_LAMBDA_LOG_GROUP_NAME=/aws/lambda/lb_runCommand",
"LAMBDA_TASK_ROOT=/var/task",
"LD_LIBRARY_PATH=/lib64:/usr/lib64:/var/runtime:/var/runtime/lib:/var/task:/var/task/lib",
"AWS_LAMBDA_LOG_STREAM_NAME=2017/01/06/[$LATEST]8d6559c688e44b7fa175393949f6c4b2",
"NLSPATH=/usr/dt/lib/nls/msg/%L/%N.cat",