Benchmarking Clojure Application

This is a snippet for benchmarking clojure application which I have used quite often in clojure applications at my job. First an introduction to the tools: clj-asyc-profiler: for flamegraphs and call graph. criterion: for statistically correct benchmarking. tufte: application level profiling. from this we can keep both #1 and #2 in separate profile just for benchmarking and #3 must be included in the :default profile, otherwise it would defeat its purpose....

March 3, 2024 · 5 min · Upendra Upadhyay

Exploring Resource Directory in Clojure

I was trying to explore the files available in resource directory and read only the .txt files available. suppose that I have these files in resources: resources/ └── hello ├── a.txt ├── b.txt └── c.not-txt and this is the clojure code that I have to read the files: (ns jar-resource-read.core (:require [clojure.java.io :refer [resource file]]) (:gen-class)) (defn read-all-txt-files [] (let [txt-files (->> (resource "hello") (file) (file-seq) (filter #(-> %1 (.getName) (....

March 2, 2024 · 2 min · Upendra Upadhyay

Nim Clojure Similarity

Hello world, I am Upendra Upadhyay. This is my first post and I have been trying to write for a long time. I think there is no better time than now. I have been trying to learn Haskell for past 3 years in my free time, but was never able to code anything useful; mostly did fibonacci, sieve of eratosthenes, and sudoku - which was taking lot of memory and time because of bad pruning....

November 26, 2022 · 2 min · Upendra Upadhyay